Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Apr 7, 2024
1 parent 876139b commit f0f9d10
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
php-version: '8.3'
tools: composer, composer-require-checker, composer-unused, phpcs, psalm
# optional performance gain for psalm: opcache
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, opcache, openssl, pcre, spl, xml
extensions: ctype, date, dom, fileinfo, filter, hash, intl, ldap, mbstring, opcache, openssl, pcre, spl, xml

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
with:
# Should be the lowest supported version
php-version: '8.1'
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, spl, xml
extensions: ctype, date, dom, fileinfo, filter, hash, intl, ldap, mbstring, openssl, pcre, spl, xml
tools: composer
coverage: none

Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, spl, xml
extensions: ctype, date, dom, fileinfo, filter, hash, intl, ldap, mbstring, openssl, pcre, spl, xml
tools: composer
ini-values: error_reporting=E_ALL
coverage: pcov
Expand Down Expand Up @@ -228,7 +228,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, spl, xml
extensions: ctype, date, dom, fileinfo, filter, hash, intl, ldap, mbstring, openssl, pcre, spl, xml
tools: composer
ini-values: error_reporting=E_ALL
coverage: none
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"simplesamlphp/simplesamlphp": "^2.2",
"simplesamlphp/simplesamlphp-module-ldap": "^2.2",
"symfony/http-foundation": "^6.4",
"symfony/security-bundle": "^6.4"
"symfony/ldap": "^6.4"
},
"require-dev": {
"simplesamlphp/simplesamlphp-test-framework": "^1.6.0"
Expand Down
27 changes: 27 additions & 0 deletions psalm-dev.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<psalm
name="SimpleSAMLphp testsuite"
useDocblockTypes="true"
errorLevel="4"
reportMixedIssues="false"
hideExternalErrors="true"
allowStringToStandInForClass="true"
>
<projectFiles>
<directory name="tests" />

<!-- Ignore certain directories -->
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>

<issueHandlers>
<!-- Ignore UnresolvableInclude on CLI-scripts -->
<UnresolvableInclude>
<errorLevel type="suppress">
<file name="tests/bootstrap.php" />
</errorLevel>
</UnresolvableInclude>
</issueHandlers>
</psalm>
3 changes: 1 addition & 2 deletions src/Auth/Source/X509userCert.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@
use Symfony\Component\Ldap\Security\LdapUserProvider;
use Symfony\Component\Security\Core\Exception\UserNotFoundException;

use function array_key_exists;
use function array_fill_keys;
use function array_key_exists;
use function array_merge;
use function array_values;
use function current;
use function openssl_x509_parse;
use function sprintf;
use function str_replace;

/**
* This class implements x509 certificate authentication with certificate validation against an LDAP directory.
Expand Down
File renamed without changes.
5 changes: 4 additions & 1 deletion tools/composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"symbol-whitelist": [
"SimpleSAML\\Module\\ldap\\ConfigHelper"
"SimpleSAML\\Module\\ldap\\ConfigHelper",
"SimpleSAML\\Module\\ldap\\ConnectorFactory",
"SimpleSAML\\Module\\ldap\\ConnectorInterface",
"Symfony\\Component\\Security\\Core\\Exception\\UserNotFoundException"
]
}

0 comments on commit f0f9d10

Please sign in to comment.