public function testCompositorWithUrlMap() { $compositor = new Compositor(); $compositor->app(MuxApp::mountWithUrlMap(["/foo" => ['ProductController', 'fooAction'], "/bar" => ['ProductController', 'barAction']])); $app = $compositor->wrap(); $this->assertInstanceOf('Pux\\App\\MuxApp', $app, 'When there is only one app and no middleware, the returned type should be just MuxApp'); $env = Utils::createEnv('GET', '/foo'); $response = $app($env, []); $this->assertNotEmpty($response); $this->assertEquals('foo', $response); }
public function testMuxApp() { $app = MuxApp::mountWithUrlMap(["/foo" => ['ProductController', 'fooAction'], "/bar" => ['ProductController', 'barAction']]); $this->assertNotNull($app); $this->assertInstanceOf('Pux\\App\\MuxApp', $app); }