summaryrefslogtreecommitdiff
path: root/tests/Unit/Controllers/CreditsControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Unit/Controllers/CreditsControllerTest.php')
-rw-r--r--tests/Unit/Controllers/CreditsControllerTest.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/Unit/Controllers/CreditsControllerTest.php b/tests/Unit/Controllers/CreditsControllerTest.php
index 42ea4ea1..303bf60e 100644
--- a/tests/Unit/Controllers/CreditsControllerTest.php
+++ b/tests/Unit/Controllers/CreditsControllerTest.php
@@ -4,9 +4,10 @@ namespace Engelsystem\Test\Unit\Controllers;
use Engelsystem\Config\Config;
use Engelsystem\Controllers\CreditsController;
+use Engelsystem\Helpers\Version;
use Engelsystem\Http\Response;
+use Engelsystem\Test\Unit\TestCase;
use PHPUnit\Framework\MockObject\MockObject;
-use PHPUnit\Framework\TestCase;
class CreditsControllerTest extends TestCase
{
@@ -19,12 +20,17 @@ class CreditsControllerTest extends TestCase
/** @var Response|MockObject $response */
$response = $this->createMock(Response::class);
$config = new Config(['foo' => 'bar', 'credits' => ['lor' => 'em']]);
+ /** @var Version|MockObject $version */
+ $version = $this->createMock(Version::class);
- $response->expects($this->once())
- ->method('withView')
- ->with('pages/credits.twig', ['credits' => ['lor' => 'em']]);
+ $this->setExpects(
+ $response,
+ 'withView',
+ ['pages/credits.twig', ['credits' => ['lor' => 'em'], 'version' => '42.1.0-test']]
+ );
+ $this->setExpects($version, 'getVersion', [], '42.1.0-test');
- $controller = new CreditsController($response, $config);
+ $controller = new CreditsController($response, $config, $version);
$controller->index();
}
}