/** * @testdox JQManagedJob::resolveWaitAsyncJob() wraps the $job->resolveWaitAsyncJob() in a mutex to prevent concurrency errors */ function testResolveAsyncJobUsesMutex() { // create a queuestore $q = new JQStore_Array(); $mJob = $q->enqueue(new SampleAsyncJob($this)); $mJob->markJobStarted(); $mJob->run($mJob); $this->assertEquals(JQManagedJob::STATUS_WAIT_ASYNC, $mJob->getStatus()); $q->getWithMutex($mJob->getJobId()); $this->setExpectedException('JQStore_JobIsLockedException'); JQManagedJob::resolveWaitAsyncJob($q, $mJob->getJobId(), array()); }