Drupal 8  8.0.2
MigrateTestCase Class Reference
Inheritance diagram for MigrateTestCase:

Public Member Functions

 queryResultTest ($iter, $expected_results)
 
- Public Member Functions inherited from UnitTestCase
 randomMachineName ($length=8)
 
 getConfigFactoryStub (array $configs=array())
 
 getConfigStorageStub (array $configs)
 
 getStringTranslationStub ()
 

Protected Member Functions

 getMigration ()
 
 getDatabase (array $database_contents, $connection_options=[])
 
 createSchemaFromRow (array $row)
 
 getValue ($row, $key)
 
 retrievalAssertHelper ($expected_value, $actual_value, $message)
 
- Protected Member Functions inherited from UnitTestCase
 setUp ()
 
 getRandomGenerator ()
 
 assertArrayEquals (array $expected, array $actual, $message=NULL)
 
 getBlockMockWithMachineName ($machine_name)
 
 getContainerWithCacheTagsInvalidator (CacheTagsInvalidatorInterface $cache_tags_validator)
 
 getClassResolverStub ()
 

Protected Attributes

 $migrationConfiguration = []
 
 $idMap
 
 $migrationStatus = MigrationInterface::STATUS_IDLE
 
- Protected Attributes inherited from UnitTestCase
 $randomGenerator
 
 $root
 

Detailed Description

Provides setup and helper methods for Migrate module tests.

Member Function Documentation

createSchemaFromRow ( array  $row)
protected

Generates a table schema from a row.

Parameters
array$rowThe reference row on which to base the schema.
Returns
array The Schema API-ready table schema.

Referenced by MigrateTestCase\getDatabase(), and MigrateSqlIdMapTest\saveMap().

Here is the caller graph for this function:

getDatabase ( array  $database_contents,
  $connection_options = [] 
)
protected

Gets an SQLite database connection object for use in tests.

Parameters
array$database_contentsThe database contents faked as an array. Each key is a table name, each value is a list of table rows, an associative array of field => value.
array$connection_options(optional) Options for the database connection. Defaults to an empty array.
Returns
The database connection.

References MigrateTestCase\createSchemaFromRow(), Connection\open(), and Drupal\setContainer().

Referenced by MigrateSqlIdMapTest\setUp(), MigrateSqlSourceTestCase\setUp(), and MigrateSqlIdMapTest\testGetRowBySource().

Here is the call graph for this function:

Here is the caller graph for this function:

getValue (   $row,
  $key 
)
protected

Gets the value on a row for a given key.

Parameters
array$rowThe row information.
string$keyThe key identifier.
Returns
mixed The value on a row for a given key.

Referenced by MigrateTestCase\queryResultTest().

Here is the caller graph for this function:

queryResultTest (   $iter,
  $expected_results 
)

Tests a query.

Parameters
array | \Traversable$iterThe countable. foreach-able actual results if a query is being run.
array$expected_resultsAn array of expected results.

References MigrateTestCase\getValue(), and MigrateTestCase\retrievalAssertHelper().

Referenced by MigrateSqlIdMapTest\testGetRowsNeedingUpdate(), MigrateSqlIdMapTest\testPrepareUpdate(), MigrateSqlSourceTestCase\testRetrieval(), MigrateSqlIdMapTest\testSaveIdMapping(), and MigrateSqlIdMapTest\testSetUpdate().

Here is the call graph for this function:

Here is the caller graph for this function:

retrievalAssertHelper (   $expected_value,
  $actual_value,
  $message 
)
protected

Asserts tested values during test retrieval.

Parameters
mixed$expected_valueThe incoming expected value to test.
mixed$actual_valueThe incoming value itself.
string$messageThe tested result as a formatted string.

Referenced by MigrateTestCase\queryResultTest().

Here is the caller graph for this function:


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