/**
  * tests initialization
  */
 public function setUp()
 {
     TaoTestRunner::initTest();
     $resultsService = taoResults_models_classes_ResultsService::singleton();
     $this->resultsService = $resultsService;
     $this->statsService = taoResults_models_classes_StatisticsService::singleton();
     $this->reportService = taoResults_models_classes_ReportService::singleton();
     //create an activity execution
     $activityExecutionClass = new core_kernel_classes_Class(CLASS_ACTIVITY_EXECUTION);
     //create an activity definition
     $activityDefinitionClass = new core_kernel_classes_Class(CLASS_ACTIVITIES);
     $this->activityExecution = $activityExecutionClass->createInstance("MyActivityExecution");
     //links the activity execution to the activity definition
     $this->activityDefinition = $activityDefinitionClass->createInstance("MyActivityDefinition");
     $this->activityExecution->setPropertyValue(new core_kernel_classes_Property(PROPERTY_ACTIVITY_EXECUTION_ACTIVITY), $this->activityDefinition->getUri());
     //links the call of service to the activity execution
     $interactiveServiceClass = new core_kernel_classes_Class(CLASS_CALLOFSERVICES);
     $this->interactiveService = $interactiveServiceClass->createInstance("MyInteractiveServiceCall");
     $this->activityDefinition->setPropertyValue(new core_kernel_classes_Property(PROPERTY_ACTIVITIES_INTERACTIVESERVICES), $this->interactiveService->getUri());
     $this->interactiveService->setPropertyValue(new core_kernel_classes_Property(PROPERTY_CALLOFSERVICES_SERVICEDEFINITION), "#interactiveServiceDefinition");
     $deliveryResult = new core_kernel_classes_Resource("#MyDeliveryResult");
     $variableIDentifier = "GRADE";
     $value = 0.4;
     //create a small delivery
     $this->subClass = $this->resultsService->createSubClass(new core_kernel_classes_Class(TAO_DELIVERY_RESULT), "UnitTestingGenClass");
     $this->delivery = $this->subClass->createInstance("UnitTestingGenDelivery");
     $this->delivery->setPropertyValue(new core_kernel_classes_Property(PROPERTY_RESULT_OF_DELIVERY), "#unitTestResultOfDelivery");
     $this->delivery->setPropertyValue(new core_kernel_classes_Property(PROPERTY_RESULT_OF_SUBJECT), "#unitTestResultOfSubject");
     $this->delivery->setPropertyValue(new core_kernel_classes_Property(PROPERTY_RESULT_OF_PROCESS), "#unitTestResultOfProcess");
     //stores a grade in this delivery
     $this->grade = $this->resultsService->storeGrade($this->delivery, $this->activityExecution, $variableIDentifier, $value);
     $this->response = $this->resultsService->storeResponse($this->delivery, $this->activityExecution, $variableIDentifier, $value);
 }
 public function setUp()
 {
     parent::setUp();
     TaoTestRunner::initTest();
     $return = $this->rawCurl(ROOT_URL . 'tao/test/connector/setUp.php', array());
     $data = json_decode($return, true);
     $this->assertNotNull($data);
     if (!defined('TAO_ROOT_URL')) {
         define('TAO_ROOT_URL', $data['rootUrl']);
     }
     $this->UserData = $data['userData'];
     $this->userUri = $data['userUri'];
     $this->langLookup = $data['lang'];
     $this->userService = new taoUserService();
     $this->assertIsA($this->userService, 'taoUserService');
 }
 public function setUp()
 {
     TaoTestRunner::initTest();
     $this->localResultsService = new taoResultServer_models_classes_LocalResultsService("ontology");
 }
 /**
  * tests initialization
  */
 public function setUp()
 {
     TaoTestRunner::initTest();
     $this->service = taoUpdate_models_classes_ShieldService::singleton();
 }
 /**
  * tests initialization
  */
 public function setUp()
 {
     TaoTestRunner::initTest();
     $this->service = taoUpdate_models_classes_Service::singleton();
     $this->service->initReleaseService(BASE_URL . '/test/sample/releases10.xml');
 }
 /**
  * tests initialization
  */
 public function setUp()
 {
     TaoTestRunner::initTest();
 }
Exemplo n.º 7
0
 * as published by the Free Software Foundation; under version 2
 * of the License (non-upgradable).
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 * 
 * Copyright (c) 2013 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
 *  
 */
require_once dirname(__FILE__) . '/../../tao/test/TaoTestRunner.php';
//get the test into each extensions
$tests = TaoTestRunner::getTests(array('taoUpdate'));
//create the test sutie
$testSuite = new TestSuite('TAO Update unit tests');
foreach ($tests as $testCase) {
    $testSuite->addFile($testCase);
}
//add the reporter regarding the context
if (PHP_SAPI == 'cli') {
    $reporter = new XmlTimeReporter();
} else {
    $reporter = new HtmlReporter();
}
//run the unit test suite
$testSuite->run($reporter);