Skip to content

Commit 0fb29fc

Browse files
committed
Fix CI
1 parent 412863d commit 0fb29fc

8 files changed

Lines changed: 80 additions & 11 deletions

File tree

.github/workflows/php.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
php-version: ['8.1', '8.2', '8.3', '8.4']
21+
php-version: ['8.1', '8.2', '8.3', '8.4', '8.5']
2222

23-
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.11.0
23+
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.7
2424
with:
2525
php-version: ${{ matrix.php-version }}
2626

@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131

32-
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.11.0
32+
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.10.7
3333
with:
3434
enable_eslinter: true
3535
enable_jsonlinter: true
@@ -45,7 +45,7 @@ jobs:
4545
fail-fast: false
4646
matrix:
4747
operating-system: [ubuntu-latest]
48-
php-versions: ['8.1', '8.2', '8.3', '8.4']
48+
php-versions: ['8.1', '8.2', '8.3', '8.4', '8.5']
4949

5050
steps:
5151
- name: Setup PHP, with composer and extensions
@@ -85,15 +85,15 @@ jobs:
8585
run: composer install --no-progress --prefer-dist --optimize-autoloader
8686

8787
- name: Run unit tests with coverage
88-
if: ${{ matrix.php-versions == '8.4' }}
88+
if: ${{ matrix.php-versions == '8.5' }}
8989
run: vendor/bin/phpunit
9090

9191
- name: Run unit tests (no coverage)
92-
if: ${{ matrix.php-versions != '8.4' }}
92+
if: ${{ matrix.php-versions != '8.5' }}
9393
run: vendor/bin/phpunit --no-coverage
9494

9595
- name: Save coverage data
96-
if: ${{ matrix.php-versions == '8.4' }}
96+
if: ${{ matrix.php-versions == '8.5' }}
9797
uses: actions/upload-artifact@v6
9898
with:
9999
name: coverage-data
@@ -108,7 +108,7 @@ jobs:
108108
fail-fast: true
109109
matrix:
110110
operating-system: [windows-latest]
111-
php-versions: ['8.1', '8.2', '8.3', '8.4']
111+
php-versions: ['8.1', '8.2', '8.3', '8.4', '8.5']
112112

113113
steps:
114114
- name: Setup PHP, with composer and extensions
@@ -161,8 +161,8 @@ jobs:
161161
uses: shivammathur/setup-php@v2
162162
with:
163163
# Should be the higest supported version, so we can use the newest tools
164-
php-version: '8.4'
165-
tools: composer, composer-require-checker, composer-unused, phpcs
164+
php-version: '8.5'
165+
tools: composer, composer-require-checker, composer-unused
166166
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, spl, xml
167167

168168
- name: Setup problem matchers for PHP
@@ -193,7 +193,7 @@ jobs:
193193
run: composer-unused
194194

195195
- name: PHP Code Sniffer
196-
run: phpcs
196+
run: vendor/bin/phpcs
197197

198198
- name: PHPStan
199199
run: |

tests/src/Controller/Cas10ControllerTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class Cas10ControllerTest extends TestCase
2525

2626
private Configuration $sspConfig;
2727

28+
2829
protected function setUp(): void
2930
{
3031
$this->sspConfig = Configuration::getConfig('config.php');
@@ -62,6 +63,7 @@ protected function setUp(): void
6263
];
6364
}
6465

66+
6567
public static function setUpBeforeClass(): void
6668
{
6769
// Some of the constructs in this test cause a Configuration to be created prior to us
@@ -73,6 +75,7 @@ public static function setUpBeforeClass(): void
7375
$_SERVER['REQUEST_URI'] = '/';
7476
}
7577

78+
7679
public static function queryParameterValues(): array
7780
{
7881
return [
@@ -88,6 +91,7 @@ public static function queryParameterValues(): array
8891
];
8992
}
9093

