public function testKeys() { /** * Assert setting the keys as an array populates the first row */ $_control_group = 'ExportData::setKeys'; // Desired test result $control = array('do', 're', 'mi', 'fa'); // The test and result $object = new ExportData(); $return = $object->setKeys($control); $object->add('do', 'C'); $return = $object->getCurrent(); $result = array_keys($return); $this->assertIdentical($control, $result, "Assert setting the keys populates the first row", $_control_group); // END ASSERT /** * Assert setting the keys as arguments populates the first row */ $_control_group = 'ExportData::setKeys'; // Desired test result $control = array('do', 're', 'mi', 'fa'); // The test and result $object = new ExportData(); $return = $object->setKeys('do', 're', 'mi', 'fa'); $object->add('mi', 'E'); $return = $object->getCurrent(); $result = array_keys($return); $this->assertIdentical($control, $result, "Assert setting the keys populates the first row", $_control_group); // Assert setting the keys after data exists modifies the order of data returned by get $control = array('fa', 'mi', 're', 'do'); $object->setKeys($control); $return = $object->getCurrent(); $result = array_keys($return); $this->assertIdentical($control, $result, "Assert setting the keys after data exists modifies the order of data returned by get", $_control_group); // Assert getCurrentPageId $control = 0; $result = $object->getCurrentPageId(); $this->assertIdentical($control, $result, "Assert getCurrentPageId", $_control_group); // Assert get current page id returns after switching pages $control = 'my_next_page'; $object->setPage($control); $result = $object->getCurrentPageId(); $this->assertIdentical($control, $result, "Assert get current page id returns after switching pages", $_control_group); // END ASSERT }