From 0d59e5a91c04d44f2ce11c3e2597289178f75179 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Thu, 7 Jan 2016 16:14:12 +0900 Subject: [PATCH 1/6] use Fake prefix for fake --- src/Module/Constant/NamedModule.php | 2 ++ tests/Fake/FakeApplication.php | 30 ++++++++++++++++++++++ tests/Module/Constant/NamedModuleTest.php | 31 +++-------------------- 3 files changed, 35 insertions(+), 28 deletions(-) create mode 100644 tests/Fake/FakeApplication.php diff --git a/src/Module/Constant/NamedModule.php b/src/Module/Constant/NamedModule.php index 2b1012b7..c7ef0482 100644 --- a/src/Module/Constant/NamedModule.php +++ b/src/Module/Constant/NamedModule.php @@ -6,6 +6,7 @@ */ namespace BEAR\Sunday\Module\Constant; +use BEAR\Sunday\FakeApplication; use Ray\Di\AbstractModule; class NamedModule extends AbstractModule @@ -29,6 +30,7 @@ public function __construct(array $names) */ protected function configure() { + $this->bind(FakeApplication::class); foreach ($this->names as $annotatedWith => $instance) { $this->bind()->annotatedWith($annotatedWith)->toInstance($instance); } diff --git a/tests/Fake/FakeApplication.php b/tests/Fake/FakeApplication.php new file mode 100644 index 00000000..b33877d5 --- /dev/null +++ b/tests/Fake/FakeApplication.php @@ -0,0 +1,30 @@ +dir = $dir; + } + + /** + * @Inject + * @Named("id") + */ + public function setId($id) + { + $this->id = $id; + } +} diff --git a/tests/Module/Constant/NamedModuleTest.php b/tests/Module/Constant/NamedModuleTest.php index 31deb2a3..8260193a 100644 --- a/tests/Module/Constant/NamedModuleTest.php +++ b/tests/Module/Constant/NamedModuleTest.php @@ -2,38 +2,13 @@ namespace BEAR\Sunday\Module\Constant; -use Ray\Di\Di\Inject; -use Ray\Di\Di\Named; use Ray\Di\Injector; - -class Application -{ - public $dir; - public $id; - - /** - * @Inject - * @Named("path") - */ - public function setPath($dir) - { - $this->dir = $dir; - } - - /** - * @Inject - * @Named("id") - */ - public function setId($id) - { - $this->id = $id; - } -} +use BEAR\Sunday\FakeApplication; class ConstantModuleTest extends \PHPUnit_Framework_TestCase { /** - * @var Application + * @var FakeApplication */ private $app; @@ -43,7 +18,7 @@ protected function setUp() 'path' => __DIR__, 'id' => 'bear' ]; - $this->app = (new Injector(new NamedModule($names)))->getInstance(__NAMESPACE__ .'\Application'); + $this->app = (new Injector(new NamedModule($names)))->getInstance(FakeApplication::class); } public function testNamed() From 6ff4957b8ed0514e869e1fad7ac18d2a9d0a358e Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Thu, 7 Jan 2016 16:14:30 +0900 Subject: [PATCH 2/6] update meta files --- phpcs.xml | 14 +++++++--- phpmd.xml | 76 +++++++++++++++++++++++++++++++------------------------ 2 files changed, 53 insertions(+), 37 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index 330a3060..23064b67 100755 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,19 +1,25 @@ - - The BEAR coding standard. - + + The coding standard used for applications using BEAR.Sunday Framework. + - + + + + + + src + tests diff --git a/phpmd.xml b/phpmd.xml index 0412e29f..d33710cd 100644 --- a/phpmd.xml +++ b/phpmd.xml @@ -1,40 +1,50 @@ - + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + - - + + - - - - + + + + - - - - - - + + + - - + + From ae9bec44a2488daec9a966c4cbbb3197491cb2ea Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Thu, 7 Jan 2016 16:14:55 +0900 Subject: [PATCH 3/6] soothe phpcs --- src/Provide/Transfer/HttpResponder.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Provide/Transfer/HttpResponder.php b/src/Provide/Transfer/HttpResponder.php index cd37db36..5d5a282e 100644 --- a/src/Provide/Transfer/HttpResponder.php +++ b/src/Provide/Transfer/HttpResponder.php @@ -16,6 +16,7 @@ class HttpResponder implements TransferInterface */ public function __invoke(ResourceObject $resourceObject, array $server) { + unset($server); // render $body = (string) $resourceObject; From 5a99ffb6ea208e4a2b929b6f95f367fd54b5ed50 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Thu, 7 Jan 2016 16:15:20 +0900 Subject: [PATCH 4/6] year 2016 --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 68d83e47..5200beeb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2012-2015, Akihito Koriyama +Copyright (c) 2012-2016, Akihito Koriyama All rights reserved. Redistribution and use in source and binary forms, with or without From 47f626016759f29ec4f60a429e5e5ad5c81358ba Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Thu, 7 Jan 2016 16:27:37 +0900 Subject: [PATCH 5/6] update .travis.yml --- .travis.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 23cf9fe5..b3985e42 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,15 @@ +sudo: false language: php - php: - 5.5 - 5.6 - hhvm - 7 - -install: travis_retry composer install --no-interaction --prefer-source - +before_script: + - composer self-update + - composer install script: - - if [ "$TRAVIS_PHP_VERSION" == "hhvm" ]; then phpunit; fi - - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then phpunit --coverage-text --coverage-clover=coverage.clover; fi - + - phpunit --coverage-clover=coverage.clover after_script: - - wget https://scrutinizer-ci.com/ocular.phar - - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi + - wget https://scrutinizer-ci.com/ocular.phar + - php ocular.phar code-coverage:upload --format=php-clover coverage.clover From 6b5fc686f36321c89acd3d2cc7ea1d859b62181e Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Thu, 7 Jan 2016 17:48:41 +0900 Subject: [PATCH 6/6] remove unsupported phpcs rule --- phpcs.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index 23064b67..4c9e459e 100755 --- a/phpcs.xml +++ b/phpcs.xml @@ -9,7 +9,6 @@ -