LazyOptionTest::testGetWithArgumentsAndCreate()
Source
File: vendor/phpoption/phpoption/tests/PhpOption/Tests/LazyOptionTest.php
public function testGetWithArgumentsAndCreate()
{
$some = new \PhpOption\LazyOption(array($this->subject, 'execute'), array('foo'));
$this->subject
->expects($this->once())
->method('execute')
->with('foo')
->will($this->returnValue(\PhpOption\Some::create('foo')));
$this->assertEquals('foo', $some->get());
$this->assertEquals('foo', $some->getOrElse(null));
$this->assertEquals('foo', $some->getOrCall('does_not_exist'));
$this->assertEquals('foo', $some->getOrThrow(new \RuntimeException('does_not_exist')));
$this->assertFalse($some->isEmpty());
}