コード例 #1
0
ファイル: MuxAppTest.php プロジェクト: phpsgi/funk
 public function testMuxApp()
 {
     $app = MuxApp::mountWithUrlMap(["/foo" => ['ProductController', 'fooAction'], "/bar" => ['ProductController', 'barAction']]);
     $this->assertNotNull($app);
     $this->assertInstanceOf('Funk\\App\\MuxApp', $app);
     $this->assertInstanceOf('PHPSGI\\App', $app, 'Must be an instanceof PHPSGI App');
 }
コード例 #2
0
ファイル: CompositorTest.php プロジェクト: phpsgi/funk
 public function testCompositorWithUrlMap()
 {
     $compositor = new Compositor();
     $compositor->app(MuxApp::mountWithUrlMap(["/foo" => ['ProductController', 'fooAction'], "/bar" => ['ProductController', 'barAction']]));
     $app = $compositor->wrap();
     $this->assertInstanceOf('Funk\\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);
 }