public function testGetChangesRangeFailure() { $testData = [['id' => rand(1, 100), 'message' => 'test one'], ['id' => rand(101, 200), 'message' => 'test two']]; array_walk($testData, [$this, 'insertData']); $repository = new MysqlChangelogRepository(self::$connection); $data = $repository->getChanges(1, 3); $this->assertEmpty($data); $this->assertInternalType('array', $data); }
private function get_changelog() { global $container; $changelogRepository = new MysqlChangelogRepository($container['db_connection_locator']); $changelog_result = $changelogRepository->getChanges(40); foreach($changelog_result as $change) { $changelog[] = (object) array( 'date' => (object) array( 'stamp' => date('c', strtotime($change['datetime'])), 'short' => date('M j', strtotime($change['datetime'])), 'friendly' => date('F j, Y g:i A', strtotime($change['datetime']))), 'message' => $change['message_short']); } return array('changelog' => $changelog); }