Drupal 8  8.0.2
ViewKernelTestBase Class Reference

Inherits KernelTestBase.

Inherited by IntegrationTest, CommentUserNameTest, CommentViewKernelTestBase, ViewsIntegrationTest, EntityReferenceRelationshipTest, ExtensionViewsFieldTest, FileViewsDataTest, ImageViewsDataTest, LanguageTestBase, NidArgumentTest, OptionsTestBase, UserKernelTestBase, BasicTest, RowEntityRenderersTest, ViewEntityDependenciesTest, ViewsEntitySchemaSubscriberIntegrationTest, AreaEntityTest, AreaMessagesTest, AreaTextTest, AreaTitleTest, AreaViewTest, ArgumentDateTest, ArgumentNullTest, FieldBooleanTest, FieldCounterTest, FieldCustomTest, FieldDateTest, FieldEntityLinkTest, FieldFieldAccessTestBase, FieldFieldTest, FieldFileSizeTest, FieldKernelTest, FieldUrlTest, FilterBooleanOperatorStringTest, FilterBooleanOperatorTest, FilterCombineTest, FilterEqualityTest, FilterInOperatorTest, FilterNumericTest, FilterStringTest, HandlerAliasTest, SortDateTest, SortRandomTest, SortTest, ModuleTest, ArgumentValidatorTest, BlockDependenciesTest, CacheTest, DisplayKernelTest, DisplayPageTest, PagerKernelTest, PluginKernelTestBase, QueryTest, RowEntityTest, RowRenderCacheTest, SqlQueryTest, StyleHtmlListTest, StyleTestBase, ViewsBlockTest, PluginInstanceTest, QueryGroupByTest, RenderCacheIntegrationTest, TokenReplaceTest, ViewExecutableTest, ViewsHooksTest, ViewStorageTest, WizardPluginBaseKernelTest, and TagTest.

Static Public Attributes

static $modules = array('system', 'views', 'views_test_config', 'views_test_data', 'user')
 

Protected Member Functions

 setUp ($import_test_views=TRUE)
 
 setUpFixtures ()
 
 orderResultSet ($result_set, $column, $reverse=FALSE)
 
 executeView ($view, array $args=array())
 
 schemaDefinition ()
 
 viewsData ()
 
 dataSet ()
 

Detailed Description

Defines a base class for Views unit testing.

Use this test class for unit tests of Views functionality. If a test requires the full web test environment provided by WebTestBase, extend ViewTestBase instead.

See Also

Member Function Documentation

dataSet ( )
protected

Returns a very simple test dataset.

References ViewTestData\dataSet().

Referenced by StyleMappingTest\mappedOutputHelper(), ViewKernelTestBase\setUpFixtures(), SortDateTest\testDateOrdering(), SortTest\testNumericOrdering(), FieldKernelTest\testQuery(), RelationshipTest\testRelationshipQuery(), BasicTest\testSimpleArgument(), BasicTest\testSimpleResultSet(), and SortTest\testStringOrdering().

Here is the call graph for this function:

Here is the caller graph for this function:

executeView (   $view,
array  $args = array() 
)
protected

Executes a view with debugging.

Parameters
\Drupal\views\ViewExecutable$viewThe view object.
array$args(optional) An array of the view arguments to use for the view.

Referenced by QueryGroupByTest\groupByTestHelper(), QueryGroupByTest\testAggregateCount(), ArgumentLanguageTest\testArgument(), CacheTest\testCacheContextIntegration(), CacheTest\testCacheData(), ArgumentDateTest\testCreatedFullDateHandler(), FieldCustomTest\testCustomFieldXss(), SortDateTest\testDateOrdering(), ArgumentDateTest\testDayHandler(), FieldLanguageTest\testField(), FieldCustomTest\testFieldCustom(), FieldDateTest\testFieldDate(), HandlerFieldPermissionTest\testFieldPermission(), FilterLanguageTest\testFilter(), FilterBooleanOperatorTest\testFilterBooleanOperator(), FilterBooleanOperatorStringTest\testFilterBooleanOperatorString(), FilterCombineTest\testFilterCombineContainsFieldsOverwritten(), FilterBooleanOperatorTest\testFilterGroupedExposed(), FilterBooleanOperatorStringTest\testFilterGroupedExposed(), HandlerFilterPermissionTest\testFilterPermission(), QueryGroupByTest\testGroupByBaseField(), QueryGroupByTest\testGroupByCountOnlyFilters(), QueryGroupByTest\testGroupByFieldWithCardinality(), ViewsIntegrationTest\testIntegration(), AreaMessagesTest\testMessageText(), ArgumentDateTest\testMonthHandler(), CacheTest\testNoneResultCaching(), SortTest\testNumericOrdering(), FieldKernelTest\testQuery(), SortRandomTest\testRandomOrdering(), RelationshipTest\testRelationshipQuery(), BasicTest\testSimpleArgument(), BasicTest\testSimpleFiltering(), BasicTest\testSimpleResultSet(), SortTest\testStringOrdering(), CacheTest\testSubqueryStringCache(), StyleTableUnitTest\testTable(), CacheTest\testTimeResultCaching(), CacheTest\testTimeResultCachingWithFilter(), CacheTest\testTimeResultCachingWithPager(), AreaTitleTest\testTitleText(), TokenReplaceTest\testTokenReplacement(), OptionsListArgumentTest\testViewsTestOptionsListArgument(), OptionsListFilterTest\testViewsTestOptionsListFilter(), ArgumentDateTest\testWeekHandler(), ArgumentDateTest\testYearHandler(), and ArgumentDateTest\testYearMonthHandler().

Here is the caller graph for this function:

orderResultSet (   $result_set,
  $column,
  $reverse = FALSE 
)
protected

Orders a nested array containing a result set based on a given column.

Parameters
array$result_setAn array of rows from a result set, with each row as an associative array keyed by column name.
string$columnThe column name by which to sort the result set.
bool$reverse(optional) Boolean indicating whether to sort the result set in reverse order. Defaults to FALSE.
Returns
array The sorted result set.

Referenced by SortTest\testNumericOrdering(), and SortTest\testStringOrdering().

Here is the caller graph for this function:

schemaDefinition ( )
protected

Returns the schema definition.

References ViewTestData\schemaDefinition().

Referenced by ViewKernelTestBase\setUpFixtures().

Here is the call graph for this function:

Here is the caller graph for this function:

setUp (   $import_test_views = TRUE)
protected

{}

Parameters
bool$import_test_viewsShould the views specififed on the test class be imported. If you need to setup some additional stuff, like fields, you need to call false and then call createTestViews for your own.

References ViewTestData\createTestViews(), and ViewKernelTestBase\setUpFixtures().

Here is the call graph for this function:

setUpFixtures ( )
protected

Sets up the configuration and schema of views and views_test_data modules.

Because the schema of views_test_data.module is dependent on the test using it, it cannot be enabled normally.

References ViewKernelTestBase\dataSet(), db_insert(), ViewKernelTestBase\schemaDefinition(), Drupal\service(), Drupal\state(), and ViewKernelTestBase\viewsData().

Referenced by ViewKernelTestBase\setUp().

Here is the call graph for this function:

Here is the caller graph for this function:

viewsData ( )
protected

Returns the views data definition.

References ViewTestData\viewsData().

Referenced by ViewKernelTestBase\setUpFixtures(), and ModuleTest\testViewsGetHandler().

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: