當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。