You are here

public function DbDumpCommandTest::testDbDumpCommand in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/tests/src/Kernel/Scripts/DbDumpCommandTest.php \Drupal\Tests\system\Kernel\Scripts\DbDumpCommandTest::testDbDumpCommand()

Test the command directly.

File

core/modules/system/tests/src/Kernel/Scripts/DbDumpCommandTest.php, line 48
Contains \Drupal\Tests\system\Kernel\Scripts\DbDumpCommandTest.

Class

DbDumpCommandTest
Test that the DbDumpCommand works correctly.

Namespace

Drupal\Tests\system\Kernel\Scripts

Code

public function testDbDumpCommand() {
  $command = new DbDumpCommand();
  $command_tester = new CommandTester($command);
  $command_tester
    ->execute([]);

  // Assert that insert exists and that some expected fields exist.
  $output = $command_tester
    ->getDisplay();
  $this
    ->assertContains("createTable('router", $output, 'Table router found');
  $this
    ->assertContains("insert('router", $output, 'Insert found');
  $this
    ->assertContains("'name' => 'test", $output, 'Insert name field found');
  $this
    ->assertContains("'path' => 'test", $output, 'Insert path field found');
  $this
    ->assertContains("'pattern_outline' => 'test", $output, 'Insert pattern_outline field found');
}