You are here

public function MetatagTestBase::createTestObject in Metatag 7

Creates an object which can be used for generating and checking behavior.

Parameters

string $identifier: The machine name to identify this object in source code.

string $path: Path where generate metatags.

Return value

object A mapping object.

3 calls to MetatagTestBase::createTestObject()
MetatagContextTest::testFrontPage in metatag_context/tests/MetatagContextTest.test
Test handling the front page.
MetatagContextTest::testNode in metatag_context/tests/MetatagContextTest.test
Test handling a node.
MetatagContextWithI18nTest::testContextI18n in metatag_context/tests/MetatagContextWithI18nTest.test
Verify that strings are added to the translation system.

File

tests/MetatagTestBase.test, line 572
A base class for the Metatag tests, provides shared methods.

Class

MetatagTestBase
A base class for the Metatag tests, provides shared methods.

Code

public function createTestObject($identifier, $path) {
  $test_object = new stdClass();
  $test_object->name = $identifier;
  $test_object->path = $path;
  $test_object->title = "My {$identifier} title";
  $test_object->description = "My {$identifier} description";
  $test_object->abstract = "My {$identifier} abstract";
  $test_object->keywords = "My {$identifier} keywords";
  return $test_object;
}