public function testThrowsException() { try { Filter::filterString('test string', 'NonExistentFilter'); $this->assertTrue(false); } catch (Exception $e) { $this->assertTrue(true); } }
public function __construct(Request $request, Response $response) { $this->request = $request; $this->response = $response; // what controller be we talkin' about? $filtered = Filter::filterString($this->request->getController(), 'DashToCamelCase'); $this->config['controller_name'] = '\\App\\Controller\\' . ucwords($filtered) . 'Controller'; // whit be yer action ? $filtered = Filter::filterString($this->request->getAction(), 'DashToCamelCase'); $this->config['action_name'] = $filtered . 'Action'; $this->config['controller'] = $this->request->getController(); $this->config['action'] = $this->request->getAction(); }