-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa1091e
commit 7255849
Showing
12 changed files
with
150 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,4 @@ | |
* Nothing | ||
|
||
### Fixed | ||
* Nothing | ||
* Nothing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,4 @@ return [ | |
] | ||
] | ||
] | ||
]; | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DotTest\ResponseHeader; | ||
|
||
use Dot\ResponseHeader\ConfigProvider; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class ConfigProviderTest extends TestCase | ||
{ | ||
private ConfigProvider $configProvider; | ||
|
||
public function setUp(): void | ||
{ | ||
$this->configProvider = new ConfigProvider(); | ||
} | ||
|
||
public function testInvoke() | ||
{ | ||
$data = $this->configProvider->__invoke(); | ||
|
||
$this->assertIsArray($data); | ||
} | ||
|
||
public function testGetDependencies() | ||
{ | ||
$data = $this->configProvider->getDependencies(); | ||
|
||
$this->assertIsArray($data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DotTest\ResponseHeader; | ||
|
||
use Dot\ResponseHeader\Factory\ResponseHeaderMiddlewareFactory; | ||
use PHPUnit\Framework\MockObject\Exception; | ||
use PHPUnit\Framework\MockObject\MockObject; | ||
use PHPUnit\Framework\TestCase; | ||
use Psr\Container\ContainerExceptionInterface; | ||
use Psr\Container\ContainerInterface; | ||
use Psr\Container\NotFoundExceptionInterface; | ||
|
||
class ResponseHeaderMiddlewareFactoryTest extends TestCase | ||
{ | ||
private ResponseHeaderMiddlewareFactory $responseHeaderMiddlewareFactory; | ||
|
||
private ContainerInterface|MockObject $containerInterface; | ||
|
||
/** | ||
* @throws Exception | ||
*/ | ||
public function setUp(): void | ||
{ | ||
$this->responseHeaderMiddlewareFactory = new ResponseHeaderMiddlewareFactory(); | ||
$this->containerInterface = $this->createMock(ContainerInterface::class); | ||
} | ||
|
||
/** | ||
* @throws ContainerExceptionInterface | ||
* @throws Exception | ||
* @throws NotFoundExceptionInterface | ||
*/ | ||
public function testWillNotCreateApplicationWithoutConfig(): void | ||
{ | ||
$container = $this->createMock(ContainerInterface::class); | ||
|
||
$container->expects($this->once()) | ||
->method('has') | ||
->with('config') | ||
->willReturn(false); | ||
|
||
$this->expectException(\Exception::class); | ||
$this->expectExceptionMessage(ResponseHeaderMiddlewareFactory::MESSAGE_MISSING_CONFIG); | ||
(new ResponseHeaderMiddlewareFactory())($container); | ||
} | ||
|
||
/** | ||
* @throws Exception | ||
* @throws ContainerExceptionInterface | ||
* @throws NotFoundExceptionInterface | ||
*/ | ||
public function testWillNotCreateApplicationWithoutPackageConfig(): void | ||
{ | ||
$container = $this->createMock(ContainerInterface::class); | ||
|
||
$container->expects($this->once()) | ||
->method('has') | ||
->with('config') | ||
->willReturn(true); | ||
|
||
$container->expects($this->once()) | ||
->method('get') | ||
->with('config') | ||
->willReturn([ | ||
'test', | ||
]); | ||
|
||
$this->expectException(\Exception::class); | ||
$this->expectExceptionMessage(ResponseHeaderMiddlewareFactory::MESSAGE_MISSING_PACKAGE_CONFIG); | ||
(new ResponseHeaderMiddlewareFactory())($container); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.