diff options
author | msquare <msquare@notrademark.de> | 2018-09-04 18:24:11 +0200 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2018-09-04 18:24:11 +0200 |
commit | b320fc779063ee80b8f0ba505cb323287ccccbf5 (patch) | |
tree | 1e420597ae72c979361bf29b66ae7e27c73cf431 /tests/Unit/ApplicationTest.php | |
parent | 9f1ee0c6c6497d43fb275491ec53fda420f64b81 (diff) | |
parent | 36dafdb68acbde2fe42ce36ef50f497c8c06411f (diff) |
Merge branch 'MyIgel-rebuild-psr7'
Diffstat (limited to 'tests/Unit/ApplicationTest.php')
-rw-r--r-- | tests/Unit/ApplicationTest.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/Unit/ApplicationTest.php b/tests/Unit/ApplicationTest.php index f58483ea..866eb957 100644 --- a/tests/Unit/ApplicationTest.php +++ b/tests/Unit/ApplicationTest.php @@ -9,6 +9,7 @@ use Engelsystem\Container\ServiceProvider; use PHPUnit\Framework\TestCase; use PHPUnit_Framework_MockObject_MockObject; use Psr\Container\ContainerInterface; +use Psr\Http\Server\MiddlewareInterface; use ReflectionClass; class ApplicationTest extends TestCase @@ -118,6 +119,7 @@ class ApplicationTest extends TestCase /** * @covers \Engelsystem\Application::bootstrap * @covers \Engelsystem\Application::isBooted + * @covers \Engelsystem\Application::getMiddleware */ public function testBootstrap() { @@ -137,10 +139,11 @@ class ApplicationTest extends TestCase $config = $this->getMockBuilder(Config::class) ->getMock(); - $config->expects($this->once()) + $middleware = [MiddlewareInterface::class]; + $config->expects($this->exactly(2)) ->method('get') - ->with('providers') - ->willReturn([$serviceProvider]); + ->withConsecutive(['providers'], ['middleware']) + ->willReturnOnConsecutiveCalls([$serviceProvider], $middleware); $property = (new ReflectionClass($app))->getProperty('serviceProviders'); $property->setAccessible(true); @@ -149,6 +152,7 @@ class ApplicationTest extends TestCase $app->bootstrap($config); $this->assertTrue($app->isBooted()); + $this->assertEquals($middleware, $app->getMiddleware()); // Run bootstrap another time to ensure that providers are registered only once $app->bootstrap($config); |