You are here

private function PatternsBlockTestCase::testDelete in Patterns 7

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

File

tests/block/block.test, line 89
SimpleTests for the Block component of Patterns.

Class

PatternsBlockTestCase
@file SimpleTests for the Block component of Patterns.

Code

private function testDelete() {

  // Run the pattern.
  parent::runFile('block_delete.yaml', 'Blocks (custom) delete', $this->block_tests_dir);

  // Expected messages.
  $this
    ->assertUniqueText(t('The block Test custom block2 has been removed.'));

  // The block should not exist at this point.
  $block_count = db_select('block', 'b')
    ->fields('b', array(
    'bid',
  ))
    ->condition('module', 'block')
    ->condition('title', 'Test title')
    ->countQuery()
    ->execute()
    ->fetchField();
  $this
    ->assertIdentical($block_count, '0', t('The custom block should not exist at this point.'));
}