Skip to content

Commit

Permalink
Enhance phpunit
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Apr 1, 2019
1 parent 0091b65 commit 6e161a9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/phpunit/CodingPhpTest.php
Expand Up @@ -236,7 +236,20 @@ public function testPHP()
break;
}
}
$this->assertTrue($ok, 'Found a tag <br /> that is for xml in file '.$file['fullname'].' You may use <br> instead.');
$this->assertTrue($ok, 'Found a tag <br /> that is for xml in file '.$file['fullname'].'. You may use html syntax <br> instead.');


// Test we don't have @var array(
$ok=true;
$matches=array();
// Check string ='".$this->xxx with xxx that is not 'escape'. It means we forget a db->escape when forging sql request.
preg_match_all('/@var\s+array\(/', $filecontent, $matches, PREG_SET_ORDER);
foreach($matches as $key => $val)
{
$ok=false;
break;
}
$this->assertTrue($ok, 'Found a declaration @var array() instead of @var array in file '.$file['fullname'].'.');
}

return;
Expand Down

0 comments on commit 6e161a9

Please sign in to comment.