You are here

private function PatternsNodeTestCase::testDelete in Patterns 7

Same name and namespace in other branches
  1. 7.2 tests/node/node.test \PatternsNodeTestCase::testDelete()
1 call to PatternsNodeTestCase::testDelete()
PatternsNodeTestCase::testCreateModifyDelete in tests/node/node.test

File

tests/node/node.test, line 61
SimpleTests for the Node component of Patterns (Node).

Class

PatternsNodeTestCase
@file SimpleTests for the Node component of Patterns (Node).

Code

private function testDelete() {

  // Run the pattern.
  parent::runFile('node_delete.yaml', 'Node (delete)', $this->node_tests_dir);

  // Expected messages.
  $this
    ->assertUniqueText(t('Article Test Article2 has been deleted.'));

  // The node should not exist at this point.
  $node_count = db_select('node', 'n')
    ->fields('n', array(
    'nid',
  ))
    ->condition('type', 'article')
    ->condition('title', 'Test Article2')
    ->countQuery()
    ->execute()
    ->fetchField();
  $this
    ->assertIdentical($node_count, '0', t('The node should not exist at this point.'));
}