You are here

public function FeedsDrushCommandsTest::testFeedCommandFailures in Feeds 8.3

Tests commands that require a feed ID.

@dataProvider providerFeed

Parameters

string $expected_output: The expected output.

string $command: The command to execute.

array $args: (optional) Command arguments.

array $options: (optional) An associative array containing options.

File

tests/src/Functional/Commands/FeedsDrushCommandsTest.php, line 249

Class

FeedsDrushCommandsTest
@coversDefaultClass \Drupal\feeds\Commands\FeedsDrushCommands @group feeds

Namespace

Drupal\Tests\feeds\Functional\Commands

Code

public function testFeedCommandFailures($expected_output, $command, array $args = [], array $options = []) {

  // Create a feed.
  $feed = $this
    ->createFeed($this->feedType
    ->id(), [
    'source' => $this
      ->resourcesPath() . '/rss/drupalplanet.rss2',
  ]);
  $this
    ->drush($command, $args, $options, NULL, NULL, 1);

  // Assert that no nodes got imported.
  $this
    ->assertNodeCount(0);

  // Assert the output.
  $this
    ->assertStringContainsString($expected_output, $this
    ->getErrorOutput());
}