Skip to content

Commit cd94b19

Browse files
committed
Fix unit tests
1 parent 3e0eca2 commit cd94b19

File tree

3 files changed

+20
-22
lines changed

3 files changed

+20
-22
lines changed

.github/workflows/php.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ jobs:
3838
- uses: actions/checkout@v4
3939

4040
- name: Get composer cache directory
41-
id: composer-cache
42-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
41+
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
4342

4443
- name: Cache composer dependencies
4544
uses: actions/cache@v4
@@ -60,7 +59,7 @@ jobs:
6059
- name: Decide whether to run code coverage or not
6160
if: ${{ matrix.php-versions != '7.4' || matrix.operating-system != 'ubuntu-latest' }}
6261
run: |
63-
echo "NO_COVERAGE=--no-coverage" >> $GITHUB_ENV
62+
echo "NO_COVERAGE=--no-coverage" >> "$GITHUB_ENV"
6463
6564
- name: Run unit tests
6665
run: |
@@ -90,8 +89,7 @@ jobs:
9089
- uses: actions/checkout@v4
9190

9291
- name: Get composer cache directory
93-
id: composer-cache
94-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
92+
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
9593

9694
- name: Cache composer dependencies
9795
uses: actions/cache@v4
@@ -130,8 +128,7 @@ jobs:
130128
- uses: actions/checkout@v4
131129

132130
- name: Get composer cache directory
133-
id: composer-cache
134-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
131+
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
135132

136133
- name: Cache composer dependencies
137134
uses: actions/cache@v4
@@ -158,7 +155,7 @@ jobs:
158155
- name: Setup PHP, with composer and extensions
159156
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
160157
with:
161-
php-version: '7.4'
158+
php-version: '8.0'
162159
extensions: intl, ldap, mbstring, xml
163160
tools: composer:v2
164161

@@ -168,8 +165,7 @@ jobs:
168165
- uses: actions/checkout@v4
169166

170167
- name: Get composer cache directory
171-
id: composer-cache
172-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
168+
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
173169

174170
- name: Cache composer dependencies
175171
uses: actions/cache@v4
@@ -199,7 +195,7 @@ jobs:
199195

200196
- name: Psalm
201197
continue-on-error: true
202-
uses: docker://vimeo/psalm-github-actions
198+
run: php vendor/bin/psalm
203199

204200
- name: Psalter
205201
continue-on-error: true

lib/Auth/Ldap.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,8 +618,12 @@ public function setOption($option, $value): void
618618
* The array of attributes and their values.
619619
* @see http://no.php.net/manual/en/function.ldap-read.php
620620
*/
621-
public function getAttributes(string $dn, $attributes = null, array $binaryAttributes = [], int $maxsize = null): array
622-
{
621+
public function getAttributes(
622+
string $dn,
623+
$attributes = null,
624+
array $binaryAttributes = [],
625+
int $maxsize = null
626+
): array {
623627
// Preparations, including a pretty debug message...
624628
$description = 'all attributes';
625629
if (is_array($attributes)) {

phpunit.xml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache">
3-
<coverage>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" bootstrap="./tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3+
<coverage processUncoveredFiles="true">
4+
<include>
5+
<directory suffix=".php">./lib</directory>
6+
</include>
47
<report>
58
<clover outputFile="build/logs/clover.xml"/>
69
<html outputDirectory="build/coverage" lowUpperBound="35" highLowerBound="70"/>
710
<text outputFile="php://stdout" showUncoveredFiles="true"/>
811
</report>
912
</coverage>
1013
<testsuites>
11-
<testsuite name="The project's test suite">
14+
<testsuite name="Unit tests">
1215
<directory>./vendor/simplesamlphp/simplesamlphp-test-framework/src</directory>
1316
<directory>./tests</directory>
1417
</testsuite>
1518
</testsuites>
1619
<logging/>
17-
<source>
18-
<include>
19-
<directory suffix=".php">./lib</directory>
20-
</include>
21-
</source>
2220
</phpunit>

0 commit comments

Comments
 (0)