當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AbstractHttpControllerTestCase::setUp方法代碼示例

本文整理匯總了PHP中Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase::setUp方法的典型用法代碼示例。如果您正苦於以下問題:PHP AbstractHttpControllerTestCase::setUp方法的具體用法?PHP AbstractHttpControllerTestCase::setUp怎麽用?PHP AbstractHttpControllerTestCase::setUp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase的用法示例。


在下文中一共展示了AbstractHttpControllerTestCase::setUp方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 public function setUp()
 {
     $this->serviceLocator = null;
     $this->setApplicationConfig(Bootstrap::getConfig());
     parent::setUp();
     $this->prepareAuthenticateMock();
 }
開發者ID:omusico,項目名稱:zf2-demo,代碼行數:7,代碼來源:AbstractFunctionalControllerTestCase.php

示例2: setUp

 public function setUp()
 {
     $this->setApplicationConfig(include __DIR__ . '/../../../TestConfig.php.dist');
     parent::setUp();
     $services = $this->getApplicationServiceLocator();
     $this->resolver = $services->get('NetgluePrismic\\Mvc\\LinkResolver');
 }
開發者ID:netglue,項目名稱:zf2-prismic-module,代碼行數:7,代碼來源:ViewModelTest.php

示例3: setUp

 public function setUp()
 {
     $this->setApplicationConfig(include 'config/application.config.php');
     $category = new CategoryEntity();
     $this->category = $category;
     parent::setUp();
 }
開發者ID:AwoyoToyin,項目名稱:StockInventory,代碼行數:7,代碼來源:CategoryEntityTest.php

示例4: setUp

 public function setUp()
 {
     $this->setApplicationConfig(include __DIR__ . '/application.config.php');
     parent::setUp();
     $config = $this->getApplication()->getConfig();
     $config = $config['doctrine']['connection']['odm_default'];
     $connection = new \MongoClient('mongodb://' . $config['server'] . ':' . $config['port']);
     $db = $connection->{$config['dbname']};
     $collection = $db->meta;
     $collection->remove();
     $serviceManager = $this->getApplication()->getServiceManager();
     $objectManager = $serviceManager->get('doctrine.documentmanager.odm_default');
     $meta1 = new Document\Meta();
     $meta1->setName('MetaOne');
     $meta1->setCreatedAt(new DateTime('2011-12-18 13:17:17'));
     $objectManager->persist($meta1);
     $meta2 = new Document\Meta();
     $meta2->setName('MetaTwo');
     $meta2->setCreatedAt(new DateTime('2014-12-18 13:17:17'));
     $objectManager->persist($meta2);
     $meta3 = new Document\Meta();
     $meta3->setName('MetaThree');
     $meta3->setCreatedAt(new DateTime('2012-12-18 13:17:17'));
     $objectManager->persist($meta3);
     $meta4 = new Document\Meta();
     $meta4->setName('MetaFour');
     $meta4->setCreatedAt(new DateTime('2013-12-18 13:17:17'));
     $objectManager->persist($meta4);
     $meta5 = new Document\Meta();
     $meta5->setName('MetaFive');
     $objectManager->persist($meta5);
     $objectManager->flush();
 }
開發者ID:Kwido,項目名稱:zf-doctrine-querybuilder,代碼行數:33,代碼來源:ODMFilterTest.php

示例5: setUp

 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);
     $artist2 = new Entity\Artist();
     $artist2->setName('Band, The');
     $artist2->setCreatedAt(new DateTime('2014-12-18 13:17:17'));
     $objectManager->persist($artist2);
     $artist3 = new Entity\Artist();
     $artist3->setName('CubanStack');
     $artist3->setCreatedAt(new DateTime('2012-12-18 13:17:17'));
     $objectManager->persist($artist3);
     $artist4 = new Entity\Artist();
     $artist4->setName('Drunk in July');
     $artist4->setCreatedAt(new DateTime('2013-12-18 13:17:17'));
     $objectManager->persist($artist4);
     $artist5 = new Entity\Artist();
     $artist5->setName('Ekoostic Hookah');
     $objectManager->persist($artist5);
     $objectManager->flush();
 }
開發者ID:api-skeletons,項目名稱:zf-doctrine-orm-querybuilder,代碼行數:29,代碼來源:ORMOrderByTest.php

示例6: setUp

 public function setUp()
 {
     $this->serviceManager = Bootstrap::getServiceManager();
     $this->setApplicationConfig($this->serviceManager->get('ApplicationConfig'));
     $this->calc = new Stdlib\Calc();
     parent::setUp();
 }
開發者ID:veniva,項目名稱:zcms,代碼行數:7,代碼來源:CalcTest.php

