You are here

public function FeedsDrushCommandsTest::testUnlockFeed in Feeds 8.3

@covers ::unlockFeed

File

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

Class

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

Namespace

Drupal\Tests\feeds\Functional\Commands

Code

public function testUnlockFeed() {

  // Create a feed.
  $feed = $this
    ->createFeed($this->feedType
    ->id(), [
    'title' => 'Foo',
  ]);
  $feed
    ->lock();
  $this
    ->assertTrue($feed
    ->isLocked());
  $this
    ->drush('feeds:unlock', [
    $feed
      ->id(),
  ]);
  $this
    ->assertFalse($feed
    ->isLocked());
  $this
    ->assertStringContainsString('The feed "Foo" has been unlocked.', $this
    ->getErrorOutput());

  // Try to unlock it again.
  $this
    ->drush('feeds:unlock', [
    $feed
      ->id(),
  ]);
  $this
    ->assertStringContainsString('This feed is already unlocked.', $this
    ->getErrorOutput());
}