Commit b006b77f authored by borisson_'s avatar borisson_ Committed by borisson_
Browse files

Issue #2760711 by borisson_: Fix tests with the newest search api alpha release.

parent 899281f9
......@@ -13,7 +13,7 @@ trait ExampleContentTrait {
/**
* The generated test entities, keyed by ID.
*
* @var \Drupal\entity_test\Entity\EntityTest[]
* @var \Drupal\entity_test\Entity\EntityTestMulRevChanged[]
*/
protected $entities = [];
......@@ -21,18 +21,20 @@ trait ExampleContentTrait {
* Sets up the necessary bundles on the test entity type.
*/
protected function setUpExampleStructure() {
entity_test_create_bundle('item');
entity_test_create_bundle('article');
entity_test_create_bundle('item', NULL, 'entity_test_mulrev_changed');
entity_test_create_bundle('article', NULL, 'entity_test_mulrev_changed');
}
/**
* Creates several test entities.
*/
protected function insertExampleContent() {
$count = \Drupal::entityQuery('entity_test')->count()->execute();
$count = \Drupal::entityQuery('entity_test_mulrev_changed')
->count()
->execute();
$entity_test_storage = \Drupal::entityTypeManager()
->getStorage('entity_test');
->getStorage('entity_test_mulrev_changed');
$this->entities[1] = $entity_test_storage->create(array(
'name' => 'foo bar baz',
'body' => 'test test',
......@@ -71,7 +73,9 @@ trait ExampleContentTrait {
'category' => 'article_category',
));
$this->entities[5]->save();
$count = \Drupal::entityQuery('entity_test')->count()->execute() - $count;
$count = \Drupal::entityQuery('entity_test_mulrev_changed')
->count()
->execute() - $count;
$this->assertEqual($count, 5, "$count items inserted.");
}
......
......@@ -117,7 +117,7 @@ class UrlIntegrationTest extends WebTestBase {
// Add a new entity that has a colon in one of it's keywords.
$entity_test_storage = \Drupal::entityTypeManager()
->getStorage('entity_test');
->getStorage('entity_test_mulrev_changed');
$entity_test_storage->create([
'name' => 'Entity with colon',
'body' => 'test test',
......
......@@ -124,11 +124,11 @@ class WidgetJSTest extends JavascriptTestBase {
* Setup and insert test content.
*/
private function insertExampleContent() {
entity_test_create_bundle('item');
entity_test_create_bundle('article');
entity_test_create_bundle('item', NULL, 'entity_test_mulrev_changed');
entity_test_create_bundle('article', NULL, 'entity_test_mulrev_changed');
$entity_test_storage = \Drupal::entityTypeManager()
->getStorage('entity_test');
->getStorage('entity_test_mulrev_changed');
$entity_1 = $entity_test_storage->create(array(
'name' => 'foo bar baz',
'body' => 'test test',
......@@ -168,7 +168,7 @@ class WidgetJSTest extends JavascriptTestBase {
));
$entity_5->save();
$inserted_entities = \Drupal::entityQuery('entity_test')
$inserted_entities = \Drupal::entityQuery('entity_test_mulrev_changed')
->count()
->execute();
$this->assertEquals(5, $inserted_entities, "5 items inserted.");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment