Esempio n. 1
0
 public function _before()
 {
     parent::_before();
     if (!extension_loaded('mcrypt')) {
         $this->markTestSkipped('Warning: mcrypt extension is not loaded');
     }
 }
Esempio n. 2
0
 /**
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->checkoutFacade = new CheckoutFacade();
     $factoryMock = $this->getFactory();
     $this->checkoutFacade->setFactory($factoryMock);
 }
Esempio n. 3
0
 /**
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->rolesTransfer = new RolesTransfer();
     $this->facade = new AclFacade();
     $this->userFacade = new UserFacade();
 }
 protected function setUp()
 {
     if (!extension_loaded('phalcon')) {
         $this->markTestSkipped('The phalcon module is not available.');
     }
     parent::setUp();
 }
 /**
  * Clean up the testing environment before the next test.
  *
  * @return void
  */
 public function tearDown()
 {
     if ($this->app) {
         $this->app->flush();
     }
     return parent::tearDown();
 }
Esempio n. 6
0
 protected function setUp()
 {
     parent::setUp();
     $context = new PhpContext();
     $context->UnitTesting = true;
     HttpClient::setDefaultHttpClientClassName(UnitTestingRhubarbRequestHttpClient::class);
 }
Esempio n. 7
0
 /**
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $countryFacadeMock = $this->getMockBuilder(SalesToCountryInterface::class)->setMethods(['getIdCountryByIso2Code', 'getAvailableCountries'])->getMock();
     $countryFacadeMock->method('getIdCountryByIso2Code')->will($this->returnValue(1));
     $omsOrderProcessEntity = $this->getProcessEntity();
     $omsFacadeMock = $this->getMockBuilder(SalesToOmsInterface::class)->setMethods(['selectProcess', 'getInitialStateEntity', 'getProcessEntity', 'getManualEvents', 'getItemsWithFlag', 'getManualEventsByIdSalesOrder', 'getDistinctManualEventsByIdSalesOrder', 'getOrderItemMatrix'])->getMock();
     $omsFacadeMock->method('selectProcess')->will($this->returnValue('CheckoutTest01'));
     $initialStateEntity = SpyOmsOrderItemStateQuery::create()->filterByName(OmsConstants::INITIAL_STATUS)->findOneOrCreate();
     $initialStateEntity->save();
     $omsFacadeMock->method('getInitialStateEntity')->will($this->returnValue($initialStateEntity));
     $omsFacadeMock->method('getProcessEntity')->will($this->returnValue($omsOrderProcessEntity));
     $sequenceNumberFacade = new SequenceNumberFacade();
     $container = new Container();
     $container[SalesDependencyProvider::FACADE_COUNTRY] = new SalesToCountryBridge($countryFacadeMock);
     $container[SalesDependencyProvider::FACADE_OMS] = new SalesToOmsBridge($omsFacadeMock);
     $container[SalesDependencyProvider::FACADE_SEQUENCE_NUMBER] = new SalesToSequenceNumberBridge($sequenceNumberFacade);
     $this->salesFacade = new SalesFacade();
     $businessFactory = new SalesBusinessFactory();
     $salesConfigMock = $this->getMockBuilder(SalesConfig::class)->setMethods(['determineProcessForOrderItem'])->getMock();
     $salesConfigMock->method('determineProcessForOrderItem')->willReturn('');
     $businessFactory->setConfig($salesConfigMock);
     $businessFactory->setContainer($container);
     $this->salesFacade->setFactory($businessFactory);
 }
 public function __construct()
 {
     parent::__construct();
     $this->logger = new Logger(ROOT . '/test.log');
     $data = json_decode(file_get_contents('groph.json'), true);
     $this->fixtures = $data['tags'];
 }
Esempio n. 9
0
 /**
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->urlFacade = new UrlFacade();
     $this->localeFacade = new LocaleFacade();
     $this->urlQueryContainer = new UrlQueryContainer();
     $this->touchQueryContainer = new TouchQueryContainer();
 }
Esempio n. 10
0
 /**
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->localeFacade = new LocaleFacade();
     $this->productFacade = new ProductFacade();
     $this->urlFacade = new UrlFacade();
     $this->productQueryContainer = new ProductQueryContainer();
 }
Esempio n. 11
0
 protected function setUp()
 {
     parent::setUp();
     $application = new Application();
     $application->add(new Add('add'));
     $command = $application->find('add');
     $this->commandTester = new CommandTester($command);
 }
Esempio n. 12
0
 /**
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->localeFacade = new LocaleFacade();
     $this->localeQueryContainer = new LocaleQueryContainer();
     $this->availableLocales = Store::getInstance()->getLocales();
     $this->localeNames = $this->localeFacade->getAvailableLocales();
 }
Esempio n. 13
0
 /**
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->createTouchEntity(SpyTouchTableMap::COL_ITEM_EVENT_ACTIVE, self::ITEM_ID_1);
     $this->createTouchEntity(SpyTouchTableMap::COL_ITEM_EVENT_INACTIVE, self::ITEM_ID_2);
     $this->createTouchEntity(SpyTouchTableMap::COL_ITEM_EVENT_DELETED, self::ITEM_ID_3);
     sleep(1);
 }
Esempio n. 14
0
 /**
  * @return void
  */
 protected function _before()
 {
     parent::_before();
     $this->setUpSalesOrderTestData();
     $this->setUpPaymentTestData();
     $this->responseConverter = new ResponseConverter();
     $this->requestLogQuery = new SpyPaymentPayolutionTransactionRequestLogQuery();
     $this->statusLogQuery = new SpyPaymentPayolutionTransactionStatusLogQuery();
 }
 /**
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->localeFacade = new LocaleFacade();
     $this->productFacade = new ProductFacade();
     $this->categoryFacade = new CategoryFacade();
     $this->productCategoryFacade = new ProductCategoryFacade();
     $this->productCategoryQueryContainer = new ProductQueryContainer();
 }
Esempio n. 16
0
 /**
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->glossaryQueryContainer = new GlossaryQueryContainer();
     $this->localeFacade = new LocaleFacade();
     $this->touchFacade = new TouchFacade();
     $this->touchQueryContainer = new TouchQueryContainer();
     $this->glossaryFacade = new GlossaryFacade();
 }
 /**
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $discounts = SpyDiscountQuery::create()->find();
     foreach ($discounts as $discountEntity) {
         $discountEntity->setIsActive(false);
         $discountEntity->save();
     }
 }
Esempio n. 18
0
 /**
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->availabilityFacade = new AvailabilityFacade();
     $container = new Container();
     $businessFactory = new AvailabilityBusinessFactory();
     $dependencyProvider = new AvailabilityDependencyProvider();
     $dependencyProvider->provideBusinessLayerDependencies($container);
     $businessFactory->setContainer($container);
     $this->availabilityFacade->setFactory($businessFactory);
 }
 /**
  * { @inheritdoc }
  */
 protected function setUp()
 {
     parent::setUp();
     if (Codeception\Codecept::VERSION >= '2.1.0') {
         $this->module = $this->moduleContainer->getModule('\\Codeception\\Module\\Drupal7\\Drupal7');
     } else {
         $this->module = $this->getModule('\\Codeception\\Module\\Drupal7\\Drupal7');
     }
     $this->validConfig = Fixtures::get('validModuleConfig');
     $this->invalidConfig = Fixtures::get('invalidModuleConfig');
 }
