Nelmio\Alice\Faker\Provider\AliceProviderTest::testCurrentThrowsAnExceptionIfFixtureHasNoCurrentValue PHP Method

testCurrentThrowsAnExceptionIfFixtureHasNoCurrentValue() public method

    public function testCurrentThrowsAnExceptionIfFixtureHasNoCurrentValue()
    {
        $fixture = new SimpleFixture('dummy', 'Dummy', SpecificationBagFactory::create());
        try {
            AliceProvider::current($fixture);
            $this->fail('Expected exception to be thrown.');
        } catch (NoValueForCurrentException $exception) {
            $this->assertEquals('No value for \'<current()>\' found for the fixture "dummy".', $exception->getMessage());
            $this->assertEquals(0, $exception->getCode());
            $this->assertNull($exception->getPrevious());
        }
    }