coduo / TuTu

Flexible HTTP server mocking tool in PHP. TuTu can work with built-in php server so everything that you need to use is php.
MIT License
58 stars 10 forks source link

Integration with HttpKernelInterface based frameworks. #2

Closed defrag closed 9 years ago

defrag commented 10 years ago

While this solutions is nice, sometimes i would not like to start another process for stub api. If we extract src/ into TuTu code, we can use stack php url map and make it available in app_test.php for example with Symfony, Laravel etc. This is content from app_test.php which i have run tests from just now. Works fine.

$container = new Pimple\Container();
$container['tutu.root_path'] = realpath(__DIR__ . '/..');
$tutu = new Coduo\TuTu\Kernel($container);

$map = ["/stub/api" => $tutu];

$kernel = new AppKernel('test', true);
$kernel->loadClassCache();
$kernel = (new Stack\Builder())
    ->push('Stack\UrlMap', $map)
    ->resolve($kernel)
;

$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
norberttech commented 10 years ago

We can create coduo/tutu-kernel package for that.

defrag commented 10 years ago

Yep, that would be nice. Simple change, but thata would allow nice flexibility.

norberttech commented 10 years ago

Or we can rename this repo into coduo/tutu-standalone and extract src into coduo/tutu

defrag commented 10 years ago

I would say tutu-kernel or tutu-core is fine and lets leave the app as TuTu :)

norberttech commented 9 years ago

I guess this issue can be finally closed thanks to https://github.com/coduo/tutu-core