diff --git a/core/tests/Drupal/KernelTests/KernelTestBaseTest.php b/core/tests/Drupal/KernelTests/KernelTestBaseTest.php index ae0da56..f4e351b 100644 --- a/core/tests/Drupal/KernelTests/KernelTestBaseTest.php +++ b/core/tests/Drupal/KernelTests/KernelTestBaseTest.php @@ -90,8 +90,10 @@ public function testSetUp() { $schema = $this->container->get('database')->schema(); $schema->createTable('foo', array( 'fields' => array( - 'name' => array( - 'type' => 'varchar', + 'number' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, ), ), )); @@ -105,9 +107,9 @@ public function testSetUp() { public function testSetUpDoesNotLeak() { $this->assertArrayNotHasKey('destroy-me', $GLOBALS); - $expected = []; + // Ensure that we have a different database prefix. $schema = $this->container->get('database')->schema(); - $this->assertEquals($expected, $schema->findTables('%')); + $this->assertFalse($schema->tableExists('foo')); } /** diff --git a/core/tests/Drupal/Tests/KernelTestBase.php b/core/tests/Drupal/Tests/KernelTestBase.php index 76b25bb..a5504d0 100644 --- a/core/tests/Drupal/Tests/KernelTestBase.php +++ b/core/tests/Drupal/Tests/KernelTestBase.php @@ -7,6 +7,7 @@ namespace Drupal\Tests; +use Drupal\Component\Utility\SafeMarkup; use Drupal\Component\Utility\String; use Drupal\Core\Config\ConfigImporter; use Drupal\Core\Config\StorageComparer; @@ -15,12 +16,9 @@ use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\DependencyInjection\ServiceProviderInterface; use Drupal\Core\DrupalKernel; -use Drupal\Core\Entity\Schema\EntitySchemaProviderInterface; use Drupal\Core\Entity\Sql\SqlEntityStorageInterface; use Drupal\Core\Extension\ExtensionDiscovery; -use Drupal\Core\Logger\RfcLogLevel; use Drupal\Core\Site\Settings; -use Drupal\Core\StreamWrapper\StreamWrapperInterface; use Drupal\simpletest\AssertContentTrait; use Drupal\simpletest\RandomGeneratorTrait; use Psr\Log\LoggerInterface; @@ -756,7 +754,7 @@ protected function installEntitySchema($entity_type_id) { $all_tables_exist = TRUE; foreach ($tables as $table) { if (!$db_schema->tableExists($table)) { - $this->fail(String::format('Installed entity type table for the %entity_type entity type: %table', array( + $this->fail(SafeMarkup::format('Installed entity type table for the %entity_type entity type: %table', array( '%entity_type' => $entity_type_id, '%table' => $table, ))); @@ -764,7 +762,7 @@ protected function installEntitySchema($entity_type_id) { } } if ($all_tables_exist) { - $this->pass(String::format('Installed entity type tables for the %entity_type entity type: %tables', array( + $this->pass(SafeMarkup::format('Installed entity type tables for the %entity_type entity type: %tables', array( '%entity_type' => $entity_type_id, '%tables' => '{' . implode('}, {', $tables) . '}', ))); @@ -886,7 +884,7 @@ protected function render(array &$elements) { $content = $this->container->get('renderer')->render($elements); drupal_process_attached($elements); $this->setRawContent($content); - $this->verbose('
' . String::checkPlain($content));
+ $this->verbose('' . SafeMarkup::checkPlain($content));
return $content;
}