| 1 |
<?php |
<?php |
| 2 |
// $Id: coder_review_7x.test,v 1.38 2009/10/18 22:11:03 snpower Exp $ |
// $Id: coder_review_7x.test,v 1.39 2009/10/18 23:05:45 snpower Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 122 |
$this->assertCoderReviewPass(" function drupal_set_time_limit () {\n set_time_limit(100);\n}"); |
$this->assertCoderReviewPass(" function drupal_set_time_limit () {\n set_time_limit(100);\n}"); |
| 123 |
$this->assertCoderReviewPass(" function foo () {\n drupal_set_time_limit(100);\n}"); |
$this->assertCoderReviewPass(" function foo () {\n drupal_set_time_limit(100);\n}"); |
| 124 |
|
|
| 125 |
|
// http://drupal.org/node/224333#archive-tar |
| 126 |
|
// http://drupal.org/node/224333#search-api |
| 127 |
|
// http://drupal.org/node/224333#user-1 |
| 128 |
|
|
| 129 |
} |
} |
| 130 |
|
|
| 131 |
function testPermissions7x() { |
function testPermissions7x() { |
| 162 |
// http://drupal.org/node/224333#hook_node_access |
// http://drupal.org/node/224333#hook_node_access |
| 163 |
$this->assertCoderReviewFail(" function mymodule_access() {\n}"); |
$this->assertCoderReviewFail(" function mymodule_access() {\n}"); |
| 164 |
$this->assertCoderReviewPass(" function mymodule_node_access() {\n}"); |
$this->assertCoderReviewPass(" function mymodule_node_access() {\n}"); |
| 165 |
|
|
| 166 |
|
// http://drupal.org/node/224333#user-roles-api |
| 167 |
} |
} |
| 168 |
|
|
| 169 |
function testDatabase7x() { |
function testDatabase7x() { |
| 209 |
} |
} |
| 210 |
|
|
| 211 |
function testBlock7x() { |
function testBlock7x() { |
| 212 |
|
// TEST MODULE - http://drupal.org/node/224333#block_optional |
| 213 |
|
// N/A - http://drupal.org/node/224333#hook_block_info_alter |
| 214 |
|
|
| 215 |
// http://drupal.org/node/224333#remove_op |
// http://drupal.org/node/224333#remove_op |
| 216 |
$this->assertCoderReviewFail(" function mymodule_block(\$op, \$delta, \$edit) {\n}"); |
$this->assertCoderReviewFail(" function mymodule_block(\$op, \$delta, \$edit) {\n}"); |
| 217 |
$this->assertCoderReviewFail(" function mymodule_block(\$delta, \$edit) {\n if (\$op == 'list') {\n }\n}"); |
$this->assertCoderReviewFail(" function mymodule_block(\$delta, \$edit) {\n if (\$op == 'list') {\n }\n}"); |
| 218 |
$this->assertCoderReviewFail(" function mymodule_block(\$delta, \$edit) {\n switch (\$op) {\n case 'list':\n }\n}"); |
$this->assertCoderReviewFail(" function mymodule_block(\$delta, \$edit) {\n switch (\$op) {\n case 'list':\n }\n}"); |
| 219 |
|
|
|
// http://drupal.org/node/224333#hook_block_list_alter |
|
|
$this->assertCoderReviewPass(' mymodule_block_list_alter(&$blocks)'); |
|
| 220 |
} |
} |
| 221 |
|
|
| 222 |
function testComments7x() { |
function testComments7x() { |
| 223 |
// N/A - http://drupal.org/node/224333#comment_load_multiple |
// N/A - http://drupal.org/node/224333#comment_load_multiple |
| 224 |
// N/A - http://drupal.org/node/224333#comment_save_refactor |
// N/A - http://drupal.org/node/224333#comment_save_refactor |
| 225 |
|
// N/A - http://drupal.org/node/224333#comment_presave_hook |
| 226 |
|
|
| 227 |
// http://drupal.org/node/224333#comment_load |
// http://drupal.org/node/224333#comment_load |
| 228 |
$this->assertCoderReviewFail(' $comment = _comment_load($cid);'); |
$this->assertCoderReviewFail(' $comment = _comment_load($cid);'); |
| 292 |
$this->assertCoderReviewFail(' $url = url("admin/settings/filters/add");'); |
$this->assertCoderReviewFail(' $url = url("admin/settings/filters/add");'); |
| 293 |
$this->assertCoderReviewPass(' $url = url("admin/settings/filter");'); |
$this->assertCoderReviewPass(' $url = url("admin/settings/filter");'); |
| 294 |
$this->assertCoderReviewPass(' $url = url("admin/settings/filter/add");'); |
$this->assertCoderReviewPass(' $url = url("admin/settings/filter/add");'); |
| 295 |
|
|
| 296 |
|
// http://drupal.org/node/224333#default-text-formats |
| 297 |
|
// http://drupal.org/node/224333#text-format-permissions |
| 298 |
|
// http://drupal.org/node/224333#filter-formats-parameters |
| 299 |
} |
} |
| 300 |
|
|
| 301 |
function testTaxonomy7x() { |
function testTaxonomy7x() { |
| 343 |
|
|
| 344 |
// http://drupal.org/node/224333#related_terms |
// http://drupal.org/node/224333#related_terms |
| 345 |
$this->assertCoderReviewFail(' $related = taxonomy_get_related($tid);'); |
$this->assertCoderReviewFail(' $related = taxonomy_get_related($tid);'); |
| 346 |
|
|
| 347 |
|
// http://drupal.org/node/224333#taxonomy-node |
| 348 |
} |
} |
| 349 |
|
|
| 350 |
function testJavascript7x() { |
function testJavascript7x() { |
| 378 |
$this->assertCoderReviewFail(' drupal_add_html_head(\'<script src="http://example.com/foo.js">\');'); |
$this->assertCoderReviewFail(' drupal_add_html_head(\'<script src="http://example.com/foo.js">\');'); |
| 379 |
$this->assertCoderReviewFail(' drupal_add_html_head(\'<script src="/files/foo.js">\');'); |
$this->assertCoderReviewFail(' drupal_add_html_head(\'<script src="/files/foo.js">\');'); |
| 380 |
$this->assertCoderReviewFail(' drupal_add_html_head(\'<script src="http://example123-ab_c.com.js">\');'); |
$this->assertCoderReviewFail(' drupal_add_html_head(\'<script src="http://example123-ab_c.com.js">\');'); |
| 381 |
|
|
| 382 |
|
// http://drupal.org/node/224333#jquery_once |
| 383 |
|
// http://drupal.org/node/224333#rename-drupal-to-js |
| 384 |
} |
} |
| 385 |
|
|
| 386 |
function testCss7x() { |
function testCss7x() { |
| 388 |
// N/A - http://drupal.org/node/224333#drupal_add_css_inline |
// N/A - http://drupal.org/node/224333#drupal_add_css_inline |
| 389 |
// N/A - http://drupal.org/node/224333#drupal_add_library |
// N/A - http://drupal.org/node/224333#drupal_add_library |
| 390 |
// N/A - http://drupal.org/node/224333#drupal_add_js_css_reset |
// N/A - http://drupal.org/node/224333#drupal_add_js_css_reset |
| 391 |
|
// N/A - http://drupal.org/node/224333#add-css-external |
| 392 |
|
|
| 393 |
// http://drupal.org/node/224333#drupal_add_js_options |
// http://drupal.org/node/224333#drupal_add_js_options |
| 394 |
$this->assertCoderReviewPass(" drupal_add_css(\$data, 'module');"); |
$this->assertCoderReviewPass(" drupal_add_css(\$data, 'module');"); |
| 395 |
$this->assertCoderReviewFail(" drupal_add_css(\$data, 'module', 'all');"); |
$this->assertCoderReviewFail(" drupal_add_css(\$data, 'module', 'all');"); |
| 396 |
$this->assertCoderReviewFail(" drupal_add_css(\$data, 'module', \$media);"); |
$this->assertCoderReviewFail(" drupal_add_css(\$data, 'module', \$media);"); |
| 397 |
|
|
| 398 |
|
// http://drupal.org/node/224333#drupal_add_css_weight |
| 399 |
|
// http://drupal.org/node/224333#class_attribute_array |
| 400 |
} |
} |
| 401 |
|
|
| 402 |
function testTheming7x() { |
function testTheming7x() { |
| 416 |
|
|
| 417 |
// http://drupal.org/node/224333#element_theme_properties |
// http://drupal.org/node/224333#element_theme_properties |
| 418 |
// http://drupal.org/node/224333#drupal_render_children |
// http://drupal.org/node/224333#drupal_render_children |
| 419 |
|
// http://drupal.org/node/224333#theme-links-param |
| 420 |
|
// http://drupal.org/node/224333#theme_changes |
| 421 |
} |
} |
| 422 |
|
|
| 423 |
function testForm7x() { |
function testForm7x() { |
| 627 |
$this->assertCoderReviewPass(' actions_synchronize($delete_orphans);'); |
$this->assertCoderReviewPass(' actions_synchronize($delete_orphans);'); |
| 628 |
|
|
| 629 |
// http://drupal.org/node/224333#distauth |
// http://drupal.org/node/224333#distauth |
| 630 |
|
// http://drupal.org/node/224333#trigger_overhaul |
| 631 |
|
// http://drupal.org/node/224333#hook_entity_load |
| 632 |
} |
} |
| 633 |
} |
} |