94+
9195
/**
9296
* @param array $params
9397
*
@@ -111,6 +115,7 @@ public function testReturnBadRequestOnEmptyServiceOrTicket(array $params): void
111115
$this->assertEquals("no\n\n", $response->getContent());
112116
}
113117

118+
114119
/**
115120
* @return void
116121
* @throws Exception
@@ -142,6 +147,7 @@ public function getTicket(string $ticketId): ?array
142147
$this->assertEquals("no\n\n", $response->getContent());
143148
}
144149

150+
145151
/**
146152
* @return void
147153
* @throws Exception
@@ -166,6 +172,7 @@ public function testReturnBadRequestOnTicketNotExist(): void
166172
$this->assertEquals("no\n\n", $response->getContent());
167173
}
168174

175+
169176
/**
170177
* @return void
171178
* @throws Exception
@@ -192,6 +199,7 @@ public function testReturnBadRequestOnTicketExpired(): void
192199
$this->assertEquals("no\n\n", $response->getContent());
193200
}
194201

202+
195203
/**
196204
* @return void
197205
* @throws Exception
@@ -220,6 +228,7 @@ public function testReturnBadRequestOnTicketNotService(): void
220228
$this->assertEquals("no\n\n", $response->getContent());
221229
}
222230

231+
223232
/**
224233
* @return void
225234
* @throws Exception
@@ -248,6 +257,7 @@ public function testReturnBadRequestOnTicketMissingUsernameField(): void
248257
$this->assertEquals("no\n\n", $response->getContent());
249258
}
250259

260+
251261
/**
252262
* @return void
253263
* @throws Exception
@@ -276,6 +286,7 @@ public function testReturnBadRequestOnTicketServiceQueryAndTicketMismatch(): voi
276286
$this->assertEquals("no\n\n", $response->getContent());
277287
}
278288

289+
279290
/**
280291
* @return void
281292
* @throws Exception
@@ -304,6 +315,7 @@ public function testReturnBadRequestOnTicketIssuedBySingleSignOnSession(): void
304315
$this->assertEquals("no\n\n", $response->getContent());
305316
}
306317

318+
307319
/**
308320
* @return void
309321
* @throws Exception

tests/src/Controller/Cas20ControllerTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ class Cas20ControllerTest extends TestCase
3838
private Utils\HTTP|MockObject $utilsHttpMock;
3939

4040
private array $ticket;
41+
4142
private array $proxyTicket;
4243

44+
4345
/**
4446
* @throws \Exception
4547
*/
@@ -111,6 +113,7 @@ protected function setUp(): void
111113
];
112114
}
113115

116+
114117
public static function validateMethods(): array
115118
{
116119
return [
@@ -125,6 +128,7 @@ public static function validateMethods(): array
125128
];
126129
}
127130

131+
128132
#[DataProvider('validateMethods')]
129133
public function testProxyValidatePassesTheCorrectMethodToValidate(string $prefix, string $method): void
130134
{
@@ -160,6 +164,7 @@ public function testProxyValidatePassesTheCorrectMethodToValidate(string $prefix
160164
$controllerMock->$method($request, ...$requestParameters);
161165
}
162166

167+
163168
public static function queryParameterValues(): array
164169
{
165170
return [
@@ -182,6 +187,7 @@ public static function queryParameterValues(): array
182187
];
183188
}
184189

190+
185191
#[DataProvider('queryParameterValues')]
186192
public function testProxyRequestFails(array $params, string $message): void
187193
{
@@ -209,6 +215,7 @@ public function testProxyRequestFails(array $params, string $message): void
209215
);
210216
}
211217

218+
212219
public function testProxyRequestFailsWhenPgtNotRecognized(): void
213220
{
214221
$this->moduleConfig['legal_target_service_urls'] = ['https://myservice.com/abcd'];
@@ -238,6 +245,7 @@ public function testProxyRequestFailsWhenPgtNotRecognized(): void
238245
);
239246
}
240247

248+
241249
public function testProxyRequestFailsWhenPgtNotValid(): void
242250
{
243251
$this->moduleConfig['legal_target_service_urls'] = ['https://myservice.com/abcd'];
@@ -269,6 +277,7 @@ public function testProxyRequestFailsWhenPgtNotValid(): void
269277
);
270278
}
271279

280+
272281
public function testProxyRequestFailsWhenPgtExpired(): void
273282
{
274283
$this->moduleConfig['legal_target_service_urls'] = ['https://myservice.com/abcd'];
@@ -305,6 +314,7 @@ public function testProxyRequestFailsWhenPgtExpired(): void
305314
);
306315
}
307316

