Skip to content

Commit 00c4d64

Browse files
committed
use set expire for Strict-Transport-Security on ! enable of "strict_transport_security" config
1 parent 06339b8 commit 00c4d64

3 files changed

Lines changed: 270 additions & 240 deletions

File tree

spec/Listener/ForceHttpsFactorySpec.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@
1515

1616
describe('->__invoke', function () {
1717

18+
given('container', function () {
19+
return Double::instance(['implements' => ContainerInterface::class]);
20+
});
21+
1822
it('returns ' . ForceHttps::class . ' instance with default config', function () {
1923

2024
$config = [];
21-
$container = Double::instance(['implements' => ContainerInterface::class]);
22-
allow($container)->toReceive('get')->with('config')->andReturn($config);
25+
allow($this->container)->toReceive('get')->with('config')->andReturn($config);
26+
27+
$actual = $this->factory->__invoke($this->container);
2328

24-
$actual = $this->factory->__invoke($container);
2529
expect($actual)->toBeAnInstanceOf(ForceHttps::class);
2630

2731
});
@@ -35,10 +39,10 @@
3539
'force_specific_routes' => [],
3640
],
3741
];
38-
$container = Double::instance(['implements' => ContainerInterface::class]);
39-
allow($container)->toReceive('get')->with('config')->andReturn($config);
42+
allow($this->container)->toReceive('get')->with('config')->andReturn($config);
4043

41-
$actual = $this->factory->__invoke($container);
44+
$actual = $this->factory->__invoke($this->container);
45+
4246
expect($actual)->toBeAnInstanceOf(ForceHttps::class);
4347

4448
});

0 commit comments

Comments
 (0)