Skip to content

Commit

Permalink
Fix codesniffer issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Oct 24, 2023
1 parent eda262a commit 7d2a599
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions tests/src/Controller/ConsentControllerTest.php
Expand Up @@ -25,24 +25,24 @@
class ConsentTest extends TestCase
{
/** @var \SimpleSAML\Configuration */
protected $config;
protected static Configuration $config;

/** @var \SimpleSAML\Logger */
protected $logger;
protected static Logger $logger;

/** @var \SimpleSAML\Session */
protected $session;
protected static Session $session;


/**
* Set up for each test.
* @return void
*/
protected function setUp(): void
protected function setUpBeforeClass(): void

Check failure on line 41 in tests/src/Controller/ConsentControllerTest.php

View workflow job for this annotation

GitHub Actions / Quality control

OverriddenMethodAccess

tests/src/Controller/ConsentControllerTest.php:41:5: OverriddenMethodAccess: Method SimpleSAML\Test\Module\consent\Controller\ConsentTest::setUpBeforeClass has different access level than PHPUnit\Framework\TestCase::setUpBeforeClass (see https://psalm.dev/066)
{
parent::setUp();

$this->config = Configuration::loadFromArray(
self::$config = Configuration::loadFromArray(
[
'module.enable' => ['consent' => true],
'secretsalt' => 'abc123',
Expand All @@ -52,9 +52,9 @@ protected function setUp(): void
'simplesaml'
);

$this->session = Session::getSessionFromRequest();
self::$session = Session::getSessionFromRequest();

$this->logger = new class () extends Logger {
self::$logger = new class () extends Logger {
public static function info(string $string): void
{
// do nothing
Expand All @@ -75,7 +75,7 @@ public function testGetconsentAccept(): void
['yes' => '', 'saveconsent' => '1', 'StateId' => 'someStateId']
);

$c = new Controller\ConsentController($this->config, $this->session);
$c = new Controller\ConsentController(self::$config, self::$session);
$c->setAuthState(new class () extends State {
public static function loadState(string $id, string $stage, bool $allowMissing = false): ?array
{
Expand Down Expand Up @@ -122,7 +122,7 @@ public function testGetconsentDecline(): void
['no' => '', 'StateId' => 'someStateId']
);

$c = new Controller\ConsentController($this->config, $this->session);
$c = new Controller\ConsentController(self::$config, self::$session);
$c->setAuthState(new class () extends State {
public static function loadState(string $id, string $stage, bool $allowMissing = false): ?array
{
Expand Down Expand Up @@ -163,7 +163,7 @@ public function testNoconsent(): void
['StateId' => 'someStateId']
);

$c = new Controller\ConsentController($this->config, $this->session);
$c = new Controller\ConsentController(self::$config, self::$session);
$c->setAuthState(new class () extends State {
public static function loadState(string $id, string $stage, bool $allowMissing = false): ?array
{
Expand Down Expand Up @@ -196,7 +196,7 @@ public function testLogout(): void
['StateId' => 'someStateId']
);
$c = new Controller\ConsentController($this->config, $this->session);
$c = new Controller\ConsentController(self::$config, self::$session);
$c->setAuthState(new class () extends State {
public static function loadState(string $id, string $stage, bool $allowMissing = false): ?array
{
Expand All @@ -223,7 +223,7 @@ public function testLogoutcompleted(): void
// 'GET'
// );

$c = new Controller\ConsentController($this->config, $this->session);
$c = new Controller\ConsentController(self::$config, self::$session);
$response = $c->logoutcompleted();

$this->assertTrue($response->isSuccessful());
Expand All @@ -243,8 +243,8 @@ public function testMissingStateId(string $controller): void
'GET'
);

$c = new Controller\ConsentController($this->config, $this->session);
$c->setLogger($this->logger);
$c = new Controller\ConsentController(self::$config, self::$session);
$c->setLogger(self::$logger);

$this->expectException(Error\BadRequest::class);
$this->expectExceptionMessage('Missing required StateId query parameter.');
Expand All @@ -267,8 +267,8 @@ public function testNoState(string $controller): void
['StateId' => 'someStateId']
);

$c = new Controller\ConsentController($this->config, $this->session);
$c->setLogger($this->logger);
$c = new Controller\ConsentController(self::$config, self::$session);
$c->setLogger(self::$logger);

$this->expectException(Error\NoState::class);
$this->expectExceptionMessage('NOSTATE');
Expand Down

0 comments on commit 7d2a599

Please sign in to comment.