malkusch\lock\mutex\MutexTest::testSynchronizedDelegates PHP Метод

testSynchronizedDelegates() публичный Метод

Tests synchronized() executes the code and returns its result.
public testSynchronizedDelegates ( callable $mutexFactory )
$mutexFactory callable The Mutex factory.
    public function testSynchronizedDelegates(callable $mutexFactory)
    {
        $mutex = call_user_func($mutexFactory);
        $result = $mutex->synchronized(function () {
            return "test";
        });
        $this->assertEquals("test", $result);
    }