SensioLabs\DeprecationDetector\Tests\Violation\ViolationDetectorTest::testGetViolations PHP Метод

testGetViolations() публичный Метод

public testGetViolations ( )
    public function testGetViolations()
    {
        $violation = $this->prophesize('SensioLabs\\DeprecationDetector\\Violation\\Violation')->reveal();
        $filteredViolation = $this->prophesize('SensioLabs\\DeprecationDetector\\Violation\\Violation')->reveal();
        $expected = array($violation);
        $phpFileInfo = $this->prophesize('SensioLabs\\DeprecationDetector\\FileInfo\\PhpFileInfo')->reveal();
        $ruleSet = $this->prophesize('SensioLabs\\DeprecationDetector\\RuleSet\\RuleSet')->reveal();
        $violationChecker = $this->prophesize('SensioLabs\\DeprecationDetector\\Violation\\ViolationChecker\\ViolationCheckerInterface');
        $violationChecker->check($phpFileInfo, $ruleSet)->willReturn(array($violation, $filteredViolation))->shouldBeCalled();
        $violationFilter = $this->prophesize('SensioLabs\\DeprecationDetector\\Violation\\ViolationFilter\\ViolationFilterInterface');
        $violationFilter->isViolationFiltered($violation)->willReturn(false)->shouldBeCalled();
        $violationFilter->isViolationFiltered($filteredViolation)->willReturn(true)->shouldBeCalled();
        $violationDetector = new ViolationDetector($violationChecker->reveal(), $violationFilter->reveal());
        $this->assertEquals($expected, $violationDetector->getViolations($ruleSet, array($phpFileInfo)));
    }