LazyOptionTest::testForAll()


Source

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

    public function testForAll()
    {
        $called = false;
        $self = $this;
        $this->assertInstanceOf('PhpOption\Some', LazyOption::fromValue('foo')->forAll(function($v) use (&$called, $self) {
            $called = true;
            $self->assertEquals('foo', $v);
        }));
        $this->assertTrue($called);
    }