예제 #1
0
 public function setUp()
 {
     GenerisPhpUnitTestRunner::initTest();
     $user = $this->prophesize('oat\\oatbox\\user\\User');
     $user->getIdentifier()->willReturn('tastIdentifier\\_of_//User');
     $this->user = $user->reveal();
 }
 protected function setUp()
 {
     GenerisPhpUnitTestRunner::initTest();
     $this->installExtension('generisHard');
     $this->object = new core_kernel_classes_Class(RDFS_RESOURCE);
     $this->object->debug = __METHOD__;
 }
예제 #3
0
파일: FileTest.php 프로젝트: oat-sa/generis
 public function setUp()
 {
     GenerisPhpUnitTestRunner::initTest();
     $this->fsPath = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'taoFileTestCase' . DIRECTORY_SEPARATOR;
     mkdir($this->fsPath);
     $this->fileSource = core_kernel_fileSystem_FileSystemFactory::createFileSystem(new core_kernel_classes_Resource(INSTANCE_GENERIS_VCS_TYPE_LOCAL), '', '', '', $this->fsPath, 'testFileSource', true);
 }
 /**
  * Setting the collection to test
  *
  */
 protected function setUp()
 {
     GenerisPhpUnitTestRunner::initTest();
     $this->object = new common_Collection(new common_Object(__METHOD__));
     $this->toto = new core_kernel_classes_Literal('toto', __METHOD__);
     $this->tata = new core_kernel_classes_Literal('tata', __METHOD__);
     $this->object->sequence[0] = $this->toto;
     $this->object->sequence[1] = $this->tata;
 }
예제 #5
0
 protected function tearDown()
 {
     helpers_File::remove($this->directory);
     if ($this->repository != null) {
         $directory = $this->repository->getPath();
         $this->repository->delete();
         parent::tearDown();
     } else {
         throw new common_Exception('Repository should never be null');
     }
 }
