current() public static method

public static current ( Nelmio\Alice\FixtureInterface $fixture ) : string
$fixture Nelmio\Alice\FixtureInterface
return string
Example #1
0
 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());
     }
 }