private function PatternsContentTypeTestCase::testCreate in Patterns 7        
                          
                  
                        Same name and namespace in other branches
- 7.2 tests/node/content.test \PatternsContentTypeTestCase::testCreate()
1 call to PatternsContentTypeTestCase::testCreate()
  - PatternsContentTypeTestCase::testCreateModifyDelete in tests/node/content.test
File
 
   - tests/node/content.test, line 37
- SimpleTests for the Node component of Patterns (Content Types).
Class
  
  - PatternsContentTypeTestCase 
- @file
SimpleTests for the Node component of Patterns (Content Types).
Code
private function testCreate() {
  
  $node_type_count = db_select('node_type', 'n')
    ->fields('n', array(
    'type',
  ))
    ->condition('type', 'test_content_type')
    ->countQuery()
    ->execute()
    ->fetchField();
  $this
    ->assertIdentical($node_type_count, '0', t('The content type should not exist at this point.'));
  
  parent::runFile('content.yaml', 'Content Type (create)', $this->node_tests_dir);
  
  $this
    ->assertUniqueText(t('The content type Test Content Type has been added.'));
  
  $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 Type');
  $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 Description');
  $this
    ->assertIdentical($node_type[0]->help, 'help text');
  
  $this
    ->assertIdentical($node_type[0]->has_title, '1');
  
}