Nelmio\Alice\Generator\GenerationContextTest::testCannotRetrieveAnInexistingValueFromCache PHP Method

testCannotRetrieveAnInexistingValueFromCache() public method

    public function testCannotRetrieveAnInexistingValueFromCache()
    {
        $context = new GenerationContext();
        try {
            $context->getCachedValue('foo');
            $this->fail('Expected exception to be thrown.');
        } catch (CachedValueNotFound $exception) {
            $this->assertEquals('No value with the key "foo" was found in the cache.', $exception->getMessage());
            $this->assertEquals(0, $exception->getCode());
            $this->assertNull($exception->getPrevious());
        }
    }