summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-06-25 20:32:43 +0000
committerDries Buytaert <dries@buytaert.net>2010-06-25 20:32:43 +0000
commit06ec17f5ea26eb6ba405773f2b7eb7930db9dee0 (patch)
tree13a407718f861c9a9b5bf067a7cf8961ee43551b
parentac63fa94b578151068cd11e25f88952c74c12cd3 (diff)
downloadbrdo-06ec17f5ea26eb6ba405773f2b7eb7930db9dee0.tar.gz
brdo-06ec17f5ea26eb6ba405773f2b7eb7930db9dee0.tar.bz2
- Patch #832746 by dmitrig01: fix inconsistent formatting of entity_query().test.
-rw-r--r--modules/simpletest/tests/entity_query.test68
1 files changed, 39 insertions, 29 deletions
diff --git a/modules/simpletest/tests/entity_query.test b/modules/simpletest/tests/entity_query.test
index b765d03d2..359e6fb93 100644
--- a/modules/simpletest/tests/entity_query.test
+++ b/modules/simpletest/tests/entity_query.test
@@ -318,7 +318,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
), t('Test sort entity bundle in ascending order.'), TRUE);
$query = new EntityFieldQuery();
- $foo = $query
+ $query
->entityCondition('entity_type', 'test_entity_bundle_key')
->entityOrderBy('bundle', 'DESC')
->propertyOrderBy('ftid', 'DESC');
@@ -378,8 +378,9 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
), t('Test sort entity revision_id property in descending order.'), TRUE);
$query = new EntityFieldQuery();
- $query->entityCondition('entity_type', 'test_entity_bundle_key');
- $query->fieldOrderBy($this->fields[0], 'value', 'ASC');
+ $query
+ ->entityCondition('entity_type', 'test_entity_bundle_key')
+ ->fieldOrderBy($this->fields[0], 'value', 'ASC');
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 1),
array('test_entity_bundle_key', 2),
@@ -388,8 +389,9 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
), t('Test sort field in ascending order without field condition.'), TRUE);
$query = new EntityFieldQuery();
- $query->entityCondition('entity_type', 'test_entity_bundle_key');
- $query->fieldOrderBy($this->fields[0], 'value', 'DESC');
+ $query
+ ->entityCondition('entity_type', 'test_entity_bundle_key')
+ ->fieldOrderBy($this->fields[0], 'value', 'DESC');
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 3),
@@ -398,9 +400,10 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
), t('Test sort field in descending order without field condition.'), TRUE);
$query = new EntityFieldQuery();
- $query->entityCondition('entity_type', 'test_entity_bundle_key');
- $query->fieldCondition($this->fields[0], 'value', 0, '>');
- $query->fieldOrderBy($this->fields[0], 'value', 'asc');
+ $query
+ ->entityCondition('entity_type', 'test_entity_bundle_key')
+ ->fieldCondition($this->fields[0], 'value', 0, '>')
+ ->fieldOrderBy($this->fields[0], 'value', 'asc');
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 1),
array('test_entity_bundle_key', 2),
@@ -409,9 +412,10 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
), t('Test sort field in ascending order.'), TRUE);
$query = new EntityFieldQuery();
- $query->entityCondition('entity_type', 'test_entity_bundle_key');
- $query->fieldCondition($this->fields[0], 'value', 0, '>');
- $query->fieldOrderBy($this->fields[0], 'value', 'desc');
+ $query
+ ->entityCondition('entity_type', 'test_entity_bundle_key')
+ ->fieldCondition($this->fields[0], 'value', 0, '>')
+ ->fieldOrderBy($this->fields[0], 'value', 'desc');
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 3),
@@ -715,38 +719,42 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
), t('Test entity condition with "starts_with" operation, and property and field conditions.'));
$query = new EntityFieldQuery();
- $query->entityCondition('entity_type', 'test_entity_bundle_key');
- $query->propertyOrderBy('ftid', 'asc');
- $query->range(0, 2);
+ $query
+ ->entityCondition('entity_type', 'test_entity_bundle_key')
+ ->propertyOrderBy('ftid', 'asc')
+ ->range(0, 2);
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 1),
array('test_entity_bundle_key', 2),
), t('Test limit on a property.'), TRUE);
$query = new EntityFieldQuery();
- $query->entityCondition('entity_type', 'test_entity_bundle_key');
- $query->fieldCondition($this->fields[0], 'value', 0, '>=');
- $query->fieldOrderBy($this->fields[0], 'value', 'asc');
- $query->range(0, 2);
+ $query
+ ->entityCondition('entity_type', 'test_entity_bundle_key')
+ ->fieldCondition($this->fields[0], 'value', 0, '>=')
+ ->fieldOrderBy($this->fields[0], 'value', 'asc')
+ ->range(0, 2);
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 1),
array('test_entity_bundle_key', 2),
), t('Test limit on a field.'), TRUE);
$query = new EntityFieldQuery();
- $query->entityCondition('entity_type', 'test_entity_bundle_key');
- $query->propertyOrderBy('ftid', 'asc');
- $query->range(4, 6);
+ $query
+ ->entityCondition('entity_type', 'test_entity_bundle_key')
+ ->propertyOrderBy('ftid', 'asc')
+ ->range(4, 6);
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test offset on a property.'), TRUE);
$query = new EntityFieldQuery();
- $query->entityCondition('entity_type', 'test_entity_bundle_key');
- $query->fieldCondition($this->fields[0], 'value', 0, '>');
- $query->fieldOrderBy($this->fields[0], 'value', 'asc');
- $query->range(2, 4);
+ $query
+ ->entityCondition('entity_type', 'test_entity_bundle_key')
+ ->fieldCondition($this->fields[0], 'value', 0, '>')
+ ->fieldOrderBy($this->fields[0], 'value', 'asc')
+ ->range(2, 4);
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 4),
@@ -772,15 +780,17 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
), t('Select a field across multiple entities.'));
$query = new EntityFieldQuery();
- $query->fieldCondition($this->fields[1], 'shape', 'square');
- $query->fieldCondition($this->fields[1], 'color', 'blue');
+ $query
+ ->fieldCondition($this->fields[1], 'shape', 'square')
+ ->fieldCondition($this->fields[1], 'color', 'blue');
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle', 5),
), t('Test without a delta group.'));
$query = new EntityFieldQuery();
- $query->fieldCondition($this->fields[1], 'shape', 'square', '=', 'group');
- $query->fieldCondition($this->fields[1], 'color', 'blue', '=', 'group');
+ $query
+ ->fieldCondition($this->fields[1], 'shape', 'square', '=', 'group')
+ ->fieldCondition($this->fields[1], 'color', 'blue', '=', 'group');
$this->assertEntityFieldQuery($query, array(), t('Test with a delta group.'));
// Test query on a deleted field.