diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldQueryTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldQueryTest.php index d2081258596..305c2989242 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldQueryTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldQueryTest.php @@ -174,7 +174,7 @@ class EntityFieldQueryTest extends WebTestBase { ->entityCondition('entity_id', '5'); $this->assertEntityFieldQuery($query, array( array('test_entity_bundle', 5), - ), t('Test query on an entity type with a generated bundle.')); + ), 'Test query on an entity type with a generated bundle.'); // Test entity_type condition. $query = new EntityFieldQuery(); @@ -186,7 +186,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 4), array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test entity entity_type condition.')); + ), 'Test entity entity_type condition.'); // Test entity_id condition. $query = new EntityFieldQuery(); @@ -195,7 +195,7 @@ class EntityFieldQueryTest extends WebTestBase { ->entityCondition('entity_id', '3'); $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 3), - ), t('Test entity entity_id condition.')); + ), 'Test entity entity_id condition.'); $query = new EntityFieldQuery(); $query @@ -203,7 +203,7 @@ class EntityFieldQueryTest extends WebTestBase { ->propertyCondition('ftid', '3'); $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 3), - ), t('Test entity entity_id condition and entity_id property condition.')); + ), 'Test entity entity_id condition and entity_id property condition.'); // Test bundle condition. $query = new EntityFieldQuery(); @@ -215,7 +215,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 4), - ), t('Test entity bundle condition: bundle1.')); + ), 'Test entity bundle condition: bundle1.'); $query = new EntityFieldQuery(); $query @@ -224,7 +224,7 @@ class EntityFieldQueryTest extends WebTestBase { $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test entity bundle condition: bundle2.')); + ), 'Test entity bundle condition: bundle2.'); $query = new EntityFieldQuery(); $query @@ -233,7 +233,7 @@ class EntityFieldQueryTest extends WebTestBase { $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test entity bundle condition and bundle property condition.')); + ), 'Test entity bundle condition and bundle property condition.'); // Test revision_id condition. $query = new EntityFieldQuery(); @@ -242,7 +242,7 @@ class EntityFieldQueryTest extends WebTestBase { ->entityCondition('revision_id', '3'); $this->assertEntityFieldQuery($query, array( array('test_entity', 3), - ), t('Test entity revision_id condition.')); + ), 'Test entity revision_id condition.'); $query = new EntityFieldQuery(); $query @@ -250,7 +250,7 @@ class EntityFieldQueryTest extends WebTestBase { ->propertyCondition('ftvid', '3'); $this->assertEntityFieldQuery($query, array( array('test_entity', 3), - ), t('Test entity revision_id condition and revision_id property condition.')); + ), 'Test entity revision_id condition and revision_id property condition.'); $query = new EntityFieldQuery(); $query @@ -260,7 +260,7 @@ class EntityFieldQueryTest extends WebTestBase { $this->assertEntityFieldQuery($query, array( array('test_entity', 100), array('test_entity', 101), - ), t('Test revision age.')); + ), 'Test revision age.'); // Test that fields attached to the non-revision supporting entity // 'test_entity_bundle_key' are reachable in FIELD_LOAD_REVISION. @@ -279,7 +279,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity', 2), array('test_entity', 3), array('test_entity', 4), - ), t('Test that fields are reachable from FIELD_LOAD_REVISION even for non-revision entities.')); + ), 'Test that fields are reachable from FIELD_LOAD_REVISION even for non-revision entities.'); // Test entity sort by entity_id. $query = new EntityFieldQuery(); @@ -293,7 +293,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 4), array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test sort entity entity_id in ascending order.'), TRUE); + ), 'Test sort entity entity_id in ascending order.', TRUE); $query = new EntityFieldQuery(); $query @@ -306,7 +306,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 1), - ), t('Test sort entity entity_id in descending order.'), TRUE); + ), 'Test sort entity entity_id in descending order.', TRUE); // Test entity sort by entity_id, with a field condition. $query = new EntityFieldQuery(); @@ -321,7 +321,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 4), array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test sort entity entity_id in ascending order, with a field condition.'), TRUE); + ), 'Test sort entity entity_id in ascending order, with a field condition.', TRUE); $query = new EntityFieldQuery(); $query @@ -335,7 +335,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 1), - ), t('Test sort entity entity_id property in descending order, with a field condition.'), TRUE); + ), 'Test sort entity entity_id property in descending order, with a field condition.', TRUE); // Test property sort by entity id. $query = new EntityFieldQuery(); @@ -349,7 +349,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 4), array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test sort entity entity_id property in ascending order.'), TRUE); + ), 'Test sort entity entity_id property in ascending order.', TRUE); $query = new EntityFieldQuery(); $query @@ -362,7 +362,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 1), - ), t('Test sort entity entity_id property in descending order.'), TRUE); + ), 'Test sort entity entity_id property in descending order.', TRUE); // Test property sort by entity id, with a field condition. $query = new EntityFieldQuery(); @@ -377,7 +377,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 4), array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test sort entity entity_id property in ascending order, with a field condition.'), TRUE); + ), 'Test sort entity entity_id property in ascending order, with a field condition.', TRUE); $query = new EntityFieldQuery(); $query @@ -391,7 +391,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 1), - ), t('Test sort entity entity_id property in descending order, with a field condition.'), TRUE); + ), 'Test sort entity entity_id property in descending order, with a field condition.', TRUE); // Test entity sort by bundle. $query = new EntityFieldQuery(); @@ -406,7 +406,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 1), array('test_entity_bundle_key', 6), array('test_entity_bundle_key', 5), - ), t('Test sort entity bundle in ascending order, property in descending order.'), TRUE); + ), 'Test sort entity bundle in ascending order, property in descending order.', TRUE); $query = new EntityFieldQuery(); $query @@ -420,7 +420,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 4), - ), t('Test sort entity bundle in descending order, property in ascending order.'), TRUE); + ), 'Test sort entity bundle in descending order, property in ascending order.', TRUE); // Test entity sort by bundle, with a field condition. $query = new EntityFieldQuery(); @@ -436,7 +436,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 1), array('test_entity_bundle_key', 6), array('test_entity_bundle_key', 5), - ), t('Test sort entity bundle in ascending order, property in descending order, with a field condition.'), TRUE); + ), 'Test sort entity bundle in ascending order, property in descending order, with a field condition.', TRUE); $query = new EntityFieldQuery(); $query @@ -451,7 +451,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 4), - ), t('Test sort entity bundle in descending order, property in ascending order, with a field condition.'), TRUE); + ), 'Test sort entity bundle in descending order, property in ascending order, with a field condition.', TRUE); // Test entity sort by bundle, field. $query = new EntityFieldQuery(); @@ -466,7 +466,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 1), array('test_entity_bundle_key', 6), array('test_entity_bundle_key', 5), - ), t('Test sort entity bundle in ascending order, field in descending order.'), TRUE); + ), 'Test sort entity bundle in ascending order, field in descending order.', TRUE); $query = new EntityFieldQuery(); $query @@ -480,7 +480,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 4), - ), t('Test sort entity bundle in descending order, field in ascending order.'), TRUE); + ), 'Test sort entity bundle in descending order, field in ascending order.', TRUE); // Test entity sort by revision_id. $query = new EntityFieldQuery(); @@ -492,7 +492,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity', 2), array('test_entity', 3), array('test_entity', 4), - ), t('Test sort entity revision_id in ascending order.'), TRUE); + ), 'Test sort entity revision_id in ascending order.', TRUE); $query = new EntityFieldQuery(); $query @@ -503,7 +503,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity', 3), array('test_entity', 2), array('test_entity', 1), - ), t('Test sort entity revision_id in descending order.'), TRUE); + ), 'Test sort entity revision_id in descending order.', TRUE); // Test entity sort by revision_id, with a field condition. $query = new EntityFieldQuery(); @@ -516,7 +516,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity', 2), array('test_entity', 3), array('test_entity', 4), - ), t('Test sort entity revision_id in ascending order, with a field condition.'), TRUE); + ), 'Test sort entity revision_id in ascending order, with a field condition.', TRUE); $query = new EntityFieldQuery(); $query @@ -528,7 +528,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity', 3), array('test_entity', 2), array('test_entity', 1), - ), t('Test sort entity revision_id in descending order, with a field condition.'), TRUE); + ), 'Test sort entity revision_id in descending order, with a field condition.', TRUE); // Test property sort by revision_id. $query = new EntityFieldQuery(); @@ -540,7 +540,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity', 2), array('test_entity', 3), array('test_entity', 4), - ), t('Test sort entity revision_id property in ascending order.'), TRUE); + ), 'Test sort entity revision_id property in ascending order.', TRUE); $query = new EntityFieldQuery(); $query @@ -551,7 +551,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity', 3), array('test_entity', 2), array('test_entity', 1), - ), t('Test sort entity revision_id property in descending order.'), TRUE); + ), 'Test sort entity revision_id property in descending order.', TRUE); // Test property sort by revision_id, with a field condition. $query = new EntityFieldQuery(); @@ -564,7 +564,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity', 2), array('test_entity', 3), array('test_entity', 4), - ), t('Test sort entity revision_id property in ascending order, with a field condition.'), TRUE); + ), 'Test sort entity revision_id property in ascending order, with a field condition.', TRUE); $query = new EntityFieldQuery(); $query @@ -576,7 +576,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity', 3), array('test_entity', 2), array('test_entity', 1), - ), t('Test sort entity revision_id property in descending order, with a field condition.'), TRUE); + ), 'Test sort entity revision_id property in descending order, with a field condition.', TRUE); $query = new EntityFieldQuery(); $query @@ -589,7 +589,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 4), array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test sort field in ascending order without field condition.'), TRUE); + ), 'Test sort field in ascending order without field condition.', TRUE); $query = new EntityFieldQuery(); $query @@ -602,7 +602,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 1), - ), t('Test sort field in descending order without field condition.'), TRUE); + ), 'Test sort field in descending order without field condition.', TRUE); $query = new EntityFieldQuery(); $query @@ -616,7 +616,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 4), array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test sort field in ascending order.'), TRUE); + ), 'Test sort field in ascending order.', TRUE); $query = new EntityFieldQuery(); $query @@ -630,7 +630,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 1), - ), t('Test sort field in descending order.'), TRUE); + ), 'Test sort field in descending order.', TRUE); // Test "in" operation with entity entity_type condition and entity_id // property condition. @@ -642,7 +642,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 1), array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 4), - ), t('Test "in" operation with entity entity_type condition and entity_id property condition.')); + ), 'Test "in" operation with entity entity_type condition and entity_id property condition.'); // Test "in" operation with entity entity_type condition and entity_id // property condition. Sort in descending order by entity_id. @@ -655,7 +655,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 4), array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 1), - ), t('Test "in" operation with entity entity_type condition and entity_id property condition. Sort entity_id in descending order.'), TRUE); + ), 'Test "in" operation with entity entity_type condition and entity_id property condition. Sort entity_id in descending order.', TRUE); // Test query count $query = new EntityFieldQuery(); @@ -663,7 +663,7 @@ class EntityFieldQueryTest extends WebTestBase { ->entityCondition('entity_type', 'test_entity_bundle_key') ->count() ->execute(); - $this->assertEqual($query_count, 6, t('Test query count on entity condition.')); + $this->assertEqual($query_count, 6, 'Test query count on entity condition.'); $query = new EntityFieldQuery(); $query_count = $query @@ -671,7 +671,7 @@ class EntityFieldQueryTest extends WebTestBase { ->propertyCondition('ftid', '1') ->count() ->execute(); - $this->assertEqual($query_count, 1, t('Test query count on entity and property condition.')); + $this->assertEqual($query_count, 1, 'Test query count on entity and property condition.'); $query = new EntityFieldQuery(); $query_count = $query @@ -679,7 +679,7 @@ class EntityFieldQueryTest extends WebTestBase { ->propertyCondition('ftid', '4', '>') ->count() ->execute(); - $this->assertEqual($query_count, 2, t('Test query count on entity and property condition with operator.')); + $this->assertEqual($query_count, 2, 'Test query count on entity and property condition with operator.'); $query = new EntityFieldQuery(); $query_count = $query @@ -687,7 +687,7 @@ class EntityFieldQueryTest extends WebTestBase { ->fieldCondition($this->fields[0], 'value', 3, '=') ->count() ->execute(); - $this->assertEqual($query_count, 1, t('Test query count on field condition.')); + $this->assertEqual($query_count, 1, 'Test query count on field condition.'); // First, test without options. $query = new EntityFieldQuery(); @@ -701,13 +701,13 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 4), array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test the "contains" operation on a property.')); + ), 'Test the "contains" operation on a property.'); $query = new EntityFieldQuery(); $query->fieldCondition($this->fields[1], 'shape', 'uar', 'CONTAINS'); $this->assertEntityFieldQuery($query, array( array('test_entity_bundle', 5), - ), t('Test the "contains" operation on a field.')); + ), 'Test the "contains" operation on a field.'); $query = new EntityFieldQuery(); $query @@ -715,14 +715,14 @@ class EntityFieldQueryTest extends WebTestBase { ->propertyCondition('ftid', 1, '='); $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 1), - ), t('Test the "equal to" operation on a property.')); + ), 'Test the "equal to" operation on a property.'); $query = new EntityFieldQuery(); $query->fieldCondition($this->fields[0], 'value', 3, '='); $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 3), array('test_entity', 3), - ), t('Test the "equal to" operation on a field.')); + ), 'Test the "equal to" operation on a field.'); $query = new EntityFieldQuery(); $query @@ -734,7 +734,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 4), array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test the "not equal to" operation on a property.')); + ), 'Test the "not equal to" operation on a property.'); $query = new EntityFieldQuery(); $query->fieldCondition($this->fields[0], 'value', 3, '<>'); @@ -747,7 +747,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity', 1), array('test_entity', 2), array('test_entity', 4), - ), t('Test the "not equal to" operation on a field.')); + ), 'Test the "not equal to" operation on a field.'); $query = new EntityFieldQuery(); $query @@ -755,14 +755,14 @@ class EntityFieldQueryTest extends WebTestBase { ->propertyCondition('ftid', 2, '<'); $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 1), - ), t('Test the "less than" operation on a property.')); + ), 'Test the "less than" operation on a property.'); $query = new EntityFieldQuery(); $query->fieldCondition($this->fields[0], 'value', 2, '<'); $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 1), array('test_entity', 1), - ), t('Test the "less than" operation on a field.')); + ), 'Test the "less than" operation on a field.'); $query = new EntityFieldQuery(); $query @@ -771,7 +771,7 @@ class EntityFieldQueryTest extends WebTestBase { $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 1), array('test_entity_bundle_key', 2), - ), t('Test the "less than or equal to" operation on a property.')); + ), 'Test the "less than or equal to" operation on a property.'); $query = new EntityFieldQuery(); $query->fieldCondition($this->fields[0], 'value', 2, '<='); @@ -780,7 +780,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 2), array('test_entity', 1), array('test_entity', 2), - ), t('Test the "less than or equal to" operation on a field.')); + ), 'Test the "less than or equal to" operation on a field.'); $query = new EntityFieldQuery(); $query @@ -789,7 +789,7 @@ class EntityFieldQueryTest extends WebTestBase { $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test the "greater than" operation on a property.')); + ), 'Test the "greater than" operation on a property.'); $query = new EntityFieldQuery(); $query->fieldCondition($this->fields[0], 'value', 2, '>'); @@ -800,7 +800,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 6), array('test_entity', 3), array('test_entity', 4), - ), t('Test the "greater than" operation on a field.')); + ), 'Test the "greater than" operation on a field.'); $query = new EntityFieldQuery(); $query @@ -810,7 +810,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 4), array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test the "greater than or equal to" operation on a property.')); + ), 'Test the "greater than or equal to" operation on a property.'); $query = new EntityFieldQuery(); $query->fieldCondition($this->fields[0], 'value', 3, '>='); @@ -821,7 +821,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 6), array('test_entity', 3), array('test_entity', 4), - ), t('Test the "greater than or equal to" operation on a field.')); + ), 'Test the "greater than or equal to" operation on a field.'); $query = new EntityFieldQuery(); $query @@ -832,7 +832,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test the "not in" operation on a property.')); + ), 'Test the "not in" operation on a property.'); $query = new EntityFieldQuery(); $query->fieldCondition($this->fields[0], 'value', array(3, 4, 100, 101), 'NOT IN'); @@ -843,7 +843,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 6), array('test_entity', 1), array('test_entity', 2), - ), t('Test the "not in" operation on a field.')); + ), 'Test the "not in" operation on a field.'); $query = new EntityFieldQuery(); $query @@ -852,7 +852,7 @@ class EntityFieldQueryTest extends WebTestBase { $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 4), - ), t('Test the "in" operation on a property.')); + ), 'Test the "in" operation on a property.'); $query = new EntityFieldQuery(); $query->fieldCondition($this->fields[0], 'value', array(2, 3), 'IN'); @@ -861,7 +861,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 3), array('test_entity', 2), array('test_entity', 3), - ), t('Test the "in" operation on a field.')); + ), 'Test the "in" operation on a field.'); $query = new EntityFieldQuery(); $query @@ -871,7 +871,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 1), array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 3), - ), t('Test the "between" operation on a property.')); + ), 'Test the "between" operation on a property.'); $query = new EntityFieldQuery(); $query->fieldCondition($this->fields[0], 'value', array(1, 3), 'BETWEEN'); @@ -882,7 +882,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity', 1), array('test_entity', 2), array('test_entity', 3), - ), t('Test the "between" operation on a field.')); + ), 'Test the "between" operation on a field.'); $query = new EntityFieldQuery(); $query @@ -895,20 +895,20 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 4), array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test the "starts_with" operation on a property.')); + ), 'Test the "starts_with" operation on a property.'); $query = new EntityFieldQuery(); $query->fieldCondition($this->fields[1], 'shape', 'squ', 'STARTS_WITH'); $this->assertEntityFieldQuery($query, array( array('test_entity_bundle', 5), - ), t('Test the "starts_with" operation on a field.')); + ), 'Test the "starts_with" operation on a field.'); $query = new EntityFieldQuery(); $query->fieldCondition($this->fields[0], 'value', 3); $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 3), array('test_entity', 3), - ), t('Test omission of an operator with a single item.')); + ), 'Test omission of an operator with a single item.'); $query = new EntityFieldQuery(); $query->fieldCondition($this->fields[0], 'value', array(2, 3)); @@ -917,7 +917,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 3), array('test_entity', 2), array('test_entity', 3), - ), t('Test omission of an operator with multiple items.')); + ), 'Test omission of an operator with multiple items.'); $query = new EntityFieldQuery(); $query @@ -927,7 +927,7 @@ class EntityFieldQueryTest extends WebTestBase { $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 3), - ), t('Test entity, property and field conditions.')); + ), 'Test entity, property and field conditions.'); $query = new EntityFieldQuery(); $query @@ -937,7 +937,7 @@ class EntityFieldQueryTest extends WebTestBase { ->fieldCondition($this->fields[0], 'value', 4); $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 4), - ), t('Test entity condition with "starts_with" operation, and property and field conditions.')); + ), 'Test entity condition with "starts_with" operation, and property and field conditions.'); $query = new EntityFieldQuery(); $query @@ -947,7 +947,7 @@ class EntityFieldQueryTest extends WebTestBase { $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 1), array('test_entity_bundle_key', 2), - ), t('Test limit on a property.'), TRUE); + ), 'Test limit on a property.', TRUE); $query = new EntityFieldQuery(); $query @@ -958,7 +958,7 @@ class EntityFieldQueryTest extends WebTestBase { $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 1), array('test_entity_bundle_key', 2), - ), t('Test limit on a field.'), TRUE); + ), 'Test limit on a field.', TRUE); $query = new EntityFieldQuery(); $query @@ -968,7 +968,7 @@ class EntityFieldQueryTest extends WebTestBase { $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test offset on a property.'), TRUE); + ), 'Test offset on a property.', TRUE); $query = new EntityFieldQuery(); $query @@ -981,7 +981,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 4), array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test offset on a field.'), TRUE); + ), 'Test offset on a field.', TRUE); for ($i = 6; $i < 10; $i++) { $entity = entity_create('test_entity_bundle', array('ftid' => $i)); @@ -1001,7 +1001,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity', 4), array('test_entity_bundle', 8), array('test_entity_bundle', 9), - ), t('Select a field across multiple entities.')); + ), 'Select a field across multiple entities.'); $query = new EntityFieldQuery(); $query @@ -1009,13 +1009,13 @@ class EntityFieldQueryTest extends WebTestBase { ->fieldCondition($this->fields[1], 'color', 'blue'); $this->assertEntityFieldQuery($query, array( array('test_entity_bundle', 5), - ), t('Test without a delta group.')); + ), 'Test without a delta group.'); $query = new EntityFieldQuery(); $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.')); + $this->assertEntityFieldQuery($query, array(), 'Test with a delta group.'); // Test query on a deleted field. field_attach_delete_bundle('test_entity_bundle_key', 'bundle1'); @@ -1024,12 +1024,12 @@ class EntityFieldQueryTest extends WebTestBase { $query->fieldCondition($this->fields[0], 'value', '3'); $this->assertEntityFieldQuery($query, array( array('test_entity_bundle', 8), - ), t('Test query on a field after deleting field from some entities.')); + ), 'Test query on a field after deleting field from some entities.'); field_attach_delete_bundle('test_entity_bundle', 'test_entity_bundle'); $query = new EntityFieldQuery(); $query->fieldCondition($this->fields[0], 'value', '3'); - $this->assertEntityFieldQuery($query, array(), t('Test query on a field after deleting field from all entities.')); + $this->assertEntityFieldQuery($query, array(), 'Test query on a field after deleting field from all entities.'); $query = new EntityFieldQuery(); $query @@ -1039,7 +1039,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 3), array('test_entity_bundle', 8), array('test_entity', 3), - ), t('Test query on a deleted field with deleted option set to TRUE.')); + ), 'Test query on a deleted field with deleted option set to TRUE.'); $pass = FALSE; $query = new EntityFieldQuery(); @@ -1049,7 +1049,7 @@ class EntityFieldQueryTest extends WebTestBase { catch (EntityFieldQueryException $exception) { $pass = ($exception->getMessage() == t('For this query an entity type must be specified.')); } - $this->assertTrue($pass, t("Can't query the universe.")); + $this->assertTrue($pass, 'Cannot query the universe.'); } /** @@ -1084,7 +1084,7 @@ class EntityFieldQueryTest extends WebTestBase { ->count() ->execute(); - $this->assertEqual($query_count, 1, t("Count on translatable cardinality one field is correct.")); + $this->assertEqual($query_count, 1, 'Count on translatable cardinality one field is correct.'); } @@ -1117,7 +1117,7 @@ class EntityFieldQueryTest extends WebTestBase { ->fieldDeltaCondition($this->fields[0], 0, '>'); $this->assertEntityFieldQuery($query, array( array('test_entity', 1), - ), t('Test with a delta meta condition.')); + ), 'Test with a delta meta condition.'); // Test language field meta condition. $query = new EntityFieldQuery(); @@ -1126,7 +1126,7 @@ class EntityFieldQueryTest extends WebTestBase { ->fieldLanguageCondition($this->fields[0], LANGUAGE_NOT_SPECIFIED, '<>'); $this->assertEntityFieldQuery($query, array( array('test_entity', 1), - ), t('Test with a language meta condition.')); + ), 'Test with a language meta condition.'); // Test delta grouping. $query = new EntityFieldQuery(); @@ -1136,14 +1136,14 @@ class EntityFieldQueryTest extends WebTestBase { ->fieldDeltaCondition($this->fields[0], 1, '<', 'group'); $this->assertEntityFieldQuery($query, array( array('test_entity', 1), - ), t('Test with a grouped delta meta condition.')); + ), 'Test with a grouped delta meta condition.'); $query = new EntityFieldQuery(); $query ->entityCondition('entity_type', 'test_entity', '=') ->fieldCondition($this->fields[0], 'value', 0, '=', 'group') ->fieldDeltaCondition($this->fields[0], 1, '>=', 'group'); - $this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta meta condition (empty result set).')); + $this->assertEntityFieldQuery($query, array(), 'Test with a grouped delta meta condition (empty result set).'); // Test language grouping. $query = new EntityFieldQuery(); @@ -1153,14 +1153,14 @@ class EntityFieldQueryTest extends WebTestBase { ->fieldLanguageCondition($this->fields[0], 'en', '<>', NULL, 'group'); $this->assertEntityFieldQuery($query, array( array('test_entity', 1), - ), t('Test with a grouped language meta condition.')); + ), 'Test with a grouped language meta condition.'); $query = new EntityFieldQuery(); $query ->entityCondition('entity_type', 'test_entity', '=') ->fieldCondition($this->fields[0], 'value', 0, '=', NULL, 'group') ->fieldLanguageCondition($this->fields[0], LANGUAGE_NOT_SPECIFIED, '<>', NULL, 'group'); - $this->assertEntityFieldQuery($query, array(), t('Test with a grouped language meta condition (empty result set).')); + $this->assertEntityFieldQuery($query, array(), 'Test with a grouped language meta condition (empty result set).'); // Test delta and language grouping. $query = new EntityFieldQuery(); @@ -1171,7 +1171,7 @@ class EntityFieldQueryTest extends WebTestBase { ->fieldLanguageCondition($this->fields[0], 'en', '<>', 'delta', 'language'); $this->assertEntityFieldQuery($query, array( array('test_entity', 1), - ), t('Test with a grouped delta + language meta condition.')); + ), 'Test with a grouped delta + language meta condition.'); $query = new EntityFieldQuery(); $query @@ -1179,7 +1179,7 @@ class EntityFieldQueryTest extends WebTestBase { ->fieldCondition($this->fields[0], 'value', 0, '=', 'delta', 'language') ->fieldDeltaCondition($this->fields[0], 1, '>=', 'delta', 'language') ->fieldLanguageCondition($this->fields[0], 'en', '<>', 'delta', 'language'); - $this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta + language meta condition (empty result set, delta condition unsatisifed).')); + $this->assertEntityFieldQuery($query, array(), 'Test with a grouped delta + language meta condition (empty result set, delta condition unsatisifed).'); $query = new EntityFieldQuery(); $query @@ -1187,7 +1187,7 @@ class EntityFieldQueryTest extends WebTestBase { ->fieldCondition($this->fields[0], 'value', 0, '=', 'delta', 'language') ->fieldDeltaCondition($this->fields[0], 1, '<', 'delta', 'language') ->fieldLanguageCondition($this->fields[0], LANGUAGE_NOT_SPECIFIED, '<>', 'delta', 'language'); - $this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta + language meta condition (empty result set, language condition unsatisifed).')); + $this->assertEntityFieldQuery($query, array(), 'Test with a grouped delta + language meta condition (empty result set, language condition unsatisifed).'); $query = new EntityFieldQuery(); $query @@ -1195,7 +1195,7 @@ class EntityFieldQueryTest extends WebTestBase { ->fieldCondition($this->fields[0], 'value', 0, '=', 'delta', 'language') ->fieldDeltaCondition($this->fields[0], 1, '>=', 'delta', 'language') ->fieldLanguageCondition($this->fields[0], LANGUAGE_NOT_SPECIFIED, '<>', 'delta', 'language'); - $this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta + language meta condition (empty result set, both conditions unsatisifed).')); + $this->assertEntityFieldQuery($query, array(), 'Test with a grouped delta + language meta condition (empty result set, both conditions unsatisifed).'); // Test grouping with another field to ensure that grouping cache is reset // properly. @@ -1208,7 +1208,7 @@ class EntityFieldQueryTest extends WebTestBase { ->fieldLanguageCondition($this->fields[1], LANGUAGE_NOT_SPECIFIED, '=', 'delta', 'language'); $this->assertEntityFieldQuery($query, array( array('test_entity_bundle', 5), - ), t('Test grouping cache.')); + ), 'Test grouping cache.'); } /** @@ -1218,19 +1218,19 @@ class EntityFieldQueryTest extends WebTestBase { // Entity-only query. $query = new EntityFieldQuery(); $query->entityCondition('entity_type', 'test_entity_bundle_key'); - $this->assertIdentical($query->queryCallback(), array($query, 'propertyQuery'), t('Entity-only queries are handled by the propertyQuery handler.')); + $this->assertIdentical($query->queryCallback(), array($query, 'propertyQuery'), 'Entity-only queries are handled by the propertyQuery handler.'); // Field-only query. $query = new EntityFieldQuery(); $query->fieldCondition($this->fields[0], 'value', '3'); - $this->assertIdentical($query->queryCallback(), 'field_sql_storage_field_storage_query', t('Pure field queries are handled by the Field storage handler.')); + $this->assertIdentical($query->queryCallback(), 'field_sql_storage_field_storage_query', 'Pure field queries are handled by the Field storage handler.'); // Mixed entity and field query. $query = new EntityFieldQuery(); $query ->entityCondition('entity_type', 'test_entity_bundle_key') ->fieldCondition($this->fields[0], 'value', '3'); - $this->assertIdentical($query->queryCallback(), 'field_sql_storage_field_storage_query', t('Mixed queries are handled by the Field storage handler.')); + $this->assertIdentical($query->queryCallback(), 'field_sql_storage_field_storage_query', 'Mixed queries are handled by the Field storage handler.'); // Overriding with $query->executeCallback. $query = new EntityFieldQuery(); @@ -1238,7 +1238,7 @@ class EntityFieldQueryTest extends WebTestBase { $query->executeCallback = 'field_test_dummy_field_storage_query'; $this->assertEntityFieldQuery($query, array( array('user', 1), - ), t('executeCallback can override the query handler.')); + ), 'executeCallback can override the query handler.'); // Overriding with $query->executeCallback via hook_entity_query_alter(). $query = new EntityFieldQuery(); @@ -1247,7 +1247,7 @@ class EntityFieldQueryTest extends WebTestBase { $query->alterMyExecuteCallbackPlease = TRUE; $this->assertEntityFieldQuery($query, array( array('user', 1), - ), t('executeCallback can override the query handler when set in a hook_entity_query_alter().')); + ), 'executeCallback can override the query handler when set in a hook_entity_query_alter().'); // Mixed-storage queries. $query = new EntityFieldQuery(); @@ -1262,7 +1262,7 @@ class EntityFieldQueryTest extends WebTestBase { catch (EntityFieldQueryException $exception) { $pass = ($exception->getMessage() == t("Can't handle more than one field storage engine")); } - $this->assertTrue($pass, t('Cannot query across field storage engines.')); + $this->assertTrue($pass, 'Cannot query across field storage engines.'); } /** @@ -1280,7 +1280,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 1), array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 3), - ), t('Test pager integration in propertyQuery: page 1.'), TRUE); + ), 'Test pager integration in propertyQuery: page 1.', TRUE); $query = new EntityFieldQuery(); $query @@ -1291,7 +1291,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 4), array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test pager integration in propertyQuery: page 2.'), TRUE); + ), 'Test pager integration in propertyQuery: page 2.', TRUE); // Test pager in field storage $_GET['page'] = '0,1'; @@ -1304,7 +1304,7 @@ class EntityFieldQueryTest extends WebTestBase { $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 1), array('test_entity_bundle_key', 2), - ), t('Test pager integration in field storage: page 1.'), TRUE); + ), 'Test pager integration in field storage: page 1.', TRUE); $query = new EntityFieldQuery(); $query @@ -1315,7 +1315,7 @@ class EntityFieldQueryTest extends WebTestBase { $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 4), - ), t('Test pager integration in field storage: page 2.'), TRUE); + ), 'Test pager integration in field storage: page 2.', TRUE); unset($_GET['page']); } @@ -1363,7 +1363,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 4), array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test TableSort by property: ftid ASC in propertyQuery.'), TRUE); + ), 'Test TableSort by property: ftid ASC in propertyQuery.', TRUE); $_GET['sort'] = 'desc'; $_GET['order'] = 'Id'; @@ -1378,7 +1378,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 1), - ), t('Test TableSort by property: ftid DESC in propertyQuery.'), TRUE); + ), 'Test TableSort by property: ftid DESC in propertyQuery.', TRUE); $_GET['sort'] = 'asc'; $_GET['order'] = 'Type'; @@ -1393,7 +1393,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 4), array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test TableSort by entity: bundle ASC in propertyQuery.'), TRUE); + ), 'Test TableSort by entity: bundle ASC in propertyQuery.', TRUE); $_GET['sort'] = 'desc'; $_GET['order'] = 'Type'; @@ -1408,7 +1408,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 4), - ), t('Test TableSort by entity: bundle DESC in propertyQuery.'), TRUE); + ), 'Test TableSort by entity: bundle DESC in propertyQuery.', TRUE); // Test TableSort in field storage $_GET['sort'] = 'asc'; @@ -1430,7 +1430,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 4), array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test TableSort by property: ftid ASC in field storage.'), TRUE); + ), 'Test TableSort by property: ftid ASC in field storage.', TRUE); $_GET['sort'] = 'desc'; $_GET['order'] = 'Id'; @@ -1446,7 +1446,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 1), - ), t('Test TableSort by property: ftid DESC in field storage.'), TRUE); + ), 'Test TableSort by property: ftid DESC in field storage.', TRUE); $_GET['sort'] = 'asc'; $_GET['order'] = 'Type'; @@ -1463,7 +1463,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 1), array('test_entity_bundle_key', 6), array('test_entity_bundle_key', 5), - ), t('Test TableSort by entity: bundle ASC in field storage.'), TRUE); + ), 'Test TableSort by entity: bundle ASC in field storage.', TRUE); $_GET['sort'] = 'desc'; $_GET['order'] = 'Type'; @@ -1480,7 +1480,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 4), - ), t('Test TableSort by entity: bundle DESC in field storage.'), TRUE); + ), 'Test TableSort by entity: bundle DESC in field storage.', TRUE); $_GET['sort'] = 'asc'; $_GET['order'] = 'Field'; @@ -1496,7 +1496,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 4), array('test_entity_bundle_key', 5), array('test_entity_bundle_key', 6), - ), t('Test TableSort by field ASC.'), TRUE); + ), 'Test TableSort by field ASC.', TRUE); $_GET['sort'] = 'desc'; $_GET['order'] = 'Field'; @@ -1512,7 +1512,7 @@ class EntityFieldQueryTest extends WebTestBase { array('test_entity_bundle_key', 3), array('test_entity_bundle_key', 2), array('test_entity_bundle_key', 1), - ), t('Test TableSort by field DESC.'), TRUE); + ), 'Test TableSort by field DESC.', TRUE); unset($_GET['sort']); unset($_GET['order']); diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFormTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFormTest.php index cfb6ffc837b..3cb497be11e 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFormTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFormTest.php @@ -51,7 +51,7 @@ class EntityFormTest extends WebTestBase { $this->drupalPost('entity-test/add', $edit, t('Save')); $entity = $this->loadEntityByName($name1); - $this->assertTrue($entity, t('Entity found in the database.')); + $this->assertTrue($entity, 'Entity found in the database.'); $edit['name'] = $name2; $this->drupalPost('entity-test/manage/' . $entity->id() . '/edit', $edit, t('Save')); @@ -63,7 +63,7 @@ class EntityFormTest extends WebTestBase { $this->drupalPost('entity-test/manage/' . $entity->id() . '/edit', array(), t('Delete')); $entity = $this->loadEntityByName($name2); - $this->assertFalse($entity, t('Entity not found in the database.')); + $this->assertFalse($entity, 'Entity not found in the database.'); } /** diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationFormTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationFormTest.php index cf793c23435..de68e5247c5 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationFormTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationFormTest.php @@ -88,7 +88,7 @@ class EntityTranslationFormTest extends WebTestBase { $this->drupalGet('admin/structure/types/manage/page'); $edit = array('node_type_language_hidden' => FALSE, 'node_type_language_default' => LANGUAGE_NOT_SPECIFIED); $this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type')); - $this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Basic page')), t('Basic page content type has been updated.')); + $this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Basic page')), 'Basic page content type has been updated.'); // Create a node with language. $edit = array(); @@ -98,18 +98,18 @@ class EntityTranslationFormTest extends WebTestBase { $edit["body[$field_langcode][0][value]"] = $this->randomName(16); $edit['langcode'] = $langcode; $this->drupalPost('node/add/page', $edit, t('Save')); - $this->assertRaw(t('Basic page %title has been created.', array('%title' => $edit["title"])), t('Basic page created.')); + $this->assertRaw(t('Basic page %title has been created.', array('%title' => $edit["title"])), 'Basic page created.'); // Check to make sure the node was created. $node = $this->drupalGetNodeByTitle($edit["title"]); - $this->assertTrue($node, t('Node found in database.')); + $this->assertTrue($node, 'Node found in database.'); // Make body translatable. $field = field_info_field('body'); $field['translatable'] = TRUE; field_update_field($field); $field = field_info_field('body'); - $this->assertTrue($field['translatable'], "Field body is translatable."); + $this->assertTrue($field['translatable'], 'Field body is translatable.'); // Create a body translation and check the form language. $langcode2 = $this->langcodes[1];