MigrateAggregatorStubTest.php in Zircon Profile 8.0
File
core/modules/aggregator/src/Tests/Migrate/MigrateAggregatorStubTest.php
View source
<?php
namespace Drupal\aggregator\Tests\Migrate;
use Drupal\migrate\MigrateException;
use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase;
use Drupal\migrate_drupal\Tests\StubTestTrait;
class MigrateAggregatorStubTest extends MigrateDrupalTestBase {
use StubTestTrait;
public static $modules = [
'aggregator',
];
protected function setUp() {
parent::setUp();
$this
->installEntitySchema('aggregator_feed');
$this
->installEntitySchema('aggregator_item');
}
public function testFeedStub() {
$this
->performStubTest('aggregator_feed');
}
public function testItemStub() {
try {
$this
->performStubTest('aggregator_item');
$this
->fail('Expected exception has not been thrown.');
} catch (MigrateException $e) {
$this
->assertIdentical($e
->getMessage(), 'Stubbing failed, unable to generate value for field fid');
}
$this
->createStub('aggregator_feed');
$this
->performStubTest('aggregator_item');
}
}