You are here

private function PatternsContentTypeTestCase::testModify in Patterns 7.2

Same name and namespace in other branches
  1. 7 tests/node/content.test \PatternsContentTypeTestCase::testModify()
1 call to PatternsContentTypeTestCase::testModify()
PatternsContentTypeTestCase::testCreateModifyDelete in tests/node/content.test

File

tests/node/content.test, line 82
SimpleTests for the Node component of Patterns (Content Types).

Class

PatternsContentTypeTestCase
@file SimpleTests for the Node component of Patterns (Content Types).

Code

private function testModify() {

  // Run the pattern.
  parent::runFile('content_modify.yaml', 'Content Type (modify)', $this->node_tests_dir);

  // Expected messages.
  $this
    ->assertUniqueText(t('The content type Test Content Type2 has been updated.'));

  // The content type should exist with the right values.
  $node_type = db_select('node_type', 'n')
    ->fields('n')
    ->condition('type', 'test_content_type')
    ->execute()
    ->fetchAll();
  $this
    ->assertIdentical(count($node_type), 1);
  $this
    ->assertIdentical($node_type[0]->name, 'Test Content Type2');
  $this
    ->assertIdentical($node_type[0]->base, 'node_content');
  $this
    ->assertIdentical($node_type[0]->module, 'node');
  $this
    ->assertIdentical($node_type[0]->description, 'Test Content Type Long Description2');
  $this
    ->assertIdentical($node_type[0]->help, 'help text2');

  // TODO
  $this
    ->assertIdentical($node_type[0]->has_title, '1');

  // TODO
  // TODO: more fields
}