/** * Create a queue * * @param ServiceLocatorInterface $services * @param string $name * @param string $requestedName * @return Queue */ public function createServiceWithName(ServiceLocatorInterface $services, $name, $requestedName) { $config = $this->getConfig($services); $config = $config[$requestedName]; if (isset($config['adapter']) && is_string($config['adapter']) && $services->has($config['adapter'])) { $adapter = $services->get($config['adapter']); if ($adapter instanceof Adapter\AdapterInterface) { $config['adapter'] = $adapter; } } $queue = Queue::factory($config); return $queue; }
public function testFactoryInvalidOptions() { $config = ['adapter' => ['adapter' => 'array', 'options' => ['dummyOption' => 'dummyValue']], 'options' => ['messageClass' => ZendMessage::class]]; $this->setExpectedException(InvalidArgumentException::class); Queue::factory($config); }