| Total Complexity | 3 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | abstract class AbstractRule extends TestCase |
||
| 18 | { |
||
| 19 | /** @var RuleInterface */ |
||
| 20 | protected $rule; |
||
| 21 | |||
| 22 | protected function setUp() |
||
| 23 | { |
||
| 24 | parent::setUp(); |
||
| 25 | |||
| 26 | $this->rule = $this->getRule(); |
||
| 27 | $ruleApplier = new RuleApplier(new NullLogger(), []); |
||
| 28 | |||
| 29 | $this->rule->setApplier($ruleApplier); |
||
| 30 | } |
||
| 31 | |||
| 32 | protected function assertRuleResults($lineData, $transformedData, $options, $expected) |
||
| 33 | { |
||
| 34 | $this->rule->validate($options); |
||
| 35 | $this->assertEquals($expected, $this->rule->apply($lineData, $transformedData, $options)); |
||
| 36 | } |
||
| 37 | |||
| 38 | public function testRuleCode() |
||
| 39 | { |
||
| 40 | $this->assertNotEmpty($this->rule->getRuleCode()); |
||
| 41 | } |
||
| 42 | |||
| 43 | abstract protected function getRule(); |
||
| 44 | } |
||
| 45 |