You are here

function QuoteTest::addNode in Quote 7

Create a node.

Parameters

String $type: The machine name of the node.

String $body: The contents of the body field.

String $format: The machine name of the body field's text format.

2 calls to QuoteTest::addNode()
QuoteTest::testNodeLink in tests/quote.test
Test the quote link feature.
QuoteTest::testNodeQuote in tests/quote.test
Test the quote filter within nodes (as opposed to within comments).

File

tests/quote.test, line 95
Test the Quote filter.

Class

QuoteTest
@file Test the Quote filter.

Code

function addNode($type = 'quote', $body = NULL, $format = 'quote_format') {
  $edit = array(
    'title' => $this
      ->randomName(),
    'body[und][0][value]' => is_null($body) ? $this->sampleText1 : $body,
    'body[und][0][format]' => $format,
  );
  $this
    ->drupalPost("node/add/{$type}", $edit, t('Save'));
  $this
    ->assertText('Node ' . $edit['title'] . ' has been created', 'Found node creation message', 'Quote');
}