engelsystem/tests/Unit/Controllers/CreditsControllerTest.php

37 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2018-09-02 02:13:18 +02:00
<?php
2018-10-25 18:53:05 +02:00
namespace Engelsystem\Test\Unit\Controllers;
2018-09-02 02:13:18 +02:00
2018-12-21 23:12:04 +01:00
use Engelsystem\Config\Config;
2018-09-02 02:13:18 +02:00
use Engelsystem\Controllers\CreditsController;
use Engelsystem\Helpers\Version;
2018-09-02 02:13:18 +02:00
use Engelsystem\Http\Response;
use Engelsystem\Test\Unit\TestCase;
2018-09-02 02:13:18 +02:00
use PHPUnit\Framework\MockObject\MockObject;
class CreditsControllerTest extends TestCase
{
/**
* @covers \Engelsystem\Controllers\CreditsController::__construct
* @covers \Engelsystem\Controllers\CreditsController::index
*/
public function testIndex()
{
/** @var Response|MockObject $response */
$response = $this->createMock(Response::class);
2018-12-21 23:12:04 +01:00
$config = new Config(['foo' => 'bar', 'credits' => ['lor' => 'em']]);
/** @var Version|MockObject $version */
$version = $this->createMock(Version::class);
2018-09-02 02:13:18 +02:00
$this->setExpects(
$response,
'withView',
['pages/credits.twig', ['credits' => ['lor' => 'em'], 'version' => '42.1.0-test']]
);
$this->setExpects($version, 'getVersion', [], '42.1.0-test');
2018-09-02 02:13:18 +02:00
$controller = new CreditsController($response, $config, $version);
2018-09-02 02:13:18 +02:00
$controller->index();
}
}