public function testPositioning() { $other_file = tempnam(sys_get_temp_dir() . 'tmp', 'history'); $el1 = $this->_history->append($other_file); $el2 = $this->_history->append($other_file); $el3 = $this->_history->append($other_file); $this->assertEquals(3, $this->_history->getCount()); $this->assertEquals($el3, $this->_history->getFirst()); $this->assertEquals($el1, $this->_history->getLast()); $this->assertEquals($el2, $this->_history->getNth(1)); $this->assertEquals($el1, $this->_history->getNext()); $this->assertFalse($this->_history->getNext()); unlink($other_file); }
/** * Create a history copy of the custom file that will be merged so that it can be access through * studio if admins wish to revert at a later date. * * @param STRING $module - name of the module * @param STRING $file - name of the file * @param STRING $customFile - Path to the custom file that will be merged */ protected function createHistoryLog($module, $customFile, $file) { $historyPath = 'custom/' . MB_HISTORYMETADATALOCATION . "/modules/{$module}/metadata/{$file}"; $history = new History($historyPath); $timeStamp = $history->append($customFile); $GLOBALS['log']->debug("Created history file after merge with new file: " . $historyPath . '_' . $timeStamp); }