Example #1
0
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $config = $serviceLocator->get('config');
     $target = new TargetInvokable();
     $target->setConfigFile($config['zsapi']['file']);
     return $target;
 }
 public function setUp()
 {
     $this->setApplicationConfig(include __DIR__ . '/../../config/application.config.php');
     parent::setUp();
     $this->tempFile = tempnam(sys_get_temp_dir(), 'phpunit');
     $targetService = new TargetInvokable();
     $targetService->setConfigFile($this->tempFile);
     $testData = array('delme' => array('zsurl' => 'http://del.me', 'zssecret' => 'Secret', 'zskey' => 'Name', 'zsversion' => '1.1'), 'listme' => array('zsurl' => 'http://list.me', 'zssecret' => 'Secret', 'zskey' => 'Name', 'zsversion' => '1.1'), 'updateme' => array('zsurl' => 'http://update.me', 'zssecret' => 'Secret', 'zskey' => 'Name', 'zsversion' => '1.1', 'http' => array('sslverify' => '1', 'timeout' => '20')));
     $targetService->save($testData);
     $this->targetService = $targetService;
     $serviceManager = $this->getApplication()->getServiceManager();
     $targetController = $serviceManager->get('controllerloader')->get('webapi-target-controller');
     $targetController->setTargetService($targetService);
 }