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


PHP Test\Bootstrap类代码示例

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


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

示例1: testCreateService

 public function testCreateService()
 {
     $sm = clone Bootstrap::getServiceManager();
     $fm = $sm->get('formElementManager');
     $result = $this->testedObj->createService($fm);
     $this->assertInstanceOf('Auth\\Form\\Register', $result);
 }
开发者ID:utrenkner,项目名称:YAWIK,代码行数:7,代码来源:RegisterFactoryTest.php

示例2: testCreateService

 public function testCreateService()
 {
     $helperPluginManager = new HelperPluginManager();
     $helperPluginManager->setServiceLocator(Bootstrap::getServiceManager());
     $result = $this->testedObj->createService($helperPluginManager);
     $this->assertInstanceOf(FlashMessages::class, $result);
 }
开发者ID:omusico,项目名称:zf2-demo,代码行数:7,代码来源:FlashMessagesSLFactoryTest.php

示例3: testCreateService

 public function testCreateService()
 {
     $controllerManager = new ControllerManager();
     $controllerManager->setServiceLocator(Bootstrap::getServiceManager());
     $result = $this->testedObj->createService($controllerManager);
     $this->assertInstanceOf(UpdateController::class, $result);
 }
开发者ID:omusico,项目名称:zf2-demo,代码行数:7,代码来源:UpdateControllerFactoryTest.php

示例4: setUp

 public function setUp()
 {
     $this->serviceLocator = null;
     $this->setApplicationConfig(Bootstrap::getConfig());
     parent::setUp();
     $this->prepareAuthenticateMock();
 }
开发者ID:omusico,项目名称:zf2-demo,代码行数:7,代码来源:AbstractFunctionalControllerTestCase.php

示例5: testCreateService

 public function testCreateService()
 {
     $sm = clone Bootstrap::getServiceManager();
     $fm = $sm->get('formElementManager');
     $result = $this->factory->createService($fm);
     $this->assertInstanceOf(UserStatusFieldset::class, $result);
 }
开发者ID:cross-solution,项目名称:yawik,代码行数:7,代码来源:UserStatusFieldsetFactoryTest.php

示例6: testCreateService

 public function testCreateService()
 {
     $sm = clone Bootstrap::getServiceManager();
     $sm->setAllowOverride(true);
     $repositoriesMock = $this->getMockBuilder('Core\\Repository\\RepositoryService')->disableOriginalConstructor()->getMock();
     $sm->setService('repositories', $repositoriesMock);
     $result = $this->testedObj->createService($sm);
     $this->assertInstanceOf('Auth\\Service\\GotoResetPassword', $result);
 }
开发者ID:cross-solution,项目名称:yawik,代码行数:9,代码来源:GotoResetPasswordFactoryTest.php

示例7: setUp

 public function setUp()
 {
     $this->init('login');
     $this->loginFormMock = $this->getMockBuilder(LoginForm::class)->disableOriginalConstructor()->getMock();
     $this->loginService = $this->getMockBuilder(LoginService::class)->disableOriginalConstructor()->getMock();
     $this->controller = new LoginController($this->loginFormMock, $this->loginService);
     $this->controller->setEvent($this->event);
     $this->controller->getPluginManager()->setServiceLocator(Bootstrap::getServiceManager());
 }
开发者ID:omusico,项目名称:zf2-demo,代码行数:9,代码来源:LoginControllerTest.php

示例8: setUp

 public function setUp()
 {
     $this->setApplicationConfig(Bootstrap::getConfig());
     parent::setUp();
     $this->repository = $this->getApplicationServiceLocator()->get('repositories')->get('Jobs/Job');
     $this->dm = $this->getApplicationServiceLocator()->get('doctrine.documentmanager.odm_default');
     $this->initOrganization();
     $this->initJob();
 }
开发者ID:cross-solution,项目名称:yawik,代码行数:9,代码来源:JobTest.php

示例9: getBookEntityWithRandomData

 /**
  * @param bool $withRandomId
  *
  * @return BookEntity
  */
 public function getBookEntityWithRandomData($withRandomId = true)
 {
     $bookEntity = new BookEntity();
     $bookEntity->setTitle(uniqid('title'))->setDescription(uniqid('description'))->setPublisher(uniqid('publisher'))->setYear(mt_rand(1900, date('Y')))->setPrice(mt_rand(1, 10000) / 100)->setIsbn($this->getIsbn13Random());
     if ($withRandomId) {
         Bootstrap::setIdToEntity($bookEntity, mt_rand(1, 999));
     }
     return $bookEntity;
 }
