ILIAS  Release_5_0_x_branch Revision 61816
 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 ()
 IL_Init
 testAnnotation ()
 test annotation IL_Init
 testClassification ()
 test classification IL_Init
 testContribute ()
 test contribute IL_Init
 testDescription ()
 test Description IL_Init
 testEducational ()
 test Educational IL_Init
 testEntity ()
 test Entity IL_Init
 testFormat ()
 test Format IL_Init
 testGeneral ()
 test General IL_Init
 testIdentifier ()
 test Identifier IL_Init
 testIdentifier_ ()
 test Identifier_ IL_Init
 testKeyword ()
 test Keyword IL_Init
 testLanguage ()
 test Language IL_Init
 testLifecycle ()
 test lifecycle IL_Init
 testLocation ()
 test Location IL_Init
 testMetaMetadata ()
 test MetaData IL_Init
 testRelation ()
 test MetaData IL_Init
 testRequirement ()
 test MetaData IL_Init
 testRights ()
 test MetaData IL_Init
 testTaxon ()
 test MetaData IL_Init
 testTaxonPath ()
 test MetaData IL_Init
 testTechnical ()
 test MetaData IL_Init
 testTypicalAgeRange ()
 test MetaData IL_Init

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.

{
include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
ilUnitUtil::performInitialisation();
}
ilMDTest::testAnnotation ( )

test annotation IL_Init

Parameters
@return

Definition at line 89 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 IL_Init

Parameters
@return

Definition at line 117 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 IL_Init

Returns

Definition at line 143 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 ( )

IL_Init

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 IL_Init

Returns

Definition at line 168 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 IL_Init

Returns

Definition at line 193 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 IL_Init

Returns

Definition at line 217 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 IL_Init

Returns

Definition at line 241 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 IL_Init

Returns

Definition at line 265 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 IL_Init

Returns

Definition at line 289 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_ IL_Init

Returns

Definition at line 313 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 IL_Init

Returns

Definition at line 337 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 IL_Init

Returns

Definition at line 361 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 IL_Init

Returns

Definition at line 385 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 IL_Init

Returns

Definition at line 409 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 IL_Init

Returns

Definition at line 433 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 IL_Init

Returns

Definition at line 457 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 IL_Init

Returns

Definition at line 481 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 IL_Init

Returns

Definition at line 505 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 IL_Init

Returns

Definition at line 529 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 IL_Init

Returns

Definition at line 553 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 IL_Init

Returns

Definition at line 577 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 IL_Init

Returns

Definition at line 601 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: