Skip to content

Commit 45ab73f

Browse files
Merge pull request #17 from victorwelling/master
Updates dependencies
2 parents b0c8335 + 9bb1b0c commit 45ab73f

17 files changed

Lines changed: 47 additions & 179 deletions

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
"test": "phpunit"
2828
},
2929
"require": {
30-
"php": "^7.0",
30+
"php": "^7.2",
3131
"psr/container": "^1.0",
3232
"psr/http-message": "^1.0",
3333
"psr/http-server-middleware": "^1.0",
34-
"psr/log": "^1.0",
35-
"twig/twig": "^2.5"
34+
"psr/log": "^1.1",
35+
"twig/twig": "^2.6"
3636
},
3737
"require-dev": {
38-
"phpunit/phpunit": "^6.5"
38+
"phpunit/phpunit": "^8.0"
3939
},
4040
"autoload": {
4141
"psr-4": {

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</whitelist>
1111
</filter>
1212
<testsuites>
13-
<testsuite>
13+
<testsuite name="All tests">
1414
<directory>tests/</directory>
1515
</testsuite>
1616
</testsuites>

tests/Integration/Composition/CompositionTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ final class CompositionTest extends IntegrationTestCase
1010
/** @var string */
1111
protected $templateDirectory = __DIR__ . '/Templates';
1212

13-
/**
14-
* @return void
15-
*/
16-
public function testVariablesFilterShouldPassOnModelVariablesToIncludedTemplate()
13+
public function testVariablesFilterShouldPassOnModelVariablesToIncludedTemplate(): void
1714
{
1815
$output = $this->renderTemplate('page.twig');
1916

tests/Integration/Embedding/EmbeddingTest.php

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ final class EmbeddingTest extends IntegrationTestCase
1515
/** @var string */
1616
protected $templateDirectory = __DIR__ . '/Templates';
1717

18-
/**
19-
* @return void
20-
*/
21-
protected function setUp()
18+
protected function setUp(): void
2219
{
2320
$this->pagePresenter = $this->createMock(PresenterInterface::class);
2421
$this->pagePresenter
@@ -30,20 +27,14 @@ protected function setUp()
3027
parent::setUp();
3128
}
3229

33-
/**
34-
* @return void
35-
*/
36-
public function testEmbeddedTemplatesShouldHaveTheirPresentersInvoked()
30+
public function testEmbeddedTemplatesShouldHaveTheirPresentersInvoked(): void
3731
{
3832
$output = $this->renderTemplate('page.twig');
3933

4034
$this->assertContains('<li><a href="/">Home</a></li>', $output);
4135
}
4236

43-
/**
44-
* @return void
45-
*/
46-
public function testOverriddenBlocksShouldReceiveVariablesFromParent()
37+
public function testOverriddenBlocksShouldReceiveVariablesFromParent(): void
4738
{
4839
$output = $this->renderTemplate('page.twig');
4940

@@ -52,20 +43,14 @@ public function testOverriddenBlocksShouldReceiveVariablesFromParent()
5243
$this->assertContains('<p>page_content</p>', $output);
5344
}
5445

55-
/**
56-
* @return void
57-
*/
58-
public function testEmbeddedTemplatesShouldReceiveVariablesPassedAsArguments()
46+
public function testEmbeddedTemplatesShouldReceiveVariablesPassedAsArguments(): void
5947
{
6048
$output = $this->renderTemplate('page.twig');
6149

6250
$this->assertContains('<main class="main--overriden">', $output);
6351
}
6452

65-
/**
66-
* @return void
67-
*/
68-
public function testPresentersShouldOnlyBeCalledOnce()
53+
public function testPresentersShouldOnlyBeCalledOnce(): void
6954
{
7055
$this->pagePresenter
7156
->expects($this->once())

tests/Integration/ErrorSuppression/ErrorSuppressionTest.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ final class ErrorSuppressionTest extends IntegrationTestCase
1010
/** @var string */
1111
protected $templateDirectory = __DIR__ . '/Templates';
1212

13-
public function testTemplateShouldRenderIfNoExceptionIsThrown()
13+
public function testTemplateShouldRenderIfNoExceptionIsThrown(): void
1414
{
1515
$output = $this->renderTemplate('page.twig');
1616

@@ -21,10 +21,7 @@ public function testTemplateShouldRenderIfNoExceptionIsThrown()
2121
$this->assertContains('<p>page_footer</p>', $output);
2222
}
2323

24-
/**
25-
* @return void
26-
*/
27-
public function testIncludedTemplateShouldThrowAnException()
24+
public function testIncludedTemplateShouldThrowAnException(): void
2825
{
2926
$this->expectExceptionMessage('item_exception');
3027

@@ -38,10 +35,7 @@ public function testIncludedTemplateShouldThrowAnException()
3835
$this->renderTemplate('item.twig');
3936
}
4037

41-
/**
42-
* @return void
43-
*/
44-
public function testOptionalBlocksShouldDiscardTheirContentsOnRuntimeExceptions()
38+
public function testOptionalBlocksShouldDiscardTheirContentsOnRuntimeExceptions(): void
4539
{
4640
$this->request
4741
->method('getAttribute')
@@ -59,10 +53,7 @@ public function testOptionalBlocksShouldDiscardTheirContentsOnRuntimeExceptions(
5953
$this->assertContains('<p>page_footer</p>', $output);
6054
}
6155

62-
/**
63-
* @return void
64-
*/
65-
public function testOptionalBlocksShouldNotSuppressLogicExceptions()
56+
public function testOptionalBlocksShouldNotSuppressLogicExceptions(): void
6657
{
6758
$this->expectExceptionMessage('Variable "unknown_variable" does not exist');
6859

tests/Integration/Inheritance/InheritanceTest.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ final class InheritanceTest extends IntegrationTestCase
1010
/** @var string */
1111
protected $templateDirectory = __DIR__ . '/Templates';
1212

13-
/**
14-
* @return void
15-
*/
16-
public function testShouldRenderBaseTemplateWithPlaceholders()
13+
public function testShouldRenderBaseTemplateWithPlaceholders(): void
1714
{
1815
$output = $this->renderTemplate('base.twig');
1916

@@ -22,10 +19,7 @@ public function testShouldRenderBaseTemplateWithPlaceholders()
2219
$this->assertContains('<p>base_footer</p>', $output);
2320
}
2421

25-
/**
26-
* @return void
27-
*/
28-
public function testShouldRenderChildTemplateWithOverriddenVariables()
22+
public function testShouldRenderChildTemplateWithOverriddenVariables(): void
2923
{
3024
$output = $this->renderTemplate('page.twig');
3125

tests/Integration/IntegrationTestCase.php

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ abstract class IntegrationTestCase extends TestCase
3333
/** @var Environment */
3434
private $twig;
3535

36-
/**
37-
* @return void
38-
*/
39-
protected function setUp()
36+
protected function setUp(): void
4037
{
4138
if (empty($this->templateDirectory)) {
4239
throw new LogicException('Template directory is not set in ' . static::class);
@@ -57,12 +54,6 @@ protected function setUp()
5754
parent::setUp();
5855
}
5956

60-
/**
61-
* @param string $template
62-
* @param mixed[] $variables
63-
*
64-
* @return string[]
65-
*/
6657
final protected function renderTemplate(string $template, array $variables = []): array
6758
{
6859
return $this->pipeline->withRequest($this->request, function () use ($template, $variables): array {
@@ -75,13 +66,7 @@ final protected function renderTemplate(string $template, array $variables = [])
7566
});
7667
}
7768

78-
/**
79-
* @param string $id
80-
* @param object $service
81-
*
82-
* @return void
83-
*/
84-
final protected function addToContainer(string $id, $service)
69+
final protected function addToContainer(string $id, object $service): void
8570
{
8671
if (isset($this->container[$id])) {
8772
throw new LogicException("Service with ID '{$id}' already exists in container");
@@ -90,9 +75,6 @@ final protected function addToContainer(string $id, $service)
9075
$this->container[$id] = $service;
9176
}
9277

93-
/**
94-
* @return ContainerInterface
95-
*/
9678
private function createContainer(): ContainerInterface
9779
{
9880
return new class($this->container) implements ContainerInterface

tests/Unit/ExtensionTest.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616

1717
final class ExtensionTest extends TestCase
1818
{
19-
/**
20-
* @return void
21-
*/
22-
public function testExtensionShouldDelegateProcessingToPipeline()
19+
public function testExtensionShouldDelegateProcessingToPipeline(): void
2320
{
2421
/** @var ServerRequestInterface|MockObject $request */
2522
$request = $this->createMock(ServerRequestInterface::class);
@@ -40,10 +37,7 @@ public function testExtensionShouldDelegateProcessingToPipeline()
4037
});
4138
}
4239

43-
/**
44-
* @return void
45-
*/
46-
public function testExtensionShouldIncludeVariablesFilter()
40+
public function testExtensionShouldIncludeVariablesFilter(): void
4741
{
4842
$extension = new Extension(new Pipeline());
4943
$presentationModel = new PresentationModel(['variable' => 'variable']);
@@ -61,15 +55,12 @@ public function testExtensionShouldIncludeVariablesFilter()
6155
/** @var mixed[] $variables */
6256
$variables = $callback($presentationModel);
6357

64-
$this->assertInternalType('array', $variables);
58+
$this->assertIsArray($variables);
6559
$this->assertCount(1, $variables);
6660
$this->assertArrayHasKey('variable', $variables);
6761
}
6862

69-
/**
70-
* @return void
71-
*/
72-
public function testExtensionShouldIncludeModelTest()
63+
public function testExtensionShouldIncludeModelTest(): void
7364
{
7465
$extension = new Extension(new Pipeline());
7566
$presentationModel = new PresentationModel();

tests/Unit/Http/ShootMiddlewareTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515

1616
final class ShootMiddlewareTest extends TestCase
1717
{
18-
/**
19-
* @return void
20-
*/
21-
public function testHttpRequestShouldBeSetOnPipeline()
18+
public function testHttpRequestShouldBeSetOnPipeline(): void
2219
{
2320
/** @var ServerRequestInterface|MockObject $request */
2421
$request = $this->createMock(ServerRequestInterface::class);

tests/Unit/Middleware/InspectorMiddlewareTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212

1313
final class InspectorMiddlewareTest extends TestCase
1414
{
15-
/**
16-
* @return void
17-
*/
18-
public function testShouldLogDebugInformationToConsole()
15+
public function testShouldLogDebugInformationToConsole(): void
1916
{
2017
/** @var ServerRequestInterface|MockObject $request */
2118
$request = $this->createMock(ServerRequestInterface::class);

0 commit comments

Comments
 (0)