function QuoteTest::testNodeLink in Quote 7
Test the quote link feature.
File
- tests/
quote.test, line 117 - Test the Quote filter.
Class
- QuoteTest
- @file Test the Quote filter.
Code
function testNodeLink() {
// Test link when quote is enabled for the Quote node type.
$this
->addNode('quote', $this->sampleText1);
$this
->drupalGet('node/1');
$this
->assertLink(t('Quote'), 0, 'Quote link found', 'Quote');
$this
->assertLinkByHref('comment/reply/1?quote=1#comment-form', 0, 'Quote HREF confirmed', 'Quote');
// Click link.
$this
->clickLink(t('Quote'));
// Check if the quote is being included in the comment field.
$this
->assertText('[quote=' . $this->quoteUser->name . ']' . $this->sampleText1 . '[/quote]', 'Comment textarea detected with correct value.', 'Quote');
// Test link when quote is not enabled for the Quote node type.
$this
->quoteConfigure(FALSE);
$this
->drupalGet('node/1');
$this
->assertNoLink(t('Quote'), 0, 'Quote link not found with node link support disabled', 'Quote');
}