diff --git a/core/modules/system/tests/src/Kernel/Scripts/DbDumpCommandTest.php b/core/modules/system/tests/src/Kernel/Scripts/DbDumpCommandTest.php index a326494..3f6c768 100644 --- a/core/modules/system/tests/src/Kernel/Scripts/DbDumpCommandTest.php +++ b/core/modules/system/tests/src/Kernel/Scripts/DbDumpCommandTest.php @@ -52,11 +52,11 @@ public function testDbDumpCommand() { // Assert that insert exists and that some expected fields exist. $output = $command_tester->getDisplay(); - $this->assertTrue(strpos($output, "createTable('router"), 'Table router found'); - $this->assertTrue(strpos($output, "insert('router"), 'Insert found'); - $this->assertTrue(strpos($output, "'name' => 'test"), 'Insert name field found'); - $this->assertTrue(strpos($output, "'path' => 'test"), 'Insert path field found'); - $this->assertTrue(strpos($output, "'pattern_outline' => 'test"), 'Insert pattern_outline field found'); + $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'); } /** @@ -69,20 +69,20 @@ public function testSchemaOnly() { // Assert that insert statement doesn't exist for schema only table. $output = $command_tester->getDisplay(); - $this->assertTrue(strpos($output, "createTable('router"), 'Table router found'); - $this->assertFalse(strpos($output, "insert('router"), 'Insert not found'); - $this->assertFalse(strpos($output, "'name' => 'test"), 'Insert name field not found'); - $this->assertFalse(strpos($output, "'path' => 'test"), 'Insert path field not found'); - $this->assertFalse(strpos($output, "'pattern_outline' => 'test"), 'Insert pattern_outline field not found'); + $this->assertContains("createTable('router", $output, 'Table router found'); + $this->assertNotContains("insert('router", $output, 'Insert not found'); + $this->assertNotContains("'name' => 'test", $output, 'Insert name field not found'); + $this->assertNotContains("'path' => 'test", $output, 'Insert path field not found'); + $this->assertNotContains("'pattern_outline' => 'test", $output, 'Insert pattern_outline field not found'); // Assert that insert statement doesn't exist for wildcard schema only match. $command_tester->execute(['--schema-only' => 'route.*']); $output = $command_tester->getDisplay(); - $this->assertTrue(strpos($output, "createTable('router"), 'Table router found'); - $this->assertFalse(strpos($output, "insert('router"), 'Insert not found'); - $this->assertFalse(strpos($output, "'name' => 'test"), 'Insert name field not found'); - $this->assertFalse(strpos($output, "'path' => 'test"), 'Insert path field not found'); - $this->assertFalse(strpos($output, "'pattern_outline' => 'test"), 'Insert pattern_outline field not found'); + $this->assertContains("createTable('router", $output, 'Table router found'); + $this->assertNotContains("insert('router", $output, 'Insert not found'); + $this->assertNotContains("'name' => 'test", $output, 'Insert name field not found'); + $this->assertNotContains("'path' => 'test", $output, 'Insert path field not found'); + $this->assertNotContains("'pattern_outline' => 'test", $output, 'Insert pattern_outline field not found'); } }