mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-09 16:53:11 +08:00
Improved Rest's ConfigProvider test to kill more mutants
This commit is contained in:
@@ -20,9 +20,31 @@ class ConfigProviderTest extends TestCase
|
||||
/** @test */
|
||||
public function properConfigIsReturned(): void
|
||||
{
|
||||
$config = $this->configProvider->__invoke();
|
||||
$config = ($this->configProvider)();
|
||||
|
||||
$this->assertArrayHasKey('routes', $config);
|
||||
$this->assertArrayHasKey('dependencies', $config);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function routesAreProperlyPrefixed(): void
|
||||
{
|
||||
$configProvider = new ConfigProvider(function () {
|
||||
return [
|
||||
'routes' => [
|
||||
['path' => '/foo'],
|
||||
['path' => '/bar'],
|
||||
['path' => '/baz/foo'],
|
||||
],
|
||||
];
|
||||
});
|
||||
|
||||
$config = $configProvider();
|
||||
|
||||
$this->assertEquals([
|
||||
['path' => '/rest/v{version:1|2}/foo'],
|
||||
['path' => '/rest/v{version:1|2}/bar'],
|
||||
['path' => '/rest/v{version:1|2}/baz/foo'],
|
||||
], $config['routes']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user