Skip to content

Commit

Permalink
Unit Tests: allow for sniffs in other categories
Browse files Browse the repository at this point in the history
The `PHP` category was hard-coded in the unit test `getSniffCode()` function logic. As per 601, more categories are going to be used, this needed to change.
  • Loading branch information
jrfnl committed Apr 1, 2018
1 parent 129afa0 commit 892a1b2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions PHPCompatibility/Tests/BaseSniffTest.php
Expand Up @@ -112,11 +112,12 @@ public static function tearDownAfterClass()
*/
protected function getSniffCode()
{
$class = get_class($this);
$parts = explode('\\', $class);
$sniff = array_pop($parts);
$sniff = str_replace('SniffTest', '', $sniff);
return self::STANDARD_NAME . '.PHP.' . $sniff;
$class = get_class($this);
$parts = explode('\\', $class);
$sniff = array_pop($parts);
$sniff = str_replace('SniffTest', '', $sniff);
$category = array_pop($parts);
return self::STANDARD_NAME . '.' . $category . '.' . $sniff;
}

/**
Expand Down

0 comments on commit 892a1b2

Please sign in to comment.