for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace whm\Smoke\Rules\Html;
use Psr\Http\Message\ResponseInterface;
use whm\Smoke\Rules\StandardRule;
/**
* This rule will analyze any html document and checks if a given string is contained.
*/
class RegExNotExistsRule extends StandardRule
{
private $regExs;
protected $contentTypes = array('text/html');
* @param int $string The string that the document must contain
$string
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
public function init(array $regExs)
$this->regExs = $regExs;
}
protected function doValidation(ResponseInterface $response)
foreach ($this->regExs as $regEx) {
$this->assert(preg_match('^' . $regEx . '^', (string)$response->getBody()) === 0,
'The given regular expression (' . $regEx . ') was found in this document.');
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.