Пример #1
0
 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);
 }
Пример #2
0
 /**
  * {@inheritDoc}
  */
 public function persist(WorkerInterface $worker)
 {
     $this->adapter->save($worker);
     $this->eventDispatcher->dispatch(ResqueWorkerEvents::PERSISTED, new WorkerEvent($worker));
     return $this;
 }