开发者ID:omusico,项目名称:zf2-demo,代码行数:14,代码来源:BookEntityProvider.php

示例10: setUp

 public function setUp()
 {
     $this->serviceLocator = null;
     $this->setApplicationConfig(Bootstrap::getConfig());
     parent::setUp();
     if (!is_object($this->serviceLocator)) {
         $this->serviceLocator = $this->getApplicationServiceLocator();
         $this->serviceLocator->setAllowOverride(true);
     }
 }
开发者ID:cross-solution,项目名称:yawik,代码行数:10,代码来源:FunctionalTestCase.php

示例11: prepareAuthenticateMock

 /**
  * @param bool       $hasIdentity
  * @param UserEntity $userEntity
  */
 protected function prepareAuthenticateMock($hasIdentity = false, UserEntity $userEntity = null)
 {
     $authMock = $this->getMockBuilder(AuthenticationService::class)->disableOriginalConstructor()->getMock();
     $authMock->expects($this->any())->method('hasIdentity')->will($this->returnValue($hasIdentity));
     $authMock->expects($this->any())->method('getIdentity')->will($this->returnValue($userEntity));
     $sm = Bootstrap::getServiceManager();
     $sm->setAllowOverride(true);
     $sm->setService(AuthenticationService::class, $authMock);
     $sm->setAllowOverride(false);
 }
开发者ID:omusico,项目名称:zf2-demo,代码行数:14,代码来源:AbstractControllerTestCase.php

示例12: testCreateService

 public function testCreateService()
 {
     $sm = clone Bootstrap::getServiceManager();
     $sm->setAllowOverride(true);
     $userRepositoryMock = $this->getMockBuilder('Auth\\Repository\\User')->disableOriginalConstructor()->getMock();
     $repositoriesMock = $this->getMockBuilder('Core\\Repository\\RepositoryService')->disableOriginalConstructor()->getMock();
     $repositoriesMock->expects($this->once())->method('get')->with('Auth/User')->willReturn($userRepositoryMock);
     $sm->setService('repositories', $repositoriesMock);
     $result = $this->testedObj->createService($sm);
     $this->assertInstanceOf('Auth\\Service\\Register', $result);
 }
开发者ID:webpants,项目名称:YAWIK,代码行数:11,代码来源:RegisterFactoryTest.php

示例13: testCreateService

 /**
  *
  */
 public function testCreateService()
 {
     $sm = clone Bootstrap::getServiceManager();
     $sm->setAllowOverride(true);
     $config = $this->mockJobsOptions;
     $config->method('__isset')->with('multipostingTargetUri')->willReturn(True);
     $config->method('__get')->with('multipostingTargetUri')->willReturn('http://user:pass@host/path');
     $sm->setService('Jobs/Options', $config);
     $result = $this->testedObj->createService($sm);
     $this->assertInstanceOf('Core\\Service\\RestClient', $result);
 }
开发者ID:webpants,项目名称:YAWIK,代码行数:14,代码来源:JobsPublisherFactoryTest.php

示例14: init

 public function init($controllerName, $actionName = 'index', $lang = 'en')
 {
     $this->routeMatch = new RouteMatch(array('controller' => $controllerName, 'action' => $actionName, 'lang' => $lang));
     $this->event = new MvcEvent();
     $this->event->setRouteMatch($this->routeMatch);
     /** @var SimpleRouteStack $router */
     $routerFactory = new RouterFactory();
     $router = $routerFactory->createService(clone Bootstrap::getServiceManager());
     $router->setDefaultParam('lang', $lang);
     $this->event->setRouter($router);
 }
开发者ID:webpants,项目名称:YAWIK,代码行数:11,代码来源:AbstractControllerTestCase.php

示例15: testCreateService

 public function testCreateService()
 {
     $sm = clone Bootstrap::getServiceManager();
     $sm->setAllowOverride(true);
     $organizationRepositoryMock = $this->getMockBuilder('Organizations\\Repository\\Organization')->disableOriginalConstructor()->getMock();
     $repositoriesMock = $this->getMockBuilder('Core\\Repository\\RepositoryService')->disableOriginalConstructor()->getMock();
     $repositoriesMock->expects($this->once())->method('get')->with('Organizations/Organization')->willReturn($organizationRepositoryMock);
     $sm->setService('repositories', $repositoriesMock);
     $result = $this->testedObj->createService($sm);
     $this->assertInstanceOf('Jobs\\Form\\Hydrator\\OrganizationNameHydrator', $result);
 }
开发者ID:webpants,项目名称:YAWIK,代码行数:11,代码来源:OrganizationNameHydratorSLFactoryTest.php


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