/** * tests initialization */ public function setUp() { TaoPhpUnitTestRunner::initTest(); $oauthClass = new core_kernel_classes_Class(CLASS_OAUTH_CONSUMER); $resource = $oauthClass->createInstanceWithProperties(array(PROPERTY_OAUTH_KEY => 'test_key', PROPERTY_OAUTH_SECRET => md5(rand()))); $this->oauthCustomer = new tao_models_classes_oauth_Credentials($resource); }
/** * tests initialization * load registry service */ public function setUp() { TaoPhpUnitTestRunner::initTest(); $this->registry = new CreatorRegistry(); $packageValid = dirname(__FILE__) . '/samples/valid.zip'; $this->registry->add($packageValid); }
/** * tests initialization */ public function setUp() { TaoPhpUnitTestRunner::initTest(); $this->userService = tao_models_classes_UserService::singleton(); $this->testUserData[PROPERTY_USER_PASSWORD] = core_kernel_users_Service::getPasswordHash()->encrypt($this->testUserData[PROPERTY_USER_PASSWORD]); $this->testUserUtf8Data[PROPERTY_USER_PASSWORD] = core_kernel_users_Service::getPasswordHash()->encrypt($this->testUserUtf8Data[PROPERTY_USER_PASSWORD]); }
public function setUp() { \common_ext_ExtensionsManager::singleton()->getExtensionById('taoDelivery'); TaoPhpUnitTestRunner::initTest(); $this->service = ServiceManager::getServiceManager()->get(DeliveryMonitoringService::CONFIG_ID); $this->persistence = \common_persistence_Manager::getPersistence('default'); }
public function setUp() { TaoPhpUnitTestRunner::initTest(); $this->disableCache(); // creates a user using remote script from joel $testUserData = array(PROPERTY_USER_LOGIN => 'tjdoe', PROPERTY_USER_PASSWORD => 'test123', PROPERTY_USER_LASTNAME => 'Doe', PROPERTY_USER_FIRSTNAME => 'John', PROPERTY_USER_MAIL => '*****@*****.**', PROPERTY_USER_DEFLG => \tao_models_classes_LanguageService::singleton()->getLanguageByCode(DEFAULT_LANG)->getUri(), PROPERTY_USER_UILG => \tao_models_classes_LanguageService::singleton()->getLanguageByCode(DEFAULT_LANG)->getUri(), PROPERTY_USER_ROLES => array(INSTANCE_ROLE_GLOBALMANAGER)); $testUserData[PROPERTY_USER_PASSWORD] = 'test' . rand(); $data = $testUserData; $data[PROPERTY_USER_PASSWORD] = \core_kernel_users_Service::getPasswordHash()->encrypt($data[PROPERTY_USER_PASSWORD]); $tmclass = new \core_kernel_classes_Class(CLASS_TAO_USER); $user = $tmclass->createInstanceWithProperties($data); \common_Logger::i('Created user ' . $user->getUri()); // prepare a lookup table of languages and values $usage = new \core_kernel_classes_Resource(INSTANCE_LANGUAGE_USAGE_GUI); $propValue = new \core_kernel_classes_Property(RDF_VALUE); $langService = \tao_models_classes_LanguageService::singleton(); $lookup = array(); foreach ($langService->getAvailableLanguagesByUsage($usage) as $lang) { $lookup[$lang->getUri()] = (string) $lang->getUniquePropertyValue($propValue); } $data = array('rootUrl' => ROOT_URL, 'userUri' => $user->getUri(), 'userData' => $testUserData, 'lang' => $lookup); $this->login = $data['userData'][PROPERTY_USER_LOGIN]; $this->password = $data['userData'][PROPERTY_USER_PASSWORD]; $this->userUri = $data['userUri']; }
public function tearDown() { parent::tearDown(); $ext = common_ext_ExtensionsManager::singleton()->getExtensionById('taoQtiItem'); $ext->setConfig($this->getConfigId(), array($this->getInitialMapping())); helpers_File::remove($this->getBasePath()); }
public function setUp() { TaoPhpUnitTestRunner::initTest(); $this->testService = taoQtiTest_models_classes_QtiTestService::singleton(); $this->dataDir = dirname(__FILE__) . '/data/'; $this->outputDir = sys_get_temp_dir() . '/'; }
/** * tests initialization */ public function setUp() { \common_ext_ExtensionsManager::singleton()->getExtensionById('taoTestTaker'); TaoPhpUnitTestRunner::initTest(); $this->subjectsService = TestTakerService::singleton(); $this->testCenterService = TestCenterService::singleton(); }
/** * initialize a test method */ public function setUp() { TaoPhpUnitTestRunner::initTest(); $activityExecutionClass = new core_kernel_classes_Class(CLASS_ACTIVITY_EXECUTION); $this->activityExecution = $activityExecutionClass->createInstance('test'); $this->service = wfEngine_models_classes_RecoveryService::singleton(); }
public function tearDown() { if ($this->item) { $this->item->delete(); } parent::tearDown(); }
public function setUp() { TaoPhpUnitTestRunner::initTest(); $this->testRunnerService = $this->getMockBuilder('oat\\taoTestLinear\\model\\TestRunnerService')->disableOriginalConstructor()->setMethods(array('getItemData', 'getPrevious'))->getMock(); $ref = new \ReflectionProperty('tao_models_classes_Service', 'instances'); $ref->setAccessible(true); $ref->setValue(null, array('oat\\taoTestLinear\\model\\TestRunnerService' => $this->testRunnerService)); }
public function setUp() { common_ext_ExtensionsManager::singleton()->getExtensionById('taoWfTest'); // loads the extension TaoPhpUnitTestRunner::initTest(); $this->service = taoWfTest_models_classes_WfTestService::singleton(); $this->test = $this->service->createInstance($this->service->getRootclass(), 'taoWfTestUnitCompilerTest'); }
public static function tearDownAfterClass() { parent::tearDownAfterClass(); $serviceManager = ServiceManager::getServiceManager(); $fsm = $serviceManager->get(FileSystemService::SERVICE_ID); $fsm->unregisterFileSystem(self::$fileSystem->getUri()); $serviceManager->register(FileSystemService::SERVICE_ID, $fsm); }
public function tearDown() { $this->itemClass->delete(); foreach ($this->items as $item) { $item->delete(); } parent::tearDown(); }
/** * tests initialization */ public function setUp() { common_ext_ExtensionsManager::singleton()->getExtensionById('taoWfTest'); // loads the extension TaoPhpUnitTestRunner::initTest(); $this->wftService = taoWfTest_models_classes_WfTestService::singleton(); $this->wfModel = new taoWfTest_models_classes_WfTestModel(); }
/** * tests initialization */ public function setUp() { TaoPhpUnitTestRunner::initTest(); try { $this->pdfBookletExporter = new PdfBookletExporter(); } catch (BookletExporterException $e) { $this->markTestSkipped($e->getMessage()); } }
/** * initialize a test method */ public function setUp() { TaoPhpUnitTestRunner::initTest(); error_reporting(E_ALL); $this->userPassword = '******'; if (is_null($this->userService)) { $this->userService = wfEngine_models_classes_UserService::singleton(); } }
public function setUp() { TaoPhpUnitTestRunner::initTest(); $this->service = TestRunnerService::singleton(); $this->storageMock = $this->getMockBuilder('tao_models_classes_service_FileStorage')->disableOriginalConstructor()->setMethods(array('getDirectoryById'))->getMock(); $ref = new \ReflectionProperty('tao_models_classes_service_FileStorage', 'instance'); $ref->setAccessible(true); $ref->setValue(null, $this->storageMock); $this->directoryMock = $this->getMockBuilder('tao_models_classes_service_StorageDirectory')->disableOriginalConstructor()->setMethods(array('getPath'))->getMock(); }
public function setUp() { TaoPhpUnitTestRunner::initTest(); $this->test = new \core_kernel_classes_Resource('http://myFancyDomain.com/myGreatResourceUriForTest'); $this->item = new \core_kernel_classes_Resource('http://myFancyDomain.com/myGreatResourceUriForItem'); $this->item->setPropertyValue(new \core_kernel_classes_Property('http://www.tao.lu/Ontologies/TAOItem.rdf#ItemModel'), 'http://www.tao.lu/Ontologies/TAOItem.rdf#QTI'); $this->testModel = new TestModel(); $this->storage = new \taoDelivery_models_classes_TrackedStorage(); $this->testModel->save($this->test, array()); }
/** * tests initialization */ public function setUp() { TaoPhpUnitTestRunner::initTest(); $processDefinitionClass = new core_kernel_classes_Class(CLASS_PROCESS); $processDefinition = $processDefinitionClass->createInstance('process of Checker UnitTest', 'created for the unit test of process cloner'); if ($processDefinition instanceof core_kernel_classes_Resource) { $this->proc = $processDefinition; } $this->authoringService = wfAuthoring_models_classes_ProcessService::singleton(); }
public function setUp() { TaoPhpUnitTestRunner::initTest(); $this->testModel = new TestModel(); $this->uri = "MyGreatTestUri#123"; $this->test = new \core_kernel_classes_Resource($this->uri); if (!file_exists(sys_get_temp_dir() . '/sample/')) { mkdir(sys_get_temp_dir() . '/sample/'); } }
public function tearDown() { parent::tearDown(); helpers_File::remove($this->getBasePath()); //unregister all $ids = array_keys(array_diff_key($this->getClientLibRegistryMap(), $this->initialMapping)); foreach ($ids as $id) { ClientLibRegistry::getRegistry()->remove($id); } }
public function setUp() { \common_ext_ExtensionsManager::singleton()->getExtensionById('taoDelivery'); TaoPhpUnitTestRunner::initTest(); $service = ServiceManager::getServiceManager()->get(MonitorCacheService::CONFIG_ID); $this->service = new MonitorCacheService($service->getOptions()); $this->persistence = \common_persistence_Manager::getPersistence('default'); if (!extension_loaded('pthreads')) { $this->markTestSkipped('Pthreads extension is not available.'); } }
/** * tests initialization */ public function setUp() { TaoPhpUnitTestRunner::initTest(); $this->campaignService = taoCampaign_models_classes_CampaignService::singleton(); $rootClass = new core_kernel_classes_Class(TAO_DELIVERY_CAMPAIGN_CLASS); $this->campaignClass = $this->campaignService->createCampaignClass($rootClass, "My Campaign Class"); $this->campaign = $this->campaignClass->createInstance("MyCampaign"); $deliveryClass = new core_kernel_classes_Class(TAO_DELIVERY_CLASS); $this->delivery = $deliveryClass->createInstance("MyDelivery"); $this->campaignService->setRelatedDeliveries($this->campaign, array($this->delivery->getUri())); }
/** * tests initialization */ public function setUp() { TaoPhpUnitTestRunner::initTest(); $this->clearPassword = $this->testUserData[PROPERTY_USER_PASSWORD]; $this->testUserData[PROPERTY_USER_PASSWORD] = core_kernel_users_Service::getPasswordHash()->encrypt($this->testUserData[PROPERTY_USER_PASSWORD]); $this->userService = tao_models_classes_UserService::singleton(); $class = new core_kernel_classes_Class(CLASS_GENERIS_USER); $this->testUser = $class->createInstance(); $this->assertNotNull($this->testUser); $this->userService->bindProperties($this->testUser, $this->testUserData); }
/** * tests initialization */ public function setUp() { // load delivery constants, none required for deliveryTemplate common_ext_ExtensionsManager::singleton()->getExtensionById('taoDelivery'); TaoPhpUnitTestRunner::initTest(); $this->assemblyService = taoDelivery_models_classes_DeliveryAssemblyService::singleton(); $testsService = taoTests_models_classes_TestsService::singleton(); $this->test = $testsService->createInstance($testsService->getRootclass(), 'deliveryUnitCompilerTest'); $deliveryContentSuperClass = new core_kernel_classes_Class(DeliveryContent::SUPER_CLASS); $this->contentClass = $deliveryContentSuperClass->createSubClass('abstractContentSubclass'); $this->content = $this->contentClass->createInstanceWithProperties(array(DeliveryTemplate::PROPERTY_CONTENT => $this->test->getUri(), RDFS_LABEL => 'contentInstanceUnitTest')); }
public function tearDown() { parent::tearDown(); $userService = tao_models_classes_UserService::singleton(); $roleService = tao_models_classes_RoleService::singleton(); if ($this->user != null) { $userService->removeUser($this->user); } if ($this->testRole) { $roleService->removeRole($this->testRole); } }
public function setUp() { parent::setUp(); $this->service = PlatformThemingService::singleton(); // Save current Theming config... $this->tempConfig = $this->service->retrieveThemingConfig(); // Set up all tests with an empty Theming Configuration. $this->service->syncThemingConfig(new PlatformThemingConfig()); // Deal with data storage. $testFile = rtrim(sys_get_temp_dir(), "\\/") . '/tmp-platformthemingtest.txt'; file_put_contents($testFile, 'data'); }
/** * tests initialization */ public function setUp() { \common_ext_ExtensionsManager::singleton()->getExtensionById('taoTestTaker'); TaoPhpUnitTestRunner::initTest(); $this->proctorManagementService = ProctorManagementService::singleton(); //clean test resources $proctor1 = new \core_kernel_classes_Resource('http://myTest.case#proctor1'); $proctor2 = new \core_kernel_classes_Resource('http://myTest.case#proctor2'); $proctor3 = new \core_kernel_classes_Resource('http://myTest.case#proctor3'); $proctor1->delete(true); $proctor2->delete(true); $proctor3->delete(true); }
/** * tests initialization */ public function setUp() { TaoPhpUnitTestRunner::initTest(); $processDefinitionClass = new core_kernel_classes_Class(CLASS_PROCESS); $processDefinition = $processDefinitionClass->createInstance('processForUnitTest', 'created for the unit test of process definition service'); if ($processDefinition instanceof core_kernel_classes_Resource) { $this->processDefinition = $processDefinition; } else { $this->fail('fail to create a process definition resource'); } $this->authoringService = wfAuthoring_models_classes_ProcessService::singleton(); $this->service = wfEngine_models_classes_ProcessDefinitionService::singleton(); }