From d46660b13b132ba572f2fe1ca270265a503c4691 Mon Sep 17 00:00:00 2001 From: Aleksei Khudiakov Date: Sun, 10 Feb 2019 21:10:58 +1000 Subject: [PATCH 1/2] Force covers annotations --- phpunit.xml.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2cffbef67..c2897f45a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -2,6 +2,7 @@ From 8029bf7041e41a544b84c324763ed7d54f08762e Mon Sep 17 00:00:00 2001 From: Aleksei Khudiakov Date: Sun, 10 Feb 2019 21:24:01 +1000 Subject: [PATCH 2/2] Add @covers annotations to tests --- test/Application/AllowsReturningEarlyFromRoutingTest.php | 3 +++ test/Application/ControllerIsDispatchedTest.php | 3 +++ ...nsRaisedInDispatchableShouldRaiseDispatchErrorEventTest.php | 3 +++ ...ilityToRetrieveControllerShouldTriggerDispatchErrorTest.php | 3 +++ ...InabilityToRetrieveControllerShouldTriggerExceptionTest.php | 3 +++ test/Application/InitializationIntegrationTest.php | 3 +++ .../InvalidControllerTypeShouldTriggerDispatchErrorTest.php | 3 +++ test/Application/RoutingSuccessTest.php | 3 +++ test/ApplicationTest.php | 3 +++ test/Controller/ActionControllerTest.php | 3 +++ test/Controller/ControllerManagerTest.php | 3 +++ test/Controller/IntegrationTest.php | 3 +++ test/Controller/LazyControllerAbstractFactoryTest.php | 3 +++ test/Controller/Plugin/AcceptableViewModelSelectorTest.php | 3 +++ test/Controller/Plugin/ForwardTest.php | 3 +++ test/Controller/Plugin/LayoutTest.php | 3 +++ test/Controller/Plugin/ParamsTest.php | 3 +++ test/Controller/Plugin/RedirectTest.php | 3 +++ test/Controller/Plugin/UrlTest.php | 3 +++ test/Controller/PluginManagerTest.php | 3 +++ test/Controller/RestfulControllerTest.php | 3 +++ test/DispatchListenerTest.php | 3 +++ test/Exception/InvalidMiddlewareExceptionTest.php | 3 +++ test/Exception/ReachedFinalHandlerExceptionTest.php | 3 +++ test/MiddlewareListenerTest.php | 3 +++ test/ModuleRouteListenerTest.php | 3 +++ test/ResponseSender/AbstractResponseSenderTest.php | 3 +++ test/ResponseSender/PhpEnvironmentResponseSenderTest.php | 3 +++ test/ResponseSender/SendResponseEventTest.php | 3 +++ test/ResponseSender/SimpleStreamResponseSenderTest.php | 3 +++ test/SendResponseListenerTest.php | 3 +++ test/View/CreateViewModelListenerTest.php | 3 +++ test/View/DefaultRendereringStrategyTest.php | 3 +++ test/View/ExceptionStrategyTest.php | 3 +++ test/View/InjectTemplateListenerTest.php | 3 +++ test/View/InjectViewModelListenerTest.php | 3 +++ test/View/RouteNotFoundStrategyTest.php | 3 +++ 37 files changed, 111 insertions(+) diff --git a/test/Application/AllowsReturningEarlyFromRoutingTest.php b/test/Application/AllowsReturningEarlyFromRoutingTest.php index 9f7f9f1d8..3064fbacb 100644 --- a/test/Application/AllowsReturningEarlyFromRoutingTest.php +++ b/test/Application/AllowsReturningEarlyFromRoutingTest.php @@ -13,6 +13,9 @@ use Zend\Http\PhpEnvironment\Response; use Zend\Mvc\MvcEvent; +/** + * @coversNothing + */ class AllowsReturningEarlyFromRoutingTest extends TestCase { use PathControllerTrait; diff --git a/test/Application/ControllerIsDispatchedTest.php b/test/Application/ControllerIsDispatchedTest.php index 92db3d39d..c807f343f 100644 --- a/test/Application/ControllerIsDispatchedTest.php +++ b/test/Application/ControllerIsDispatchedTest.php @@ -12,6 +12,9 @@ use PHPUnit\Framework\TestCase; use Zend\Mvc\MvcEvent; +/** + * @coversNothing + */ class ControllerIsDispatchedTest extends TestCase { use PathControllerTrait; diff --git a/test/Application/ExceptionsRaisedInDispatchableShouldRaiseDispatchErrorEventTest.php b/test/Application/ExceptionsRaisedInDispatchableShouldRaiseDispatchErrorEventTest.php index ac10e883c..c02e5246b 100644 --- a/test/Application/ExceptionsRaisedInDispatchableShouldRaiseDispatchErrorEventTest.php +++ b/test/Application/ExceptionsRaisedInDispatchableShouldRaiseDispatchErrorEventTest.php @@ -12,6 +12,9 @@ use PHPUnit\Framework\TestCase; use Zend\Mvc\MvcEvent; +/** + * @coversNothing + */ class ExceptionsRaisedInDispatchableShouldRaiseDispatchErrorEventTest extends TestCase { use BadControllerTrait; diff --git a/test/Application/InabilityToRetrieveControllerShouldTriggerDispatchErrorTest.php b/test/Application/InabilityToRetrieveControllerShouldTriggerDispatchErrorTest.php index 8dad99385..3d9bb2a9f 100644 --- a/test/Application/InabilityToRetrieveControllerShouldTriggerDispatchErrorTest.php +++ b/test/Application/InabilityToRetrieveControllerShouldTriggerDispatchErrorTest.php @@ -13,6 +13,9 @@ use Zend\Mvc\Application; use Zend\Mvc\MvcEvent; +/** + * @coversNothing + */ class InabilityToRetrieveControllerShouldTriggerDispatchErrorTest extends TestCase { use MissingControllerTrait; diff --git a/test/Application/InabilityToRetrieveControllerShouldTriggerExceptionTest.php b/test/Application/InabilityToRetrieveControllerShouldTriggerExceptionTest.php index 9e32d129b..3076b2925 100644 --- a/test/Application/InabilityToRetrieveControllerShouldTriggerExceptionTest.php +++ b/test/Application/InabilityToRetrieveControllerShouldTriggerExceptionTest.php @@ -13,6 +13,9 @@ use Zend\Mvc\Application; use Zend\Mvc\MvcEvent; +/** + * @coversNothing + */ class InabilityToRetrieveControllerShouldTriggerExceptionTest extends TestCase { use MissingControllerTrait; diff --git a/test/Application/InitializationIntegrationTest.php b/test/Application/InitializationIntegrationTest.php index e6d7ca2f6..6400479f3 100644 --- a/test/Application/InitializationIntegrationTest.php +++ b/test/Application/InitializationIntegrationTest.php @@ -16,6 +16,9 @@ use function ob_get_clean; use function ob_start; +/** + * @coversNothing + */ class InitializationIntegrationTest extends TestCase { public function testDefaultInitializationWorkflow() diff --git a/test/Application/InvalidControllerTypeShouldTriggerDispatchErrorTest.php b/test/Application/InvalidControllerTypeShouldTriggerDispatchErrorTest.php index 2fd48933e..86c7d0200 100644 --- a/test/Application/InvalidControllerTypeShouldTriggerDispatchErrorTest.php +++ b/test/Application/InvalidControllerTypeShouldTriggerDispatchErrorTest.php @@ -13,6 +13,9 @@ use Zend\Mvc\Application; use Zend\Mvc\MvcEvent; +/** + * @coversNothing + */ class InvalidControllerTypeShouldTriggerDispatchErrorTest extends TestCase { use InvalidControllerTypeTrait; diff --git a/test/Application/RoutingSuccessTest.php b/test/Application/RoutingSuccessTest.php index 4c20afcb6..3c793892e 100644 --- a/test/Application/RoutingSuccessTest.php +++ b/test/Application/RoutingSuccessTest.php @@ -13,6 +13,9 @@ use Zend\Mvc\MvcEvent; use Zend\Router\RouteMatch; +/** + * @coversNothing + */ class RoutingSuccessTest extends TestCase { use PathControllerTrait; diff --git a/test/ApplicationTest.php b/test/ApplicationTest.php index a5a3c18ee..c804f7964 100644 --- a/test/ApplicationTest.php +++ b/test/ApplicationTest.php @@ -39,6 +39,9 @@ use function sprintf; use function var_export; +/** + * @covers \Zend\Mvc\Application + */ class ApplicationTest extends TestCase { use EventListenerIntrospectionTrait; diff --git a/test/Controller/ActionControllerTest.php b/test/Controller/ActionControllerTest.php index 36c29d38d..7a39113be 100644 --- a/test/Controller/ActionControllerTest.php +++ b/test/Controller/ActionControllerTest.php @@ -31,6 +31,9 @@ use function method_exists; use function var_export; +/** + * @covers \Zend\Mvc\Controller\AbstractActionController + */ class ActionControllerTest extends TestCase { public $controller; diff --git a/test/Controller/ControllerManagerTest.php b/test/Controller/ControllerManagerTest.php index 4af072019..501e599a1 100644 --- a/test/Controller/ControllerManagerTest.php +++ b/test/Controller/ControllerManagerTest.php @@ -21,6 +21,9 @@ use Zend\ServiceManager\ServiceManager; use ZendTest\Mvc\Controller\TestAsset\SampleController; +/** + * @covers \Zend\Mvc\Controller\ControllerManager + */ class ControllerManagerTest extends TestCase { public function setUp() : void diff --git a/test/Controller/IntegrationTest.php b/test/Controller/IntegrationTest.php index 5aa4e9385..c7b196033 100644 --- a/test/Controller/IntegrationTest.php +++ b/test/Controller/IntegrationTest.php @@ -17,6 +17,9 @@ use Zend\ServiceManager\Config; use Zend\ServiceManager\ServiceManager; +/** + * @coversNothing + */ class IntegrationTest extends TestCase { public function setUp() : void diff --git a/test/Controller/LazyControllerAbstractFactoryTest.php b/test/Controller/LazyControllerAbstractFactoryTest.php index 879a87dea..dec90ec09 100644 --- a/test/Controller/LazyControllerAbstractFactoryTest.php +++ b/test/Controller/LazyControllerAbstractFactoryTest.php @@ -17,6 +17,9 @@ use function sprintf; +/** + * @covers \Zend\Mvc\Controller\LazyControllerAbstractFactory + */ class LazyControllerAbstractFactoryTest extends TestCase { public function setUp() : void diff --git a/test/Controller/Plugin/AcceptableViewModelSelectorTest.php b/test/Controller/Plugin/AcceptableViewModelSelectorTest.php index d2b8ec168..5d2d78b5b 100644 --- a/test/Controller/Plugin/AcceptableViewModelSelectorTest.php +++ b/test/Controller/Plugin/AcceptableViewModelSelectorTest.php @@ -18,6 +18,9 @@ use Zend\View\Model; use ZendTest\Mvc\Controller\TestAsset\SampleController; +/** + * @covers \Zend\Mvc\Controller\Plugin\AcceptableViewModelSelector + */ class AcceptableViewModelSelectorTest extends TestCase { public function setUp() : void diff --git a/test/Controller/Plugin/ForwardTest.php b/test/Controller/Plugin/ForwardTest.php index 3cc5768ef..55e9a54e4 100644 --- a/test/Controller/Plugin/ForwardTest.php +++ b/test/Controller/Plugin/ForwardTest.php @@ -34,6 +34,9 @@ use ZendTest\Mvc\Controller\TestAsset\SampleController; use ZendTest\Mvc\Controller\TestAsset\UneventfulController; +/** + * @covers \Zend\Mvc\Controller\Plugin\Forward + */ class ForwardTest extends TestCase { /** @var ControllerManager */ diff --git a/test/Controller/Plugin/LayoutTest.php b/test/Controller/Plugin/LayoutTest.php index 98a08408e..866f3694e 100644 --- a/test/Controller/Plugin/LayoutTest.php +++ b/test/Controller/Plugin/LayoutTest.php @@ -16,6 +16,9 @@ use Zend\View\Model\ViewModel; use ZendTest\Mvc\Controller\TestAsset\SampleController; +/** + * @covers \Zend\Mvc\Controller\Plugin\Layout + */ class LayoutTest extends TestCase { public function setUp() : void diff --git a/test/Controller/Plugin/ParamsTest.php b/test/Controller/Plugin/ParamsTest.php index 3ddcf4c9f..1717a07ae 100644 --- a/test/Controller/Plugin/ParamsTest.php +++ b/test/Controller/Plugin/ParamsTest.php @@ -21,6 +21,9 @@ use const UPLOAD_ERR_OK; +/** + * @covers \Zend\Mvc\Controller\Plugin\Params + */ class ParamsTest extends TestCase { public function setUp() : void diff --git a/test/Controller/Plugin/RedirectTest.php b/test/Controller/Plugin/RedirectTest.php index 78da19ab8..3e2825c1d 100644 --- a/test/Controller/Plugin/RedirectTest.php +++ b/test/Controller/Plugin/RedirectTest.php @@ -21,6 +21,9 @@ use Zend\Router\SimpleRouteStack; use ZendTest\Mvc\Controller\TestAsset\SampleController; +/** + * @covers \Zend\Mvc\Controller\Plugin\Redirect + */ class RedirectTest extends TestCase { public function setUp() : void diff --git a/test/Controller/Plugin/UrlTest.php b/test/Controller/Plugin/UrlTest.php index e15ce6e7b..6bf88abcd 100644 --- a/test/Controller/Plugin/UrlTest.php +++ b/test/Controller/Plugin/UrlTest.php @@ -25,6 +25,9 @@ use Zend\Router\SimpleRouteStack; use ZendTest\Mvc\Controller\TestAsset\SampleController; +/** + * @covers \Zend\Mvc\Controller\Plugin\Url + */ class UrlTest extends TestCase { public function setUp() : void diff --git a/test/Controller/PluginManagerTest.php b/test/Controller/PluginManagerTest.php index 40e6199e1..b2f46a653 100644 --- a/test/Controller/PluginManagerTest.php +++ b/test/Controller/PluginManagerTest.php @@ -16,6 +16,9 @@ use ZendTest\Mvc\Controller\Plugin\TestAsset\SamplePlugin; use ZendTest\Mvc\Controller\TestAsset\SampleController; +/** + * @covers \Zend\Mvc\Controller\PluginManager + */ class PluginManagerTest extends TestCase { public function testPluginManagerInjectsControllerInPlugin() diff --git a/test/Controller/RestfulControllerTest.php b/test/Controller/RestfulControllerTest.php index 7fda0a8c7..d3aaca2a8 100644 --- a/test/Controller/RestfulControllerTest.php +++ b/test/Controller/RestfulControllerTest.php @@ -35,6 +35,9 @@ use function sort; use function uniqid; +/** + * @covers \Zend\Mvc\Controller\AbstractRestfulController + */ class RestfulControllerTest extends TestCase { public $controller; diff --git a/test/DispatchListenerTest.php b/test/DispatchListenerTest.php index c4f68c48d..ac67f1b63 100644 --- a/test/DispatchListenerTest.php +++ b/test/DispatchListenerTest.php @@ -25,6 +25,9 @@ use function var_export; +/** + * @covers \Zend\Mvc\DispatchListener + */ class DispatchListenerTest extends TestCase { public function createMvcEvent($controllerMatched) diff --git a/test/Exception/InvalidMiddlewareExceptionTest.php b/test/Exception/InvalidMiddlewareExceptionTest.php index 1ea66f201..3ac69432d 100644 --- a/test/Exception/InvalidMiddlewareExceptionTest.php +++ b/test/Exception/InvalidMiddlewareExceptionTest.php @@ -14,6 +14,9 @@ use function uniqid; +/** + * @covers \Zend\Mvc\Exception\InvalidMiddlewareException + */ final class InvalidMiddlewareExceptionTest extends TestCase { public function testFromMiddlewareName() diff --git a/test/Exception/ReachedFinalHandlerExceptionTest.php b/test/Exception/ReachedFinalHandlerExceptionTest.php index b51622f5b..35c51ad4b 100644 --- a/test/Exception/ReachedFinalHandlerExceptionTest.php +++ b/test/Exception/ReachedFinalHandlerExceptionTest.php @@ -12,6 +12,9 @@ use PHPUnit\Framework\TestCase; use Zend\Mvc\Exception\ReachedFinalHandlerException; +/** + * @covers \Zend\Mvc\Exception\ReachedFinalHandlerException + */ final class ReachedFinalHandlerExceptionTest extends TestCase { public function testFromNothing() diff --git a/test/MiddlewareListenerTest.php b/test/MiddlewareListenerTest.php index e52704320..73e2c6cdd 100644 --- a/test/MiddlewareListenerTest.php +++ b/test/MiddlewareListenerTest.php @@ -38,6 +38,9 @@ use function uniqid; use function var_export; +/** + * @covers \Zend\Mvc\MiddlewareListener + */ class MiddlewareListenerTest extends TestCase { /** @var ObjectProphecy */ diff --git a/test/ModuleRouteListenerTest.php b/test/ModuleRouteListenerTest.php index eb56c7829..3b35b5a75 100644 --- a/test/ModuleRouteListenerTest.php +++ b/test/ModuleRouteListenerTest.php @@ -18,6 +18,9 @@ use Zend\Router; use Zend\Router\RouteMatch; +/** + * @covers \Zend\Mvc\ModuleRouteListener + */ class ModuleRouteListenerTest extends TestCase { public function setUp() : void diff --git a/test/ResponseSender/AbstractResponseSenderTest.php b/test/ResponseSender/AbstractResponseSenderTest.php index d4c0716ac..7204eb922 100644 --- a/test/ResponseSender/AbstractResponseSenderTest.php +++ b/test/ResponseSender/AbstractResponseSenderTest.php @@ -23,6 +23,9 @@ use function version_compare; use function xdebug_get_headers; +/** + * @covers \Zend\Mvc\ResponseSender\AbstractResponseSender + */ class AbstractResponseSenderTest extends TestCase { /** diff --git a/test/ResponseSender/PhpEnvironmentResponseSenderTest.php b/test/ResponseSender/PhpEnvironmentResponseSenderTest.php index d7b495611..8e12b152a 100644 --- a/test/ResponseSender/PhpEnvironmentResponseSenderTest.php +++ b/test/ResponseSender/PhpEnvironmentResponseSenderTest.php @@ -18,6 +18,9 @@ use function ob_get_clean; use function ob_start; +/** + * @covers \Zend\Mvc\ResponseSender\PhpEnvironmentResponseSender + */ class PhpEnvironmentResponseSenderTest extends TestCase { public function testSendResponseIgnoresInvalidResponseTypes() diff --git a/test/ResponseSender/SendResponseEventTest.php b/test/ResponseSender/SendResponseEventTest.php index c9b5b3a86..988f5795d 100644 --- a/test/ResponseSender/SendResponseEventTest.php +++ b/test/ResponseSender/SendResponseEventTest.php @@ -13,6 +13,9 @@ use Zend\Mvc\ResponseSender\SendResponseEvent; use Zend\Stdlib\ResponseInterface; +/** + * @covers \Zend\Mvc\ResponseSender\SendResponseEvent + */ class SendResponseEventTest extends TestCase { public function testContentSentAndHeadersSent() diff --git a/test/ResponseSender/SimpleStreamResponseSenderTest.php b/test/ResponseSender/SimpleStreamResponseSenderTest.php index 68fbced06..1aad4532b 100644 --- a/test/ResponseSender/SimpleStreamResponseSenderTest.php +++ b/test/ResponseSender/SimpleStreamResponseSenderTest.php @@ -20,6 +20,9 @@ use function ob_get_clean; use function ob_start; +/** + * @covers \Zend\Mvc\ResponseSender\SimpleStreamResponseSender + */ class SimpleStreamResponseSenderTest extends TestCase { public function testSendResponseIgnoresInvalidResponseTypes() diff --git a/test/SendResponseListenerTest.php b/test/SendResponseListenerTest.php index 7ebbf1f8a..2669205b8 100644 --- a/test/SendResponseListenerTest.php +++ b/test/SendResponseListenerTest.php @@ -17,6 +17,9 @@ use function array_values; +/** + * @covers \Zend\Mvc\SendResponseListener + */ class SendResponseListenerTest extends TestCase { public function testEventManagerIdentifiers() diff --git a/test/View/CreateViewModelListenerTest.php b/test/View/CreateViewModelListenerTest.php index 021fcd879..22fa863a9 100644 --- a/test/View/CreateViewModelListenerTest.php +++ b/test/View/CreateViewModelListenerTest.php @@ -20,6 +20,9 @@ use function count; use function gettype; +/** + * @covers \Zend\Mvc\View\Http\CreateViewModelListener + */ class CreateViewModelListenerTest extends TestCase { use EventListenerIntrospectionTrait; diff --git a/test/View/DefaultRendereringStrategyTest.php b/test/View/DefaultRendereringStrategyTest.php index aaeaeeae4..ea2fc31e7 100644 --- a/test/View/DefaultRendereringStrategyTest.php +++ b/test/View/DefaultRendereringStrategyTest.php @@ -29,6 +29,9 @@ use function json_encode; use function sprintf; +/** + * @covers \Zend\Mvc\View\Http\DefaultRenderingStrategy + */ class DefaultRendereringStrategyTest extends TestCase { use EventListenerIntrospectionTrait; diff --git a/test/View/ExceptionStrategyTest.php b/test/View/ExceptionStrategyTest.php index bec626fa2..4a62ca804 100644 --- a/test/View/ExceptionStrategyTest.php +++ b/test/View/ExceptionStrategyTest.php @@ -21,6 +21,9 @@ use function count; +/** + * @covers \Zend\Mvc\View\Http\ExceptionStrategy + */ class ExceptionStrategyTest extends TestCase { use EventListenerIntrospectionTrait; diff --git a/test/View/InjectTemplateListenerTest.php b/test/View/InjectTemplateListenerTest.php index 5a7298834..e778aa22d 100644 --- a/test/View/InjectTemplateListenerTest.php +++ b/test/View/InjectTemplateListenerTest.php @@ -21,6 +21,9 @@ use function count; +/** + * @covers \Zend\Mvc\View\Http\InjectTemplateListener + */ class InjectTemplateListenerTest extends TestCase { use EventListenerIntrospectionTrait; diff --git a/test/View/InjectViewModelListenerTest.php b/test/View/InjectViewModelListenerTest.php index a40c252d6..88e747d41 100644 --- a/test/View/InjectViewModelListenerTest.php +++ b/test/View/InjectViewModelListenerTest.php @@ -19,6 +19,9 @@ use function count; +/** + * @covers \Zend\Mvc\View\Http\InjectViewModelListener + */ class InjectViewModelListenerTest extends TestCase { use EventListenerIntrospectionTrait; diff --git a/test/View/RouteNotFoundStrategyTest.php b/test/View/RouteNotFoundStrategyTest.php index c1dc0530b..58bb1397f 100644 --- a/test/View/RouteNotFoundStrategyTest.php +++ b/test/View/RouteNotFoundStrategyTest.php @@ -20,6 +20,9 @@ use Zend\View\Model\ModelInterface; use Zend\View\Model\ViewModel; +/** + * @covers \Zend\Mvc\View\Http\RouteNotFoundStrategy + */ class RouteNotFoundStrategyTest extends TestCase { use EventListenerIntrospectionTrait;