function CoderReviewStyleTest::testStyleCamelCase in Coder 7.2
Same name and namespace in other branches
- 7 coder_review/tests/coder_review_style.test \CoderReviewStyleTest::testStyleCamelCase()
Tests for the correct use of camelCase text.
File
- coder_review/
tests/ coder_review_style.test, line 56
Class
- CoderReviewStyleTest
- Class to test for the style of the required Drupal coding standards.
Code
function testStyleCamelCase() {
$this
->assertCoderReviewPass(' $var = new stdClass();');
$this
->assertCoderReviewPass(' $var = $obj->camelCase();');
$this
->assertCoderReviewFail(' $camelCase = "1";');
$this
->assertCoderReviewFail(' function camelCase() {');
$this
->assertCoderReviewFail(" class myClass {\nfunction camelCase() {");
$this
->assertCoderReviewFail(" interface myClass {\nfunction camelCase() {");
$this
->assertCoderReviewPass(" class MyClass {\nfunction camelCase() {");
$this
->assertCoderReviewPass(" interface MyClass {\nfunction camelCase() {");
$this
->assertCoderReviewPass(' ?>This is embedded php and should Not trigger a camelCase error.<?php');
$this
->assertCoderReviewPass(" ?>This second embedded php and should Not trigger\na camelCase error.<?php");
$this
->assertCoderReviewPass(' $var = 0xFF;');
}