diff --git a/search_api_db/tests/src/Kernel/BackendTest.php b/search_api_db/tests/src/Kernel/BackendTest.php index 664376f..793aabb 100644 --- a/search_api_db/tests/src/Kernel/BackendTest.php +++ b/search_api_db/tests/src/Kernel/BackendTest.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\search_api_db\Tests\BackendTest. + * Contains \Drupal\Tests\search_api_db\Kernel\BackendTest. */ -namespace Drupal\search_api_db\Tests; +namespace Drupal\Tests\search_api_db\Kernel; use Drupal\Component\Render\FormattableMarkup; use Drupal\Core\Database\Database; @@ -46,6 +46,7 @@ class BackendTest extends KernelTestBase { 'user', 'system', 'entity_test', + 'text', ); /** @@ -71,6 +72,7 @@ class BackendTest extends KernelTestBase { $this->installSchema('search_api', array('search_api_item', 'search_api_task')); $this->installSchema('system', array('router')); $this->installSchema('user', array('users_data')); + $this->installEntitySchema('entity_test'); // Do not use a batch for tracking the initial items after creating an // index when running the tests via the GUI. Otherwise, it seems Drupal's @@ -973,7 +975,7 @@ class BackendTest extends KernelTestBase { $index->save(); $db_info = \Drupal::keyValue(BackendDatabase::INDEXES_KEY_VALUE_STORE_ID)->get($this->indexId); - $this->assertEquals($db_info, array(), 'The index was successfully removed from the server.'); + $this->assertNull($db_info, 'The index was successfully removed from the server.'); $this->assertFalse(Database::getConnection()->schema()->tableExists($normalized_storage_table), 'The index tables were deleted.'); foreach ($field_tables as $field_table) { $this->assertFalse(\Drupal::database()->schema()->tableExists($field_table['table']), new FormattableMarkup('Field table %table exists', array('%table' => $field_table['table']))); @@ -987,7 +989,7 @@ class BackendTest extends KernelTestBase { $server->delete(); $db_info = \Drupal::keyValue(BackendDatabase::INDEXES_KEY_VALUE_STORE_ID)->get($this->indexId); - $this->assertEquals($db_info, array(), 'The index was successfully removed from the server.'); + $this->assertNull($db_info, 'The index was successfully removed from the server.'); $this->assertFalse(Database::getConnection()->schema()->tableExists($normalized_storage_table), 'The index tables were deleted.'); foreach ($field_tables as $field_table) { $this->assertFalse(\Drupal::database()->schema()->tableExists($field_table['table']), new FormattableMarkup('Field table %table exists', array('%table' => $field_table['table']))); @@ -998,7 +1000,7 @@ class BackendTest extends KernelTestBase { $this->assertFalse(\Drupal::moduleHandler()->moduleExists('search_api_db'), 'The Database Search module was successfully uninstalled.'); $tables = \Drupal::database()->schema()->findTables('search_api_db_%'); - $this->assertEquals($tables, [], 'All the tables of the the Database Search module have been removed.'); + $this->assertEquals($tables, array(), 'All the tables of the the Database Search module have been removed.'); } /** diff --git a/tests/src/Kernel/CustomDataTypesTest.php b/tests/src/Kernel/CustomDataTypesTest.php index 9f1a36c..66f291b 100644 --- a/tests/src/Kernel/CustomDataTypesTest.php +++ b/tests/src/Kernel/CustomDataTypesTest.php @@ -48,6 +48,7 @@ class CustomDataTypesTest extends KernelTestBase { 'user', 'system', 'entity_test', + 'text', ); /** @@ -82,14 +83,16 @@ class CustomDataTypesTest extends KernelTestBase { 'type' => 'item', 'keywords' => array('Orange', 'orange', 'örange', 'Orange'), 'category' => 'item_category' - ))->save(); + )); $this->entities[2] = EntityTest::create(array( 'name' => 'foo bar baz föö smile', 'body' => 'test test case Case casE', 'type' => 'item', 'keywords' => array('strawberry', 'llama'), 'category' => 'item_category' - ))->save(); + )); + $this->entities[1]->save(); + $this->entities[2]->save(); // Create a test server. $this->server = Server::create(array(