Same name and namespace in other branches
- 8.9.x core/modules/statistics/tests/src/Kernel/Plugin/migrate/source/NodeCounterTest.php \Drupal\Tests\statistics\Kernel\Plugin\migrate\source\NodeCounterTest
- 9 core/modules/statistics/tests/src/Kernel/Plugin/migrate/source/NodeCounterTest.php \Drupal\Tests\statistics\Kernel\Plugin\migrate\source\NodeCounterTest
Tests the node_counter source plugin.
@covers \Drupal\statistics\Plugin\migrate\source\NodeCounter
@group statistics @group legacy
Hierarchy
- class \Drupal\Tests\migrate\Kernel\MigrateSourceTestBase extends \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase
- class \Drupal\Tests\statistics\Kernel\Plugin\migrate\source\NodeCounterTest
- class \Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase
Expanded class hierarchy of NodeCounterTest
File
- core/
modules/ statistics/ tests/ src/ Kernel/ Plugin/ migrate/ source/ NodeCounterTest.php, line 19
Namespace
Drupal\Tests\statistics\Kernel\Plugin\migrate\sourceView source
class NodeCounterTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'migrate_drupal',
'statistics',
];
/**
* {@inheritdoc}
*/
public static function providerSource() {
$tests = [];
// The source data.
$tests[0]['source_data']['node_counter'] = [
[
'nid' => 1,
'totalcount' => 2,
'daycount' => 0,
'timestamp' => 1421727536,
],
[
'nid' => 2,
'totalcount' => 1,
'daycount' => 0,
'timestamp' => 1471428059,
],
[
'nid' => 3,
'totalcount' => 1,
'daycount' => 0,
'timestamp' => 1471428153,
],
[
'nid' => 4,
'totalcount' => 1,
'daycount' => 1,
'timestamp' => 1478755275,
],
[
'nid' => 5,
'totalcount' => 1,
'daycount' => 1,
'timestamp' => 1478755314,
],
];
// The expected results.
$tests[0]['expected_data'] = $tests[0]['source_data']['node_counter'];
return $tests;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MigrateSourceTestBase:: |
protected | property | The mocked migration. | |
MigrateSourceTestBase:: |
protected | property | The source plugin under test. | |
MigrateSourceTestBase:: |
protected | function | Instantiates the source plugin under test. | |
MigrateSourceTestBase:: |
protected | function | Determines the plugin to be tested by reading the class @covers annotation. | |
MigrateSourceTestBase:: |
protected | function | ||
MigrateSqlSourceTestBase:: |
protected | function | Builds an in-memory SQLite database from a set of source data. | |
MigrateSqlSourceTestBase:: |
public | function | ||
MigrateSqlSourceTestBase:: |
public | function |
Tests the source plugin against a particular data set. Overrides MigrateSourceTestBase:: |
|
NodeCounterTest:: |
protected static | property |
Overrides MigrateSourceTestBase:: |
|
NodeCounterTest:: |
public static | function |