Nelmio\Alice\Parser\RuntimeCacheParserTest::testThrowsAnExceptionIfFileCouldNotBeFound PHP Method

testThrowsAnExceptionIfFileCouldNotBeFound() public method

    public function testThrowsAnExceptionIfFileCouldNotBeFound()
    {
        $fileLocatorProphecy = $this->prophesize(FileLocatorInterface::class);
        $fileLocatorProphecy->locate(Argument::any())->willThrow(FileNotFoundException::class);
        /** @var FileLocatorInterface $fileLocator */
        $fileLocator = $fileLocatorProphecy->reveal();
        $parser = new RuntimeCacheParser(new FakeParser(), $fileLocator, new FakeIncludeProcessor());
        try {
            $parser->parse('/nowhere');
            $this->fail('Expected exception to be thrown.');
        } catch (\InvalidArgumentException $exception) {
            $this->assertEquals('The file "/nowhere" could not be found.', $exception->getMessage());
            $this->assertEquals(0, $exception->getCode());
            $this->assertNotNull($exception->getPrevious());
        }
    }