OptionTest::testOrElseWithLazyOptions()


Source

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

    public function testOrElseWithLazyOptions()
    {
        $throws = function() { throw new \LogicException('Should never be called.'); };

        $a = new \PhpOption\Some('a');
        $b = new \PhpOption\LazyOption($throws);

        $this->assertEquals('a', $a->orElse($b)->get());
    }