Skip to content

Commit a1d1948

Browse files
committed
compatibility with nette/http 3.0
1 parent d568ab9 commit a1d1948

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"require": {
1717
"php": ">=7.1",
1818
"nette/component-model": "^2.3",
19-
"nette/http": "^2.2",
20-
"nette/utils": "^2.4 || ~3.0.0"
19+
"nette/http": "^3.0",
20+
"nette/utils": "^2.4 || ^3.0"
2121
},
2222
"suggest": {
2323
"nette/forms": "Allows to use Nette\\Application\\UI\\Form",
@@ -28,7 +28,7 @@
2828
"nette/di": "^2.4 || ~3.0.0",
2929
"nette/forms": "^2.4",
3030
"nette/robot-loader": "^2.4.2 || ^3.0",
31-
"nette/security": "^2.4",
31+
"nette/security": "^3.0",
3232
"latte/latte": "^2.4.3",
3333
"tracy/tracy": "^2.4",
3434
"mockery/mockery": "^1.0"

tests/Bridges.Latte/TemplateFactory.nonce.presenter.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ use Tester\Assert;
1313

1414
require __DIR__ . '/../bootstrap.php';
1515

16-
1716
$latte = new Latte\Engine;
1817

1918
$latteFactory = Mockery::mock(ApplicationLatte\ILatteFactory::class);
2019
$latteFactory->shouldReceive('create')->andReturn($latte);
2120

22-
$response = Mockery::mock(Nette\Http\Response::class);
21+
$response = Mockery::mock(Nette\Http\IResponse::class);
2322
$response->shouldReceive('getHeader')->with('Content-Security-Policy')->andReturn("hello 'nonce-abcd123==' world");
2423

2524
$presenter = Mockery::mock(UI\Presenter::class);

tests/UI/Presenter.storeRequest().phpt

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,31 @@ class MockSession extends Http\Session
2727

2828
public function __construct() {}
2929

30-
public function getSection($section, $class = Nette\Http\SessionSection::class)
30+
public function getSection(string $section, string $class = Nette\Http\SessionSection::class): Nette\Http\SessionSection
3131
{
3232
return $this->testSection;
3333
}
3434
}
3535

36-
class MockSessionSection implements \ArrayAccess
36+
class MockSessionSection extends Nette\Http\SessionSection
3737
{
3838
public $testedKeyExistence;
3939
public $storedKey;
4040
public $storedValue;
4141
public $testExpiration;
4242
public $testExpirationVariables;
4343

44-
public function __isset($name)
44+
public function __construct()
45+
{
46+
}
47+
48+
public function __isset(string $name): bool
4549
{
4650
$this->testedKeyExistence = $name;
4751
return FALSE;
4852
}
4953

50-
public function __set($name, $value)
54+
public function __set(string $name, $value): void
5155
{
5256
$this->storedKey = $name;
5357
$this->storedValue = $value;
@@ -59,18 +63,18 @@ class MockSessionSection implements \ArrayAccess
5963
$this->testExpirationVariables = $variables;
6064
}
6165

62-
public function offsetExists($name)
66+
public function offsetExists($name): bool
6367
{
6468
return $this->__isset($name);
6569
}
6670

67-
public function offsetSet($name, $value)
71+
public function offsetSet($name, $value): void
6872
{
6973
$this->__set($name, $value);
7074
}
7175

7276
public function offsetGet($name) {}
73-
public function offsetUnset($name) {}
77+
public function offsetUnset($name): void {}
7478
}
7579

7680
class MockUser extends Security\User

0 commit comments

Comments
 (0)