ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMDTest Class Reference

Unit tests for tree table. More...

+ Inheritance diagram for ilMDTest:
+ Collaboration diagram for ilMDTest:

Public Member Functions

 testCopyright ()
 testAnnotation ()
 test annotation
 testClassification ()
 test classification
 testContribute ()
 test contribute
 testDescription ()
 test Description
 testEducational ()
 test Educational
 testEntity ()
 test Entity
 testFormat ()
 test Format
 testGeneral ()
 test General
 testIdentifier ()
 test Identifier
 testIdentifier_ ()
 test Identifier_
 testKeyword ()
 test Keyword
 testLanguage ()
 test Language
 testLifecycle ()
 test lifecycle
 testLocation ()
 test Location
 testMetaMetadata ()
 test MetaData
 testRelation ()
 test MetaData
 testRequirement ()
 test MetaData
 testRights ()
 test MetaData
 testTaxon ()
 test MetaData
 testTaxonPath ()
 test MetaData
 testTechnical ()
 test MetaData
 testTypicalAgeRange ()
 test MetaData

Protected Member Functions

 setUp ()

Protected Attributes

 $backupGlobals = FALSE

Detailed Description

Unit tests for tree table.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 33 of file ilMDTest.php.

Member Function Documentation

ilMDTest::setUp ( )
protected

Definition at line 37 of file ilMDTest.php.

References ilUnitUtil\performInitialisation().

{
include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
}

+ Here is the call graph for this function:

ilMDTest::testAnnotation ( )

test annotation

Parameters
@return

Definition at line 88 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDAnnotation.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$ann = new ilMDAnnotation(1,2,'xxx');
$ann->setDescription("desc");
$ann->setDescriptionLanguage(new ilMDLanguageItem('en'));
$ann->setEntity('ent');
$ann->setDate('date');
$ret = $ann->save();
$this->assertGreaterThan(0,$ret);
$ann->setDescription('desc2');
$ann->update();
$ann->read();
$desc = $ann->getDescription();
$this->assertEquals('desc2',$desc);
$ann->delete();
}
ilMDTest::testClassification ( )

test classification

Parameters
@return

Definition at line 115 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDClassification.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$ann = new ilMDClassification(1,2,'xxx');
$ann->setDescription("desc");
$ann->setDescriptionLanguage(new ilMDLanguageItem('en'));
$ann->setPurpose('purp');
$ret = $ann->save();
$this->assertGreaterThan(0,$ret);
$ann->setDescription('desc2');
$ann->update();
$ann->read();
$desc = $ann->getDescription();
$this->assertEquals('desc2',$desc);
$ann->delete();
}
ilMDTest::testContribute ( )

test contribute

Returns

Definition at line 140 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDContribute.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDContribute(1,2,'xxx');
$con->setDate('date');
$con->setRole('ScriptWriter');
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setDate('desc2');
$con->update();
$con->read();
$desc = $con->getDate();
$this->assertEquals('desc2',$desc);
$con->delete();
}
ilMDTest::testCopyright ( )
Parameters
@return

Definition at line 48 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php';
$cpr->setTitle("1");
$cpr->setDescription("2");
$cpr->setLanguage('en');
$cpr->setCopyright("3");
$cpr->setCosts(true);
$cpr->add();
$entry = $cpr->getEntryId();
$this->assertGreaterThan(0,$entry);
$cpr = new ilMDCopyrightSelectionEntry($entry);
$ret = $cpr->getTitle();
$this->assertEquals($ret,'1');
$ret = $cpr->getDescription();
$this->assertEquals($ret,'2');
$ret = $cpr->getCopyright();
$this->assertEquals($ret,'3');
$ret = $cpr->getLanguage();
$this->assertEquals($ret,'en');
$cpr->setTitle('11');
$cpr->update();
$cpr->delete();
}
ilMDTest::testDescription ( )

test Description

Returns

Definition at line 164 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDDescription.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDDescription(1,2,'xxx');
$con->setDescription('date');
$con->setDescriptionLanguage(new ilMDLanguageItem('en'));
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setDescription('desc2');
$con->update();
$con->read();
$desc = $con->getDescription();
$this->assertEquals('desc2',$desc);
$con->delete();
}
ilMDTest::testEducational ( )

test Educational

Returns

Definition at line 188 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDEducational.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDEducational(1,2,'xxx');
$con->setDifficulty('Easy');
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setDifficulty('Medium');
$con->update();
$con->read();
$desc = $con->getDifficulty();
$this->assertEquals('Medium',$desc);
$con->delete();
}
ilMDTest::testEntity ( )

test Entity

Returns

Definition at line 211 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDEntity.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDEntity(1,2,'xxx');
$con->setEntity('Easy');
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setEntity('Medium');
$con->update();
$con->read();
$desc = $con->getEntity();
$this->assertEquals('Medium',$desc);
$con->delete();
}
ilMDTest::testFormat ( )

test Format

Returns

Definition at line 234 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDFormat.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDFormat(1,2,'xxx');
$con->setFormat('Easy');
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setFormat('Medium');
$con->update();
$con->read();
$desc = $con->getFormat();
$this->assertEquals('Medium',$desc);
$con->delete();
}
ilMDTest::testGeneral ( )

test General

Returns

Definition at line 257 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDGeneral.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDGeneral(1,2,'xxx');
$con->setCoverage('Easy');
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setCoverage('Medium');
$con->update();
$con->read();
$desc = $con->getCoverage();
$this->assertEquals('Medium',$desc);
$con->delete();
}
ilMDTest::testIdentifier ( )

