예제 #1
0
 public function testGetValue()
 {
     $obj = new ExportData();
     $obj->add('Name', 'Aaron')->add('Age', 39)->next();
     $obj->add('Name', 'Hillary')->add('Age', 37)->next();
     $obj->add('Name', 'Maia')->add('Age', 7)->next();
     $obj->setPage(1);
     $obj->add('Color', 'Black')->add('Make', 'Subaru')->next();
     $obj->add('Color', 'White')->add('Make', 'Hyundai')->next();
     $return = $obj->setPage(0)->setPointer(0)->getValue('Age');
     $this->assertSame(39, $return);
     $return = $obj->setPage(0)->getValue('Name');
     $this->assertSame('Aaron', $return);
     $return = $obj->setPage(1)->setPointer(0)->getValue('Color');
     $this->assertSame('Black', $return);
     $return = $obj->getValue('Make');
     $this->assertSame('Subaru', $return);
 }