/** * Manage the input. */ public function manageInput() { $method = filter_input(INPUT_SERVER, 'REQUEST_METHOD'); //TODO - violating DRY $input = $this->getInput(); //create if ($method === 'POST') { if (!empty($input)) { $this->persistenceModel->createRow($input); } } //read if ($method === 'GET') { } //update if ($method === 'PUT') { if (!empty($input)) { $this->persistenceModel->updateRow($input); } } //delete if ($method === 'DELETE') { $this->persistenceModel->deleteRow(); } $this->persistenceModel->output = $this->urlModel->main($this->table); }
public function testGetUrl() { $_SERVER['REQUEST_URI'] = '/'; $this->assertEquals('/', $this->urlModel->getUrl()); }