test Identifier

Returns

Definition at line 280 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDIdentifier.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDIdentifier(1,2,'xxx');
$con->setCatalog('Easy');
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setCatalog('Medium');
$con->update();
$con->read();
$desc = $con->getCatalog();
$this->assertEquals('Medium',$desc);
$con->delete();
}
ilMDTest::testIdentifier_ ( )

test Identifier_

Returns

Definition at line 303 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDIdentifier_.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDIdentifier_(1,2,'xxx');
$con->setCatalog('Easy');
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setCatalog('Medium');
$con->update();
$con->read();
$desc = $con->getCatalog();
$this->assertEquals('Medium',$desc);
$con->delete();
}
ilMDTest::testKeyword ( )

test Keyword

Returns

Definition at line 326 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDKeyword.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDKeyword(1,2,'xxx');
$con->setKeyword('Easy');
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setKeyword('Medium');
$con->update();
$con->read();
$desc = $con->getKeyword();
$this->assertEquals('Medium',$desc);
$con->delete();
}
ilMDTest::testLanguage ( )

test Language

Returns

Definition at line 349 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDLanguage.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDLanguage(1,2,'xxx');
$con->setLanguage(new ilMDLanguageItem('en'));
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setLanguage(new ilMDLanguageItem('de'));
$con->update();
$con->read();
$desc = $con->getLanguageCode();
$this->assertEquals('de',$desc);
$con->delete();
}
ilMDTest::testLifecycle ( )

test lifecycle

Returns

Definition at line 372 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDLifecycle.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDLifecycle(1,2,'xxx');
$con->setVersion(1);
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setVersion(2);
$con->update();
$con->read();
$desc = $con->getVersion();
$this->assertEquals(2,$desc);
$con->delete();
}
ilMDTest::testLocation ( )

test Location

Returns

Definition at line 395 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDLocation.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDLocation(1,2,'xxx');
$con->setLocation(1);
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setLocation(2);
$con->update();
$con->read();
$desc = $con->getLocation();
$this->assertEquals(2,$desc);
$con->delete();
}
ilMDTest::testMetaMetadata ( )

test MetaData

Returns

Definition at line 418 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDMetaMetadata.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDMetaMetadata(1,2,'xxx');
$con->setMetaDataScheme(1);
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setMetaDataScheme(2);
$con->update();
$con->read();
$desc = $con->getMetaDataScheme();
$this->assertEquals('LOM v 1.0',$desc);
$con->delete();
}
ilMDTest::testRelation ( )

test MetaData

Returns

Definition at line 441 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDRelation.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDRelation(1,2,'xxx');
$con->setKind('IsVersionOf');
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setKind('HasVersion');
$con->update();
$con->read();
$desc = $con->getKind();
$this->assertEquals('HasVersion',$desc);
$con->delete();
}
ilMDTest::testRequirement ( )

test MetaData

Returns

Definition at line 464 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDRequirement.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDRequirement(1,2,'xxx');
$con->setBrowserName('Amaya');
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setBrowserName('Opera');
$con->update();
$con->read();
$desc = $con->getBrowserName();
$this->assertEquals('Opera',$desc);
$con->delete();
}
ilMDTest::testRights ( )

test MetaData

Returns

Definition at line 487 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDRights.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDRights(1,2,'xxx');
$con->setDescription('Amaya');
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setDescription('Opera');
$con->update();
$con->read();
$desc = $con->getDescription();
$this->assertEquals('Opera',$desc);
$con->delete();
}
ilMDTest::testTaxon ( )

test MetaData

Returns

Definition at line 510 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDTaxon.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDTaxon(1,2,'xxx');
$con->setTaxon('Amaya');
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setTaxon('Opera');
$con->update();
$con->read();
$desc = $con->getTaxon();
$this->assertEquals('Opera',$desc);
$con->delete();
}
ilMDTest::testTaxonPath ( )

test MetaData

Returns

Definition at line 533 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDTaxonPath.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDTaxonPath(1,2,'xxx');
$con->setSource('Amaya');
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setSource('Opera');
$con->update();
$con->read();
$desc = $con->getSource();
$this->assertEquals('Opera',$desc);
$con->delete();
}
ilMDTest::testTechnical ( )

test MetaData

Returns

Definition at line 556 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDTechnical.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDTechnical(1,2,'xxx');
$con->setSize('Amaya');
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setSize('Opera');
$con->update();
$con->read();
$desc = $con->getSize();
$this->assertEquals('Opera',$desc);
$con->delete();
}
ilMDTest::testTypicalAgeRange ( )

test MetaData

Returns

Definition at line 579 of file ilMDTest.php.

References $ret.

{
include_once './Services/MetaData/classes/class.ilMDTypicalAgeRange.php';
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
$con = new ilMDTypicalAgeRange(1,2,'xxx');
$con->setTypicalAgeRange('12-22');
$ret = $con->save();
$this->assertGreaterThan(0,$ret);
$con->setTypicalAgeRange('12-14');
$con->update();
$con->read();
$desc = $con->getTypicalAgeRange();
$this->assertEquals('12-14',$desc);
$con->delete();
}

Field Documentation

ilMDTest::$backupGlobals = FALSE
protected

Definition at line 35 of file ilMDTest.php.


The documentation for this class was generated from the following file: