Example #1
0
 public function _before()
 {
     parent::_before();
     if (!extension_loaded('mcrypt')) {
         $this->markTestSkipped('Warning: mcrypt extension is not loaded');
     }
 }
Example #2
0
 /**
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->checkoutFacade = new CheckoutFacade();
     $factoryMock = $this->getFactory();
     $this->checkoutFacade->setFactory($factoryMock);
 }
Example #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();
 }
Example #6
0
 protected function setUp()
 {
     parent::setUp();
     $context = new PhpContext();
     $context->UnitTesting = true;
     HttpClient::setDefaultHttpClientClassName(UnitTestingRhubarbRequestHttpClient::class);
 }
 /**
  * @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'];
 }
Example #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();
 }
Example #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();
 }
Example #11
0
 protected function setUp()
 {
     parent::setUp();
     $application = new Application();
     $application->add(new Add('add'));
     $command = $application->find('add');
     $this->commandTester = new CommandTester($command);
 }
Example #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();
 }
Example #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);
 }
Example #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();
 }
Example #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();
     }
 }
Example #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');
 }
Example #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();
 }
 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;
         }
     }
 }
Example #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');
 }
Example #27
0
 /**
  * @inheritdoc
  */
 protected function tearDown()
 {
     $this->destroyApplication();
     $this->unloadFixtures();
     parent::tearDown();
 }
Example #28
0
 protected function _before()
 {
     $this->model = UserRoles::model();
     return parent::_before();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->manager = new ComponentManager(new Finder());
 }
Example #30
0
 /**
  * @inheritdoc
  */
 protected function tearDown()
 {
     $this->destroyApplication();
     parent::tearDown();
 }