317+
308318
public function testProxyReturnsProxyTicket(): void
309319
{
310320
$this->moduleConfig['legal_target_service_urls'] = ['https://myservice.com/abcd'];
@@ -359,6 +369,7 @@ public function testProxyReturnsProxyTicket(): void
359369
$this->assertTrue(filter_var($ticketFactory->isProxyTicket($proxyTicket), FILTER_VALIDATE_BOOLEAN));
360370
}
361371

372+
362373
public static function validateFailsForEmptyServiceTicket(): array
363374
{
364375
return [
@@ -377,6 +388,7 @@ public static function validateFailsForEmptyServiceTicket(): array
377388
];
378389
}
379390

391+
380392
#[DataProvider('validateFailsForEmptyServiceTicket')]
381393
public function testServiceValidateFailing(array $requestParams, string $message): void
382394
{
@@ -402,6 +414,7 @@ public function testServiceValidateFailing(array $requestParams, string $message
402414
);
403415
}
404416

417+
405418
public function testReturn500OnDeleteTicketThatThrows(): void
406419
{
407420
$config = Configuration::loadFromArray($this->moduleConfig);
@@ -437,6 +450,7 @@ public function getTicket(string $ticketId): ?array
437450
);
438451
}
439452

453+
440454
public static function validateOnDifferentQueryParameterCombinations(): array
441455
{
442456
$sessionId = session_create_id();
@@ -495,6 +509,7 @@ public static function validateOnDifferentQueryParameterCombinations(): array
495509
];
496510
}
497511

512+
498513
#[DataProvider('validateOnDifferentQueryParameterCombinations')]
499514
public function testServiceValidate(
500515
array $requestParams,
@@ -596,6 +611,7 @@ public static function validateOnDifferentQueryParameterCombinationsProxyValidat
596611
];
597612
}
598613

614+
599615
#[DataProvider('validateOnDifferentQueryParameterCombinationsProxyValidate')]
600616
public function testProxyValidate(
601617
array $requestParams,
@@ -645,6 +661,7 @@ public function testProxyValidate(
645661
}
646662
}
647663

664+
648665
public function testReturnBadRequestOnTicketServiceQueryAndTicketMismatch(): void
649666
{
650667
$config = Configuration::loadFromArray($this->moduleConfig);
@@ -678,6 +695,7 @@ public function testReturnBadRequestOnTicketServiceQueryAndTicketMismatch(): voi
678695
);
679696
}
680697

698+
681699
public function testThrowOnProxyServiceIdentityFail(): void
682700
{
683701
$config = Configuration::loadFromArray($this->moduleConfig);

tests/src/Controller/Cas30ControllerTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class Cas30ControllerTest extends TestCase
3333

3434
private array $ticket;
3535

36+
3637
/**
3738
* @throws \Exception
3839
*/
@@ -80,6 +81,7 @@ protected function setUp(): void
8081
];
8182
}
8283

84+
8385
/**
8486
* @return void
8587
* @throws \Exception
@@ -110,6 +112,7 @@ public function testNoSoapBody(): void
110112
$cas30Controller->samlValidate($this->samlValidateRequest, $target);
111113
}
112114

115+
113116
public static function soapEnvelopes(): array
114117
{
115118
return [
@@ -168,6 +171,7 @@ public static function soapEnvelopes(): array
168171
];
169172
}
170173

174+
171175
#[DataProvider('soapEnvelopes')]
172176
public function testSoapMessageIsInvalid(
173177
string $soapMessage,
@@ -250,6 +254,7 @@ public function testCasValidateAndDeleteTicketThrowsException(): void
250254
$cas30Controller->samlValidate($this->samlValidateRequest, $target);
251255
}
252256

257+
253258
/**
254259
* @return void
255260
* @throws \Exception
@@ -302,6 +307,7 @@ public function testUnableToLoadTicket(): void
302307
$cas30Controller->samlValidate($this->samlValidateRequest, $target);
303308
}
304309

310+
305311
/**
306312
* @return void
307313
* @throws \Exception

0 commit comments

Comments
 (0)