3 namespace Drupal\Tests\aggregator\Kernel\Migrate;
5 use Drupal\migrate\MigrateException;
6 use Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase;
7 use Drupal\migrate_drupal\Tests\StubTestTrait;
10 * Test stub creation for aggregator feeds and items.
14 class MigrateAggregatorStubTest extends MigrateDrupalTestBase {
21 public static $modules = ['aggregator'];
26 protected function setUp() {
28 $this->installEntitySchema('aggregator_feed');
29 $this->installEntitySchema('aggregator_item');
33 * Tests creation of aggregator feed stubs.
35 public function testFeedStub() {
36 $this->performStubTest('aggregator_feed');
40 * Tests creation of aggregator feed items.
42 public function testItemStub() {
44 // We expect an exception, because there's no feed to reference.
45 $this->performStubTest('aggregator_item');
46 $this->fail('Expected exception has not been thrown.');
48 catch (MigrateException $e) {
49 $this->assertIdentical($e->getMessage(),
50 'Stubbing failed, unable to generate value for field fid');
53 // The stub should pass when there's a feed to point to.
54 $this->createStub('aggregator_feed');
55 $this->performStubTest('aggregator_item');