diff --git a/.travis.yml b/.travis.yml index ba82557..c61b656 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ matrix: env: - CS_CHECK=true - php: 7.1 - - php: hhvm + - php: hhvm allow_failures: - php: hhvm @@ -25,13 +25,14 @@ before_install: - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi - composer self-update - if [[ $TEST_COVERAGE == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls:^1.0 ; fi + - if [[ $TEST_COVERAGE == 'true' ]]; then composer require --dev --no-update michaelmoussa/php-coverage-checker:^1.1.0 ; fi install: - travis_retry composer install --no-interaction - composer info -i script: - - if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi + - if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage && vendor/bin/php-coverage-checker clover.xml 100 ; else composer test ; fi - if [[ $CS_CHECK == 'true' ]]; then composer cs ; fi - if [[ $CS_CHECK == 'true' ]]; then composer license-check ; fi diff --git a/CHANGELOG.md b/CHANGELOG.md index ab3a6e1..1721043 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. -## 2.0.0 - TBD +## 2.0.0 - 2016-12-?? ### Added @@ -15,7 +15,7 @@ All notable changes to this project will be documented in this file, in reverse ### Removed -- Nothing. +- Removed `RouteResultObserverInterface` and `RouteResultSubjectInterface`, as they were deprecated in 1.2.0. ### Fixed diff --git a/composer.json b/composer.json index 48870ae..150360f 100644 --- a/composer.json +++ b/composer.json @@ -12,8 +12,8 @@ ], "extra": { "branch-alias": { - "dev-master": "1.3.x-dev", - "dev-develop": "2.0.x-dev" + "dev-master": "2.0-dev", + "dev-develop": "2.1-dev" } }, "require": { diff --git a/src/RouteResult.php b/src/RouteResult.php index 9e087ec..f6cf668 100644 --- a/src/RouteResult.php +++ b/src/RouteResult.php @@ -78,26 +78,6 @@ public static function fromRoute(Route $route, array $params = []) return $result; } - /** - * Create an instance repesenting a route success. - * - * @deprecated since 1.3.0; will be removed in 2.0.0. - * @param string $name Name of matched route. - * @param callable|string $middleware Middleware associated with the - * matched route. - * @param array $params Parameters associated with the matched route. - * @return static - */ - public static function fromRouteMatch($name, $middleware, array $params) - { - $result = new self(); - $result->success = true; - $result->matchedRouteName = $name; - $result->matchedMiddleware = $middleware; - $result->matchedParams = $params; - return $result; - } - /** * Create an instance representing a route failure. * diff --git a/test/RouteResultTest.php b/test/RouteResultTest.php index dd84f06..0134517 100644 --- a/test/RouteResultTest.php +++ b/test/RouteResultTest.php @@ -24,34 +24,12 @@ public function setUp() }; } - public function testRouteMiddlewareIsRetrievable() - { - $result = RouteResult::fromRouteMatch( - '/foo', - $this->middleware, - [], - '/foo' - ); - $this->assertSame($this->middleware, $result->getMatchedMiddleware()); - } - public function testRouteMiddlewareIsNotRetrievable() { $result = RouteResult::fromRouteFailure(); $this->assertFalse($result->getMatchedMiddleware()); } - public function testRouteRouteNameIsRetrievable() - { - $result = RouteResult::fromRouteMatch( - '/foo', - $this->middleware, - [], - '/foo' - ); - $this->assertEquals('/foo', $result->getMatchedRouteName()); - } - public function testRouteNameIsNotRetrievable() { $result = RouteResult::fromRouteFailure(); @@ -70,26 +48,12 @@ public function testRouteFailureRetrieveHttpMethods() $this->assertSame([], $result->getAllowedMethods()); } - public function testRouteRetrieveHttpMethods() - { - $result = RouteResult::fromRouteMatch( - '/foo', - $this->middleware, - [], - '/foo' - ); - $this->assertSame([], $result->getAllowedMethods()); - } - public function testRouteMatchedParams() { $params = ['foo' => 'bar']; - $result = RouteResult::fromRouteMatch( - '/foo', - $this->middleware, - $params, - '/foo' - ); + $route = $this->prophesize(Route::class); + $result = RouteResult::fromRoute($route->reveal(), $params); + $this->assertSame($params, $result->getMatchedParams()); } @@ -102,12 +66,9 @@ public function testRouteMethodFailure() public function testRouteSuccessMethodFailure() { $params = ['foo' => 'bar']; - $result = RouteResult::fromRouteMatch( - '/foo', - $this->middleware, - $params, - '/foo' - ); + $route = $this->prophesize(Route::class); + $result = RouteResult::fromRoute($route->reveal(), $params); + $this->assertFalse($result->isMethodFailure()); }