public function test_data()
 {
     $this->prepareLookup();
     $this->preparePages();
     $access = AccessTable::byTableName('dropdowns', 'test1');
     $data = $access->getData();
     $this->assertEquals('["1","[\\"title1\\",\\"This is a title\\"]"]', $data[0]->getValue());
     $this->assertEquals('["1","title1"]', $data[1]->getValue());
     $this->assertEquals('John', $data[2]->getValue());
     $this->assertEquals('1', $data[0]->getRawValue());
     $this->assertEquals('1', $data[1]->getRawValue());
     $this->assertEquals('John', $data[2]->getRawValue());
     $this->assertEquals('This is a title', $data[0]->getDisplayValue());
     $this->assertEquals('title1', $data[1]->getDisplayValue());
     $this->assertEquals('John', $data[2]->getDisplayValue());
     $R = new \Doku_Renderer_xhtml();
     $data[0]->render($R, 'xhtml');
     $pq = \phpQuery::newDocument($R->doc);
     $this->assertEquals('This is a title', $pq->find('a')->text());
     $this->assertContains('title1', $pq->find('a')->attr('href'));
     $R = new \Doku_Renderer_xhtml();
     $data[1]->render($R, 'xhtml');
     $pq = \phpQuery::newDocument($R->doc);
     $this->assertEquals('title1', $pq->find('a')->text());
     $this->assertContains('title1', $pq->find('a')->attr('href'));
     $R = new \Doku_Renderer_xhtml();
     $data[2]->render($R, 'xhtml');
     $this->assertEquals('John', $R->doc);
 }
 public function test_getDataFromDB_currentRev()
 {
     // act
     $schemaData = mock\AccessTable::byTableName('testtable', 'testpage');
     $actual_data = $schemaData->getDataFromDB();
     $expected_data = array(array('out1' => 'value1.1a' . Search::CONCAT_SEPARATOR . 'value1.2a', 'out2' => 'value2.1a' . Search::CONCAT_SEPARATOR . 'value2.2a', 'PID' => 'testpage'));
     $this->assertEquals($expected_data, $actual_data, '');
 }
 public function test_getData_clearData()
 {
     // act
     $schemaData = mock\AccessTable::byTableName('testtable', 'testpage', time());
     $schemaData->clearData();
     $actual_data = $schemaData->getData();
     // assert
     $this->assertEquals(array(), $actual_data[0]->getValue());
     $this->assertEquals(null, $actual_data[1]->getValue());
 }