function EntityDependencyTestCase::assertCorrectEntityOrder in Entity Dependency API 7
Checks that entities are in the correct order.
@todo Document me properly.
5 calls to EntityDependencyTestCase::assertCorrectEntityOrder()
- EntityDependencyTestCase::testCumbersomeIterator in ./
entity_dependency.test - Test cumbersome scenario with nodes, taxonomy and users.
- EntityDependencyTestCase::testDanglingTermReferenceIterator in ./
entity_dependency.test - Test worse scenario with nodes, taxonomy and dangling reference to taxonomy term.
- EntityDependencyTestCase::testNode in ./
entity_dependency.test - Test if single node passes iterator.
- EntityDependencyTestCase::testNodeUser in ./
entity_dependency.test - Test basic scenario with node & author.
- EntityDependencyTestCase::testNodeUserComment in ./
entity_dependency.test - Test basic scenario with node & author & comment & commentor.
File
- ./
entity_dependency.test, line 65 - Entity Dependency tests.
Class
- EntityDependencyTestCase
- Tests the entity dependency iterator.
Code
function assertCorrectEntityOrder($entity, $correct_type, $entity_id_name, $correct_id) {
$test = $entity->__metadata['type'] == $correct_type && $entity->{$entity_id_name} == $correct_id;
$placeholders = array(
'%entity_type' => $entity->__metadata['type'],
'%entity_id' => $entity->{$entity_id_name},
);
$this
->assertTrue($test, t('%entity_type %entity_id was iterated over, in correct order.', $placeholders));
}