예제 #1
0
 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);
 }
예제 #2
0
파일: MuxAppTest.php 프로젝트: kpb90/Pux
 public function testMuxApp()
 {
     $app = MuxApp::mountWithUrlMap(["/foo" => ['ProductController', 'fooAction'], "/bar" => ['ProductController', 'barAction']]);
     $this->assertNotNull($app);
     $this->assertInstanceOf('Pux\\App\\MuxApp', $app);
 }