You are here

public function MigrateAggregatorStubTest::testItemStub in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/aggregator/src/Tests/Migrate/MigrateAggregatorStubTest.php \Drupal\aggregator\Tests\Migrate\MigrateAggregatorStubTest::testItemStub()

Tests creation of aggregator feed items.

File

core/modules/aggregator/src/Tests/Migrate/MigrateAggregatorStubTest.php, line 47
Contains \Drupal\aggregator\Tests\Migrate\MigrateAggregatorStubTest.

Class

MigrateAggregatorStubTest
Test stub creation for aggregator feeds and items.

Namespace

Drupal\aggregator\Tests\Migrate

Code

public function testItemStub() {
  try {

    // We expect an exception, because there's no feed to reference.
    $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');
  }

  // The stub should pass when there's a feed to point to.
  $this
    ->createStub('aggregator_feed');
  $this
    ->performStubTest('aggregator_item');
}