public function testSaveAndLoad() { $_SESSION['USER'] = new Person($this->testPersonId); $bookmark = new Bookmark(); $bookmark->setRequestUri('/test'); $bookmark->save(); $id = $bookmark->getId(); $this->assertNotEmpty($id); $bookmark = new Bookmark($id); $this->assertEquals($this->testPersonId, $bookmark->getPerson_id()); $this->assertEquals('/test', $bookmark->getRequestUri()); }
public function delete() { try { $bookmark = new Bookmark($_REQUEST['bookmark_id']); $bookmark->delete(); } catch (\Exception $e) { $_SESSION['errorMessages'][] = $e; } $return_url = !empty($_REQUEST['return_url']) ? $_REQUEST['return_url'] : BASE_URL . '/bookmarks'; header("Location: {$return_url}"); exit; }