예제 #6
0
 protected function setUp()
 {
     GenerisPhpUnitTestRunner::initTest();
     $dbWrapper = core_kernel_classes_DbWrapper::singleton();
     //TODO need to connect to a dbWrapper a function createTable that currently not exists
     $dbWrapper->exec('
             CREATE TABLE "dbTestCase" (
                 "id" INT,
                 "uri" VARCHAR(255) NOT NULL,
                 "coluMn1" VARCHAR(255) )');
     for ($i = 0; $i < 4; $i++) {
         $dbWrapper->exec('INSERT INTO  "dbTestCase" (id,uri,"coluMn1") VALUES (?,?,?) ;', array($i, 'http://uri' . $i, 'value' . $i));
     }
 }
예제 #7
0
 public function setUp()
 {
     GenerisPhpUnitTestRunner::initTest();
     $class = new core_kernel_classes_Class(CLASS_GENERIS_RESOURCE);
     $this->topClass = $class->createSubClass('test class 1');
     $this->emptyClass = $class->createSubClass('test class 2');
     $class1a = $this->topClass->createSubClass('test class 1a');
     $class1b = $this->topClass->createSubClass('test class 1b');
     $class1c = $this->topClass->createSubClass('test class 1c');
     $class1c1 = $class1c->createSubClass('test class 1c1');
     $instance1_1 = $this->topClass->createInstance('test instance 1.1');
     $instance1_2 = $this->topClass->createInstance('test instance 1.2');
     $instance1_3 = $this->topClass->createInstance('test instance 1.3');
     $instance1b_1 = $class1b->createInstance('test instance 1b.1');
     $instance1b_2 = $class1b->createInstance('test instance 1b.2');
     $instance1c1_1 = $class1c1->createInstance('test instance 1c1.1');
     $instance1c1_2 = $class1c1->createInstance('test instance 1c1.2');
 }
 public function setUp()
 {
     GenerisPhpUnitTestRunner::initTest();
     $this->installExtension('generisHard');
     $this->createContextOfThetest();
 }
예제 #9
0
파일: LogTest.php 프로젝트: nagyist/generis
 protected function setUp()
 {
     GenerisPhpUnitTestRunner::initTest();
 }
 /**
  * Setting the Api to test
  *
  */
 protected function setUp()
 {
     GenerisPhpUnitTestRunner::initTest();
     $this->object = core_kernel_impl_ApiModelOO::singleton();
 }
예제 #11
0
 public function tearDown()
 {
     parent::tearDown();
     $this->sampleUser->delete();
 }
예제 #12
0
 public function testGetOnePropertyValue()
 {
     $session = GenerisPhpUnitTestRunner::getTestSession();
     $class = new core_kernel_classes_Class(GENERIS_BOOLEAN, __METHOD__);
     $instance = $class->createInstance('test', 'test');
     $seeAlso = $class->createProperty('seeAlsoDo', 'multilingue', true);
     // If there is no value for the targeted property,
     // it should return null.
     $one = $instance->getOnePropertyValue($seeAlso);
     $this->assertEquals($one, null);
     $instance->setPropertyValue($seeAlso, 'plop');
     $one = $instance->getOnePropertyValue($seeAlso);
     $this->assertEquals($one->literal, 'plop');
     try {
         $one = $instance->getOnePropertyValue($seeAlso, true);
         $this->fail('core_kernel_persistence_Exception should have been thrown');
     } catch (\Exception $e) {
         $this->assertInstanceOf('core_kernel_persistence_Exception', $e);
         $this->assertEquals("parameter 'last' for getOnePropertyValue no longer supported", $e->getMessage());
     }
     // We now go multilingual.
     $session->setDataLanguage('FR');
     $instance->setPropertyValue($seeAlso, 'plopFR');
     $one = $instance->getPropertyValuesByLg($seeAlso, 'FR');
     // Back to default language.
     $session->setDataLanguage(DEFAULT_LANG);
     $seeAlso->delete();
     $instance->delete(true);
 }
예제 #13
0
 /**
  *
  * @author Lionel Lecaque, lionel@taotesting.com
  */
 public function testGetIterator()
 {
     $dir = GenerisPhpUnitTestRunner::getSampleDir();
     $rdf = new FileRdf($dir . '/rdf/sample.rdf');
     $this->assertInstanceOf('oat\\generis\\model\\kernel\\persistence\\file\\FileIterator', $rdf->getIterator());
 }
 public function after($pMethode)
 {
     common_Logger::i('Cleaning up class ' . $this->class->getUri() . ' for Create instance Tests');
     $this->class->delete();
     parent::after($pMethode);
 }
예제 #15
0
 /**
  * Make test case initializations
  * @see SimpleTestCase::setUp()
  */
 protected function setUp()
 {
     GenerisPhpUnitTestRunner::initTest();
     $this->installExtension('generisHard');
 }
예제 #16
0
 /**
  * 
  * @see PHPUnit_Framework_TestCase::setUp()
  */
 public function setUp()
 {
     GenerisPhpUnitTestRunner::initTest();
     $this->prophet = new Prophet();
 }
예제 #17
0
 /**
  *
  * @author Lionel Lecaque, lionel@taotesting.com
  * @return array
  */
 public function modelProvider()
 {
     $dir = GenerisPhpUnitTestRunner::getSampleDir();
     return array(array(6, $dir . '/rdf/generis.rdf'), array(4, $dir . '/rdf/widget.rdf'), array(100, $dir . '/rdf/nobase.rdf'));
 }
예제 #18
0
 public function setUp()
 {
     GenerisPhpUnitTestRunner::initTest();
 }
예제 #19
0
 /**
  * 
  * @author Lionel Lecaque, lionel@taotesting.com
  */
 public function setUp()
 {
     GenerisPhpUnitTestRunner::initTest();
     $this->object = new core_kernel_classes_Property(PROPERTY_WIDGET);
 }