示例7: setUp

 protected function setUp()
 {
     $this->setApplicationConfig(JSBootstrap::getConfig());
     parent::setUp();
     $this->setApplicationInstance($this->getApplication());
     JSDatabaseTest::createTables($this->getEntityManager());
 }
開發者ID:argentinaluiz,項目名稱:js_zf2_library,代碼行數:7,代碼來源:JSTestControllerCase.php

示例8: setUp

 protected function setUp()
 {
     $this->factory = new OAuth2ServerFactory();
     $this->services = $services = new ServiceManager();
     $this->setApplicationConfig(['modules' => ['ZF\\OAuth2'], 'module_listener_options' => ['module_paths' => [__DIR__ . '/../../'], 'config_glob_paths' => []], 'service_listener_options' => [], 'service_manager' => []]);
     parent::setUp();
 }
開發者ID:gstearmit,項目名稱:EshopVegeTable,代碼行數:7,代碼來源:OAuth2ServerFactoryTest.php

示例9: setUp

 /**
  * setup
  */
 public function setUp()
 {
     ////AutoloaderFactory::factory(array('Zend\Loader\ClassMapAutoloader'=>array(array('ImportControllerTest' => __FILE__ ))));
     //$config = include '../config/config.php';
     ////$config['listeners'][] = 'testCaseListener';
     ////$config['service_manager']['instances']['testCaseListener'] = 'ImportControllerTest';
     ////$config['service_manager']['services']['Auth/CheckPermissionsListener'] = 'White Bunny';
     //$this->setApplicationConfig(
     //     $config
     //);
     parent::setUp();
     //$sm = new ServiceManager();
     //$checkPermissionsListener = $this->getMock('Zend\EventManager\ListenerAggregateInterface');
     //$sm->setService('Auth/CheckPermissionsListener', $checkPermissionsListener);
     /*
     $f = new Factory();
     $sm = new ServiceManager();
     $auth = $this->getMock('\Zend\Authentication\AuthenticationService');
     $sm->setService('AuthenticationService', $auth);
     
     $hm = new HelperPluginManager();
     $hm->setServicelocator($sm);
     
     
     $helper = $f->createService($hm);
     
     $this->assertInstanceOf('\Auth\View\Helper\Auth', $helper);
     $this->assertSame($auth, $helper->getService());
     */
 }
開發者ID:vfulco,項目名稱:YAWIK,代碼行數:33,代碼來源:ImportControllerTest.php

示例10: setUp

 public function setUp()
 {
     parent::setUp();
     $this->setApplicationConfig(include __DIR__ . '/../../../../../config/application.config.php');
     $this->serviceManager = $this->getApplication()->getServiceManager();
     $this->url = '/user';
 }
開發者ID:jhonmike,項目名稱:php-play,代碼行數:7,代碼來源:UserControllerTest.php

示例11: setUp

 /**
  * Set up
  */
 public function setUp()
 {
     $this->setApplicationConfig(include 'config/application.config.php');
     $this->setTraceError(true);
     parent::setUp();
     $this->blueimpService = $this->getApplicationServiceLocator()->get('Media\\Service\\Blueimp');
 }
開發者ID:zfury,項目名稱:cmf,代碼行數:10,代碼來源:BlueimpTest.php

示例12: setUp

 public function setUp()
 {
     $this->setApplicationConfig(include 'config/application.config.php');
     $product = new ProductEntity();
     $this->product = $product;
     parent::setUp();
 }
開發者ID:AwoyoToyin,項目名稱:StockInventory,代碼行數:7,代碼來源:ProductEntityTest.php

示例13: setUp

 public function setUp()
 {
     $this->setApplicationConfig(
         include __DIR__ . '/../../_files/application.config.php'
     );
     parent::setUp();
 }
開發者ID:benivaldo,項目名稱:zf2-na-pratica,代碼行數:7,代碼來源:AbstractHttpControllerTestCaseTest.php

示例14: setUp

 public function setUp()
 {
     // getcwd() reports the tests execute from the BBCTest directory:
     $configFile = realpath('config/application.config.php');
     $this->setApplicationConfig(include $configFile);
     parent::setUp();
 }
開發者ID:sentient06,項目名稱:BBCTest,代碼行數:7,代碼來源:ApplicationControllerTest.php

示例15: setUp

 public function setUp()
 {
     $this->setApplicationConfig(include __DIR__ . '/../../TestConfig.php.dist');
     parent::setUp();
     $json = json_decode(file_get_contents(__DIR__ . '/../../fixtures/document.json'));
     $this->document = \Prismic\Document::parse($json);
 }
開發者ID:netglue,項目名稱:zf2-prismic-module,代碼行數:7,代碼來源:LinkGeneratorTest.php


注:本文中的Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase::setUp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。