public function realistic_dummy_content_DatabaseTestCase::testAttributes in Realistic Dummy Content 7
File
- api/
tests/ realistic_dummy_content_api.db.test, line 38 - This file contains the testing code which requires the database. These tests are slower than the unit tests so we want to limit them.
Class
- realistic_dummy_content_DatabaseTestCase
- The test case
Code
public function testAttributes() {
$node = $this
->drupalCreateNode(array(
'type' => 'article',
));
$modifier = new RealisticDummyContentFieldModifier($node, 'node');
$attributes = $modifier
->GetAttributes();
$existing = array();
foreach ($attributes as $index => $attribute) {
$name = $attribute
->GetName();
$this
->assertFalse(in_array($name, $existing), 'Attribute ' . $name . ' only has one modifier');
$existing[] = $name;
}
}