Esempio n. 20
0
 /**
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->touchFacade = new TouchFacade();
     $container = new Container();
     $dependencyProvider = new TouchDependencyProvider();
     $dependencyProvider->provideBusinessLayerDependencies($container);
     $businessFactory = new TouchBusinessFactory();
     $businessFactory->setContainer($container);
     $this->touchFacade->setFactory($businessFactory);
     $this->touchQueryContainer = new TouchQueryContainer();
 }
Esempio n. 21
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     if (!function_exists('set_site_transient')) {
         function set_site_transient($key, $value)
         {
             global $_transients;
             $_transients = is_array($_transients) ? $_transients : [];
             $_transients[$key] = $value;
         }
     }
 }
Esempio n. 22
0
 /**
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $container = new Container();
     $dependencyProvider = new CartDependencyProvider();
     $dependencyProvider->provideBusinessLayerDependencies($container);
     $dependencyProvider->provideCommunicationLayerDependencies($container);
     $dependencyProvider->providePersistenceLayerDependencies($container);
     $this->cartFacade = new CartFacade();
     $this->priceFacade = new PriceFacade();
     $this->setTestData();
 }
 /**
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->ids = DbFixturesLoader::loadFixtures();
     $this->facade = new ProductOptionFacade();
     $this->facade->setFactory(new ProductOptionBusinessFactory());
     $this->localeFacade = new LocaleFacade();
     $this->localeFacade->setFactory(new LocaleBusinessFactory());
     $this->productFacade = new ProductFacade();
     $this->productFacade->setFactory(new ProductBusinessFactory());
     $this->productQueryContainer = new ProductQueryContainer();
     $this->productOptionQueryContainer = new ProductOptionQueryContainer();
     $this->buildProductOptionFacade();
 }
 /**
  * Test set up
  */
 protected function setUp()
 {
     parent::setUp();
     $this->request = $this->getMockBuilder('\\OCP\\IRequest')->disableOriginalConstructor()->getMock();
     $this->hasher = $this->getMockBuilder('\\OCP\\Security\\IHasher')->disableOriginalConstructor()->getMock();
     $this->session = $this->getMockBuilder('\\OCP\\ISession')->disableOriginalConstructor()->getMock();
     $this->environment = $this->getMockBuilder('\\OCA\\Gallery\\Environment\\Environment')->disableOriginalConstructor()->getMock();
     // We need to use a real reflector to be able to test our custom notation
     $this->reflector = new ControllerMethodReflector();
     $this->urlGenerator = $this->getMockBuilder('\\OCP\\IURLGenerator')->disableOriginalConstructor()->getMock();
     $this->logger = $this->getMockBuilder('\\OCP\\ILogger')->disableOriginalConstructor()->getMock();
     $this->controller = $this->getMockBuilder('OCP\\AppFramework\\Controller')->disableOriginalConstructor()->getMock();
     $this->middleware = new EnvCheckMiddleware($this->appName, $this->request, $this->hasher, $this->session, $this->environment, $this->reflector, $this->urlGenerator, $this->logger);
     /**
      * Injects objects we need to bypass the static methods
      *
      * CODECEPTION SPECIFIC
      */
     $setupData = $this->getModule('\\Helper\\DataSetup');
     $this->sharedFolderToken = $setupData->sharedFolderToken;
     $this->passwordForFolderShare = $setupData->passwordForFolderShare;
     $this->coreTestCase = $setupData->coreTestCase;
 }
 public function __construct()
 {
     parent::__construct();
     $this->ci =& get_instance();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->serviceContainer = $this->getModule('Symfony2')->container;
     $this->formFactory = $this->serviceContainer->get('form.factory');
 }
Esempio n. 27
0
 /**
  * @inheritdoc
  */
 protected function tearDown()
 {
     $this->destroyApplication();
     $this->unloadFixtures();
     parent::tearDown();
 }
Esempio n. 28
0
 protected function _before()
 {
     $this->model = UserRoles::model();
     return parent::_before();
 }
Esempio n. 29
0
 protected function setUp()
 {
     parent::setUp();
     $this->manager = new ComponentManager(new Finder());
 }
Esempio n. 30
0
 /**
  * @inheritdoc
  */
 protected function tearDown()
 {
     $this->destroyApplication();
     parent::tearDown();
 }