From d10c20c62fba1e355ea69fdfca605efa963a48e6 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 29 Apr 2015 23:43:35 +0900 Subject: [PATCH 1/2] cleanup --- .../tests/Resource/Page/IndexTest.php | 2 -- src/Provide/Transfer/HttpResponderModule.php | 2 +- tests/multiple_apps_Test.php | 28 ------------------- 3 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 tests/multiple_apps_Test.php diff --git a/docs/demo/MyVendor.Helloworld/tests/Resource/Page/IndexTest.php b/docs/demo/MyVendor.Helloworld/tests/Resource/Page/IndexTest.php index ac7d8f05..34b09067 100644 --- a/docs/demo/MyVendor.Helloworld/tests/Resource/Page/IndexTest.php +++ b/docs/demo/MyVendor.Helloworld/tests/Resource/Page/IndexTest.php @@ -3,8 +3,6 @@ namespace MyVendor\HelloWorld\Resource\Page; use BEAR\Resource\ResourceInterface; -use BEAR\Resource\ResourceObject; -use BEAR\Sunday\Extension\Application\AppInterface; use MyVendor\HelloWorld\AppModule; use Ray\Di\Injector; diff --git a/src/Provide/Transfer/HttpResponderModule.php b/src/Provide/Transfer/HttpResponderModule.php index 0315244e..9d7667f2 100644 --- a/src/Provide/Transfer/HttpResponderModule.php +++ b/src/Provide/Transfer/HttpResponderModule.php @@ -1,6 +1,6 @@ resource = (new Injector(new AppModule, $_ENV['TMP_DIR']))->getInstance(ResourceInterface::class); - } - - public function testMultipleHostInOneApplication() - { - $greeting = $this->resource->get->uri('app://self/greeting')->eager->request(); - $this->assertSame('hello world', $greeting->body['hello']); - $this->assertInstanceOf(Request::class, $greeting->body['hello_rel']); - } -} From bd675132778c36079843efcf7fa17401aaa1c5c0 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 29 Apr 2015 23:44:52 +0900 Subject: [PATCH 2/2] bind JsonRenderer in singleton --- src/Provide/Representation/RepresentationModule.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Provide/Representation/RepresentationModule.php b/src/Provide/Representation/RepresentationModule.php index 8dbf7524..cc8c6f45 100644 --- a/src/Provide/Representation/RepresentationModule.php +++ b/src/Provide/Representation/RepresentationModule.php @@ -9,6 +9,7 @@ use BEAR\Resource\JsonRenderer; use BEAR\Resource\RenderInterface; use Ray\Di\AbstractModule; +use Ray\Di\Scope; class RepresentationModule extends AbstractModule { @@ -17,6 +18,6 @@ class RepresentationModule extends AbstractModule */ protected function configure() { - $this->bind(RenderInterface::class)->to(JsonRenderer::class); + $this->bind(RenderInterface::class)->to(JsonRenderer::class)->in(Scope::SINGLETON); } }