/** * This function starts the Slim framework by calling it's run() method. */ public function run() { $responseOutputWriter =& $this->_hook->getResponseOutputWriter(); // define index endpoint $indexEndpoint = new SlimBootstrap\Endpoint\Index($this->_collectionEndpoints); $this->_app->get('/', function () use(&$responseOutputWriter, $indexEndpoint) { $responseOutputWriter->write($indexEndpoint->get()); })->name('index'); // define info endpoint $infoEndpoint = new SlimBootstrap\Endpoint\Info(); $this->_app->get('/info', function () use(&$responseOutputWriter, $infoEndpoint) { $responseOutputWriter->write($infoEndpoint->get()); })->name('info'); $this->_app->run(); }
/** * @param array $data * @param DataObject $result * * @dataProvider getProvider */ public function testGet(array $data, DataObject $result) { $this->_candidate = new Index($data); $actual = $this->_candidate->get(); $this->assertEquals($result, $actual); }