LazyOptionTest::testifDefined()
Source
File: vendor/phpoption/phpoption/tests/PhpOption/Tests/LazyOptionTest.php
public function testifDefined()
{
$called = false;
$self = $this;
$this->assertNull(LazyOption::fromValue('foo')->ifDefined(function($v) use (&$called, $self) {
$called = true;
$self->assertEquals('foo', $v);
}));
$this->assertTrue($called);
}