当前位置: 首页>>代码示例>>PHP>>正文


PHP Controller\AbstractHttpControllerTestCase类代码示例

本文整理汇总了PHP中Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase的典型用法代码示例。如果您正苦于以下问题:PHP AbstractHttpControllerTestCase类的具体用法?PHP AbstractHttpControllerTestCase怎么用?PHP AbstractHttpControllerTestCase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了AbstractHttpControllerTestCase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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

示例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 __DIR__ . '/../../../config/test/application.config.php');
     $oServiceManager = \ApplicationTest\Bootstrap::getServiceManager();
     $this->oEm = $oServiceManager->get('Doctrine\\ORM\\EntityManager');
     parent::setUp();
 }
开发者ID:Beanbiscuit,项目名称:examples,代码行数:10,代码来源:AppUserRepositoryTest.php

示例4: setUp

 /**
  * 
  */
 public function setUp()
 {
     $this->setApplicationConfig(include __DIR__ . '/../../../config/test/application.config.php');
     $oServiceManager = \ApplicationTest\Bootstrap::getServiceManager();
     $this->oDao = $oServiceManager->get('DocumentTable');
     parent::setUp();
 }
开发者ID:Beanbiscuit,项目名称:examples,代码行数:10,代码来源:DocumentTableTest.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()
 {
     $basePath = __DIR__ . '/../../../../../';
     $this->setApplicationConfig(include $basePath . 'config/application.config.php');
     $serviceManager = Bootstrap::getServiceManager();
     $this->controller = new \Galaxy\Controller\IndexController();
     $this->request = new Request();
     $this->routeMatch = new RouteMatch(array('controller' => 'index'));
     $this->event = new MvcEvent();
     $config = $serviceManager->get('Config');
     $routerConfig = isset($config['router']) ? $config['router'] : array();
     $router = HttpRouter::factory($routerConfig);
     $this->event->setRouter($router);
     $this->event->setRouteMatch($this->routeMatch);
     $this->controller->setEvent($this->event);
     $this->controller->setServiceLocator($serviceManager);
     $mockAuth = $this->getMock('ZfcUser\\Entity\\UserInterface');
     $ZfcUserMock = $this->getMock('User\\Entity\\User');
     $ZfcUserMock->expects($this->any())->method('getId')->will($this->returnValue('3'));
     $authMock = $this->getMock('ZfcUser\\Controller\\Plugin\\ZfcUserAuthentication');
     $authMock->expects($this->any())->method('hasIdentity')->will($this->returnValue(true));
     $authMock->expects($this->any())->method('getIdentity')->will($this->returnValue($ZfcUserMock));
     $this->controller->getPluginManager()->setService('zfcUserAuthentication', $authMock);
     parent::setUp();
 }
开发者ID:nouron,项目名称:nouron,代码行数:25,代码来源:IndexControllerTest.php

示例7: setUp

 protected function setUp()
 {
     $this->setApplicationConfig(include __DIR__ . '/../../TestAsset/pdo.application.config.php');
     parent::setUp();
     $serviceManager = $this->getApplication()->getServiceManager();
     $serviceManager->setAllowOverride(true);
 }
开发者ID:gstearmit,项目名称:EshopVegeTable,代码行数:7,代码来源:BaseTest.php

示例8: setUp

 /**
  * Set up
  */
 public function setUp()
 {
     $this->setApplicationConfig(include 'config/application.config.php');
     $this->setTraceError(true);
     $this->sessionProgress = new Container('progress_tracker');
     parent::setUp();
 }
开发者ID:zfury,项目名称:cmf,代码行数:10,代码来源:IndexControllerTest.php

示例9: 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

示例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类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。