Pinq\Tests\Integration\Collection\CollectionTest::assertThatExecutionIsNotDeferred PHP Метод

assertThatExecutionIsNotDeferred() закрытый защищенный Метод

final protected assertThatExecutionIsNotDeferred ( callable $collectionOperation )
$collectionOperation callable
    protected final function assertThatExecutionIsNotDeferred(callable $collectionOperation)
    {
        $exception = new CustomException();
        $thowingFunction = function () use($exception) {
            throw $exception;
        };
        $thrown = false;
        try {
            $collectionOperation($thowingFunction);
        } catch (CustomException $thrownException) {
            $thrown = true;
            $this->assertSame($exception, $thrownException);
        }
        $this->assertTrue($thrown, 'Should have thrown an exeption');
    }