Пример #1
0
 /**
  * Create the application.
  *
  * @return Application
  */
 public function createApplication()
 {
     $configurationLoader = $this->createConfigurationLoader();
     $extensionManager = $this->createExtensionManager();
     $eventDispatcher = $this->createEventDispatcher();
     $eventDispatcher->addSubscriber(new WorkingDirectoryListener($configurationLoader));
     $application = new Application(self::NAME, self::VERSION, $configurationLoader, $extensionManager);
     $application->addCommands($this->getDefaultCommands());
     $application->setDispatcher($eventDispatcher);
     return $application;
 }
Пример #2
0
 /**
  * @Given there is a openl10n server serving a :resource resource
  */
 public function thereIsAOpenl10nServerAtUri($resource)
 {
     $this->guzzleMockHandlerList[$resource] = new \GuzzleHttp\Handler\MockHandler();
     $handler = \GuzzleHttp\HandlerStack::create($this->guzzleMockHandlerList[$resource]);
     $this->guzzleTransactionHistory[$resource] = array();
     $handler->push(\GuzzleHttp\Middleware::history($this->guzzleTransactionHistory[$resource]));
     $client = new \GuzzleHttp\Client(['handler' => $handler]);
     $this->application->getContainer()->get('api')->getEntryPoint($resource)->setClient($client);
 }