From 0f542dee1bb2ddb8a8413bcd570023470e6d0470 Mon Sep 17 00:00:00 2001 From: Nikola Posa Date: Mon, 23 Nov 2015 23:39:06 +0100 Subject: [PATCH] Improving exception assertions. --- test/Container/ApplicationFactoryTest.php | 24 +++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/test/Container/ApplicationFactoryTest.php b/test/Container/ApplicationFactoryTest.php index bfc7cdc8..4ccb7ac0 100644 --- a/test/Container/ApplicationFactoryTest.php +++ b/test/Container/ApplicationFactoryTest.php @@ -1122,8 +1122,10 @@ public function testExceptionIsRaisedInCaseOfInvalidRouteMethodsConfiguration() ->get('config') ->willReturn($config); - $this->setExpectedException('Zend\Expressive\Container\Exception\InvalidArgumentException'); - + $this->setExpectedException( + 'Zend\Expressive\Container\Exception\InvalidArgumentException', + 'route must be in form of an array; received "string' + ); $this->factory->__invoke($this->container->reveal()); } @@ -1177,8 +1179,10 @@ public function testExceptionIsRaisedInCaseOfInvalidRouteOptionsConfiguration() ->get('config') ->willReturn($config); - $this->setExpectedException('Zend\Expressive\Container\Exception\InvalidArgumentException'); - + $this->setExpectedException( + 'Zend\Expressive\Container\Exception\InvalidArgumentException', + 'options must be an array; received "string"' + ); $this->factory->__invoke($this->container->reveal()); } @@ -1231,8 +1235,10 @@ public function testExceptionIsRaisedInCaseOfInvalidPreRoutingMiddlewarePipeline ->get('config') ->willReturn($config); - $this->setExpectedException('Zend\Expressive\Container\Exception\InvalidArgumentException'); - + $this->setExpectedException( + 'Zend\Expressive\Container\Exception\InvalidArgumentException', + 'middleware collection must be an array; received "string"' + ); $this->factory->__invoke($this->container->reveal()); } @@ -1285,8 +1291,10 @@ public function testExceptionIsRaisedInCaseOfInvalidPostRoutingMiddlewarePipelin ->get('config') ->willReturn($config); - $this->setExpectedException('Zend\Expressive\Container\Exception\InvalidArgumentException'); - + $this->setExpectedException( + 'Zend\Expressive\Container\Exception\InvalidArgumentException', + 'middleware collection must be an array; received "string"' + ); $this->factory->__invoke($this->container->reveal()); } }