Example #1
0
 public function testOpenLegalFileShouldReturnSheetWithRootTopic()
 {
     $package = new Package(__DIR__ . '/../res/cr.xmind');
     $rootTopic = $package->getSheet(0)->getRootTopic();
     $this->assertInstanceOf('Chub\\XMindPHP\\RootTopic', $rootTopic);
     $this->assertInstanceOf('Chub\\XMindPHP\\Topic', $rootTopic);
 }
Example #2
0
 public function testIterator()
 {
     $package = new Package(__DIR__ . '/../res/sheets.xmind');
     $it = $package->getSheetsIterator();
     $this->assertInstanceOf('ArrayIterator', $it);
     $this->assertEquals(2, $it->count());
     $sheet1 = $it->current();
     $it->next();
     $sheet2 = $it->current();
     $this->assertEquals('testSheet1', $sheet1->getTitle());
     $this->assertEquals('testSheet2', $sheet2->getTitle());
     $this->assertEquals('test', $sheet1->getRootTopic()->getTitle());
     $this->assertEquals('test2', $sheet2->getRootTopic()->getTitle());
 }
Example #3
0
 protected function setUp()
 {
     $package = new Package(__DIR__ . '/../res/cr.xmind');
     $this->rootTopic = $package->getSheet(0)->getRootTopic();
     $this->assertInstanceOf('Chub\\XMindPHP\\RootTopic', $this->rootTopic);
 }