protected function MultipleValuesWidgetTest::createNodeForEveryBundle in Inline Entity Form 7
Creates a node for every node bundle.
Return value
array Array of node titles keyed by ids.
1 call to MultipleValuesWidgetTest::createNodeForEveryBundle()
- MultipleValuesWidgetTest::testReferencingExistingEntities in tests/
multiple_values_widget.test - Tests if referencing existing entities work.
File
- tests/
multiple_values_widget.test, line 566
Class
- MultipleValuesWidgetTest
- IEF multiple values field widget tests.
Code
protected function createNodeForEveryBundle() {
$retval = array();
$bundles = node_type_get_types();
foreach ($bundles as $id => $value) {
$this
->drupalCreateNode(array(
'type' => $id,
'title' => $value->name,
));
$node = $this
->drupalGetNodeByTitle($value->name);
$this
->assertTrue($node, 'Created node "' . $node->title . '"');
$retval[$node->nid] = $value->name;
}
return $retval;
}