php - "Resource access layer" below REST -


i have legacy code restful web application - happens in php slim framework - routes typcially written in form:

$app->get('/timesheet/edit/:timesheetid', function($timesheetid) use($app)   {     // route implementation     // .     // .     // .     $app->render('template.html', array('obj' => stuff)); }); 

i preparing code testing phpunit/dbunit, , want test routes: don't want test firing slim route itself, want wrap route implementations functions job convert array of or post parameters object or objects rendering , assert the objects against literal objects in test cases, or data xml files or whatever works best in each case.

why not test routes shown here test rest request? because don't want test whole response understand contain html, want assertequals 'stuff' array.

my question this: how should such functions organized - not global functions, because discouraged, fit objects? there such thing resource layer? wanted ask collective before go , re-invent wheel - have feeling there pseudo-design-pattern cover situation!


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

angular - Copying node modules to wwwroot AspNetCore -