Issue #2235111 by tstoeckler: EntityQueryTest is fragile.

8.0.x
webchick 2014-04-08 14:03:32 -07:00
parent 64b838adc5
commit d3cb54ec77
1 changed files with 3 additions and 0 deletions

View File

@ -235,6 +235,7 @@ class EntityQueryTest extends EntityUnitTestBase {
// word but allows us to test revisions and string operations. // word but allows us to test revisions and string operations.
$ids = $this->factory->get('entity_test_mulrev') $ids = $this->factory->get('entity_test_mulrev')
->condition("$greetings.value", 'merhaba') ->condition("$greetings.value", 'merhaba')
->sort('id')
->execute(); ->execute();
$entities = entity_load_multiple('entity_test_mulrev', $ids); $entities = entity_load_multiple('entity_test_mulrev', $ids);
foreach ($entities as $entity) { foreach ($entities as $entity) {
@ -267,12 +268,14 @@ class EntityQueryTest extends EntityUnitTestBase {
$this->assertIdentical($results, $assert); $this->assertIdentical($results, $assert);
$results = $this->factory->get('entity_test_mulrev') $results = $this->factory->get('entity_test_mulrev')
->condition("$greetings.value", 'siema', 'STARTS_WITH') ->condition("$greetings.value", 'siema', 'STARTS_WITH')
->sort('revision_id')
->execute(); ->execute();
// Now we only get the ones that originally were siema, entity id 8 and // Now we only get the ones that originally were siema, entity id 8 and
// above. // above.
$this->assertIdentical($results, array_slice($assert, 4, 8, TRUE)); $this->assertIdentical($results, array_slice($assert, 4, 8, TRUE));
$results = $this->factory->get('entity_test_mulrev') $results = $this->factory->get('entity_test_mulrev')
->condition("$greetings.value", 'a', 'ENDS_WITH') ->condition("$greetings.value", 'a', 'ENDS_WITH')
->sort('revision_id')
->execute(); ->execute();
// It is very important that we do not get the ones which only have // It is very important that we do not get the ones which only have
// xsiemax despite originally they were merhaba, ie. ended with a. // xsiemax despite originally they were merhaba, ie. ended with a.