public function setUp()
 {
     $this->setApplicationConfig(
         include __DIR__ . '/../../_files/application.config.php'
     );
     parent::setUp();
 }
コード例 #2
0
 /**
  * Dispatch the MVC with a URL
  * Accept a HTTP (simulate a customer action) or console route.
  *
  * The URL provided set the request URI in the request object.
  *
  * @param string      $url
  * @param string|null $method
  * @param array|null  $params
  *
  * @throws Exception
  */
 public function dispatch($url, $method = null, $params = [], $isXmlHttpRequest = false)
 {
     ob_start();
     parent::dispatch($url, $method, $params, $isXmlHttpRequest);
     $this->content = ob_get_contents();
     ob_end_clean();
 }
コード例 #3
0
 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);
 }
コード例 #4
0
 public function setUp()
 {
     $this->setApplicationConfig(include __DIR__ . '/application.config.php');
     parent::setUp();
     $serviceManager = $this->getApplication()->getServiceManager();
     $objectManager = $serviceManager->get('doctrine.entitymanager.orm_default');
     $tool = new SchemaTool($objectManager);
     $res = $tool->createSchema($objectManager->getMetadataFactory()->getAllMetadata());
     $artist1 = new Entity\Artist();
     $artist1->setName('ABBA');
     $artist1->setCreatedAt(new DateTime('2011-12-18 13:17:17'));
     $objectManager->persist($artist1);
     $objectManager->flush();
 }
コード例 #5
0
 public function setUp()
 {
     $this->setApplicationConfig(include __DIR__ . '/../../config/application.config.php');
     parent::setUp();
     // Fake the config and the routing
     $serviceManager = $this->getApplication()->getServiceManager();
     $data = array('name' => 'testArgs', 'options' => array('route' => "testArgs [--singleParam=] [--arrayParam=] ", 'defaults' => array('controller' => 'test', 'action' => 'Args'), 'arrays' => array('arrayParam')));
     $config = $serviceManager->get('config');
     $config['console']['router']['routes'][$data['name']] = $data;
     $serviceManager->setAllowOverride(true);
     $serviceManager->setService('config', $config);
     $serviceManager->setAllowOverride(false);
     $testRoute = SimpleRouter::factory($data['options']);
     $router = $serviceManager->get('router');
     $router->addRoute($data['name'], $testRoute, 99999);
     $eventManager = $this->getApplication()->getEventManager();
     $eventManager->attach(MvcEvent::EVENT_ROUTE, array($this, 'postRoute'), -3);
 }
コード例 #6
0
 public function setUp()
 {
     parent::setUp();
     $this->setTraceError(true);
     $this->setApplicationConfig(\Library\Application::getService('ApplicationConfig'));
 }
コード例 #7
0
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $this->setApplicationConfig(include __DIR__ . '/../../TestConfiguration.php.dist');
     parent::setUp();
 }
コード例 #8
0
ファイル: DumpControllerTest.php プロジェクト: naxel/zfctool
 public function tearDown()
 {
     !$this->verbose && ob_end_clean();
     parent::tearDown();
 }
コード例 #9
0
 public function setUp()
 {
     parent::setUp();
     $this->setTraceError(true);
     $this->setApplicationConfig(\Library\Application::getApplicationConfig('Export', true));
 }
コード例 #10
0
 public function setUp()
 {
     parent::setUp();
     $this->setTraceError(true);
     $this->setApplicationConfig(\Library\Application::getApplicationConfig('DatabaseManager', true));
 }
コード例 #11
0
 public function setUp()
 {
     parent::setUp();
     $this->setTraceError(true);
     $this->setApplicationConfig(\Library\Application::getApplicationConfig('DecodeInventory', true));
 }
コード例 #12
0
 public function setUp()
 {
     parent::setUp();
     $this->setTraceError(true);
     $this->setApplicationConfig(\Library\Application::getApplicationConfig('PackageBuilder', true));
 }
コード例 #13
0
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $this->setApplicationConfig(include __DIR__ . '/../../TestConfiguration.php.dist');
     parent::setUp();
     $this->getApplicationServiceLocator()->get('doctrine.cli')->add(new FailingCommand());
 }