SomeTest::testifDefined()


Source

File: vendor/phpoption/phpoption/tests/PhpOption/Tests/SomeTest.php

    public function testifDefined()
    {
        $called = false;
        $self = $this;
        $some = new Some('foo');
        $this->assertNull($some->ifDefined(function($v) use (&$called, $self) {
            $called = true;
            $self->assertEquals('foo', $v);
        }));
        $this->assertTrue($called);
    }