LazyOptionTest::testExceptionIsThrownIfCallbackReturnsNonOption()


Source

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

    public function testExceptionIsThrownIfCallbackReturnsNonOption()
    {
        $option = \PhpOption\LazyOption::create(array($this->subject, 'execute'));

        $this->subject
            ->expects($this->once())
            ->method('execute')
            ->will($this->returnValue(null));

        $this->assertFalse($option->isDefined());
    }