public function MetatagTestBase::generateByPathConfig in Metatag 7
Generates meta tags by path from a test_object.
Parameters
object $test_object: Metatag mapping object.
3 calls to MetatagTestBase::generateByPathConfig()
- 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 590 - 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 generateByPathConfig($test_object) {
// Verify the "add context" page works.
$this
->drupalGet('admin/config/search/metatags/context');
$this
->assertResponse(200);
$this
->assertText(t('Add a meta tag by path'));
// Verify the "add context" page works.
$this
->drupalGet('admin/config/search/metatags/context/add');
$this
->assertResponse(200);
$this
->assertText(t('The unique ID for this metatag path context rule. This must contain only lower case letters, numbers and underscores.'));
// Add new Metatag object for this configuration.
$values = array(
'name' => $test_object->name,
);
$this
->drupalPost('admin/config/search/metatags/context/add', $values, t('Add and configure'));
$this
->assertResponse(200);
}