You are here

class CoderReviewSnifferTest in Coder 7.2

Class to test for the coder sniffer rules.

Hierarchy

Expanded class hierarchy of CoderReviewSnifferTest

File

coder_review/tests/coder_review_sniffer.test, line 13

View source
class CoderReviewSnifferTest extends CoderReviewTestCase {

  /**
   * Constructor that creates a CoderReviewSnifferTest instance.
   *
   * @param string|null $id
   *   (optional) The test identifier. Defaults to NULL.
   */
  function __construct($id = NULL) {

    // Remove the Drupal autoloading classes so that CodeSniffer can load it's
    // own classes. Without this, these tests would need to run with
    // DrupalWebTestCase instead of DrupalUnitTestCase.
    spl_autoload_unregister('drupal_autoload_class');
    spl_autoload_unregister('drupal_autoload_interface');
    parent::__construct('sniffer', $id);
  }
  public static function getInfo() {
    return array(
      'name' => 'Coder Review Sniffer Tests',
      'description' => 'Tests for the coder sniffer review.',
      'group' => 'CoderReview',
    );
  }

  /**
   * Tests sample case.
   */
  function testDocblockLineTooLong() {
    $this
      ->assertCoderReviewFail("/**\n * 456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\n **/");
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CoderReviewSnifferTest::getInfo public static function
CoderReviewSnifferTest::testDocblockLineTooLong function Tests sample case.
CoderReviewSnifferTest::__construct function Constructor that creates a CoderReviewSnifferTest instance.