SensioLabs\DeprecationDetector\Tests\RuleSet\Loader\Composer\ComposerLoaderTest::testLoadRuleSetThrowsCouldNotLoadRuleSetException PHP Метод

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

    public function testLoadRuleSetThrowsCouldNotLoadRuleSetException()
    {
        $path = 'path/to/not/existing/composer.lock';
        $traverser = $this->prophesize('SensioLabs\\DeprecationDetector\\RuleSet\\DirectoryTraverser')->reveal();
        $cache = $this->prophesize('SensioLabs\\DeprecationDetector\\RuleSet\\Cache')->reveal();
        $factory = $this->prophesize('SensioLabs\\DeprecationDetector\\RuleSet\\Loader\\Composer\\ComposerFactory');
        $factory->fromLock($path)->willThrow(new ComposerFileDoesNotExistsException($path));
        $this->setExpectedException('SensioLabs\\DeprecationDetector\\RuleSet\\Loader\\CouldNotLoadRuleSetException', 'composer.lock file "path/to/not/existing/composer.lock" does not exist.');
        $loader = new ComposerLoader($traverser, $cache, $factory->reveal());
        $loader->loadRuleSet('path/to/not/existing/composer.lock');
    }