function it_returns_null_on_finding_unregistered_workers(WorkerRegistryAdapterInterface $adapter, WorkerFactoryInterface $workerFactory, WorkerInterface $worker) { $workerFactory->createWorkerFromId('compy:55:foo')->shouldBeCalled()->willReturn($worker); $adapter->has($worker)->shouldBeCalled()->willReturn(false); $this->findWorkerById('compy:55:foo')->shouldReturn(null); }
/** * {@inheritDoc} */ public function persist(WorkerInterface $worker) { $this->adapter->save($worker); $this->eventDispatcher->dispatch(ResqueWorkerEvents::PERSISTED, new WorkerEvent($worker)); return $this; }