addTestData( $tree ); $visitor = new ezcTreeVisitorYUI(); $tree->accept( $visitor ); $expected = <<
END; self::assertSame( $expected, $visitor->__toString() ); } public function testVisitorYUIDisplayRootNode() { $tree = ezcTreeMemory::create( new ezcTreeMemoryDataStore() ); $this->addTestData( $tree ); $visitor = new ezcTreeVisitorYUI(); $visitor->options->displayRootNode = true; $tree->accept( $visitor ); $expected = << END; self::assertSame( $expected, $visitor->__toString() ); } public function testVisitorYUISelectedNodeLink1() { $tree = ezcTreeMemory::create( new ezcTreeMemoryDataStore() ); $this->addTestData( $tree ); $visitor = new ezcTreeVisitorYUI(); $visitor->options->selectedNodeLink = true; $tree->accept( $visitor ); $expected = << END; self::assertSame( $expected, $visitor->__toString() ); } public function testVisitorYUISelectedNodeLink2() { $tree = ezcTreeMemory::create( new ezcTreeMemoryDataStore() ); $this->addTestData( $tree ); $visitor = new ezcTreeVisitorYUI(); $visitor->options->displayRootNode = true; $visitor->options->selectedNodeLink = true; $tree->accept( $visitor ); $expected = << END; self::assertSame( $expected, $visitor->__toString() ); } public function testVisitorYUISelectedNodeLink3() { $tree = ezcTreeMemory::create( new ezcTreeMemoryDataStore() ); $this->addTestData( $tree ); $visitor = new ezcTreeVisitorYUI(); $visitor->options->displayRootNode = true; $visitor->options->selectedNodeLink = true; $visitor->options->basePath = 'testing'; $tree->accept( $visitor ); $expected = << END; self::assertSame( $expected, $visitor->__toString() ); } public function testVisitorYUIXmlId() { $tree = ezcTreeMemory::create( new ezcTreeMemoryDataStore() ); $this->addTestData( $tree ); $visitor = new ezcTreeVisitorYUI(); $visitor->options->xmlId = 'productsandservices'; $tree->fetchNodeById( 'Hylobatidae' )->accept( $visitor ); $expected = << END; self::assertSame( $expected, $visitor->__toString() ); } public function testVisitorYUIHighlightNodes() { $tree = ezcTreeMemory::create( new ezcTreeMemoryDataStore() ); $this->addTestData( $tree ); $options = new ezcTreeVisitorYUIOptions; $options->highlightNodeIds = array( 'Nomascus', 'Eastern Black Crested Gibbon', 'Hoolock' ); $visitor = new ezcTreeVisitorYUI( $options ); $tree->fetchNodeById( 'Hylobatidae' )->accept( $visitor ); $expected = << END; self::assertSame( $expected, $visitor->__toString() ); } public static function suite() { return new PHPUnit_Framework_TestSuite( "ezcTreeVisitorYUITest" ); } } ?>