2 require_once('../simpletest/unit_tester.php');
3 require_once('../simpletest/reporter.php');
4 require_once("CiteData.php");
5 class TestData
extends UnitTestCase
{
7 function testLoadData(){
9 array("type"=>"author","value"=>array("first"=>"Jan","last"=>"Krka")),
10 array("type"=>"author","value"=>array("first"=>"Martin","last"=>"Bla¾ek")),
11 array("type"=>"author","value"=>array("first"=>"Pepa","last"=>"Nosek")),
12 array("type"=>"author","value"=>array("first"=>"Jirka","last"=>"Cicek")),
13 array("type"=>"author","value"=>array("first"=>"Martin","last"=>"Bla¾ek")),
14 array("type"=>"title","value"=>"Titulek knihy"),
15 array("type"=>"date","value"=>"2009"),
16 array("type"=>"publisher","value"=>"Academia")
18 $p=Data
::getInstance()->loadData($data);
19 $this->assertEqual($p->getField("title"),"Titulek knihy");
22 function testSingletonData(){
23 $this->assertEqual(Data
::getInstance()->getField("title"),"Titulek knihy");
27 class TestOutput
extends UnitTestCase
{
31 $test = new TestData();
32 $test->run(new HtmlReporter())