<?php
/**
 * @file
 * Test CPN's node integration.
 */

class CpnNodeTest extends CpnTestHelper {

  /**
   * {@inheritdoc}
   */
  public static function getInfo() {
    return array(
      'name' => 'CPN node tests',
      'description' => 'Test the CPN module.',
      'group' => 'CPN',
    );
  }

  /**
   * Verify the content type settings show up.
   */
  function testNodeSettings() {
    $permissions = array(
      'administer code per node',
      'administer content types',
      'access administration pages',
    );

    // Reset the static variable used to identify permissions, otherwise it's
    // possible the permissions check in drupalCreateUser will fail.
    $this->checkPermissions(array(), TRUE);
    cache_clear_all();

    // Create an admin user with the above permissions.
    $this->adminUser = $this->drupalCreateUser($permissions);
    $this->drupalLogin($this->adminUser);

    // Load the Page content type settings.
    $this->drupalGet('admin/structure/types/manage/page');
    $this->assertResponse(200);
    $this->assertText(t('Code per Node settings'));
  }

}
