Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.3', '8.4', '8.5']
php-version: ['8.3', '8.4', '8.5']

uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.6
with:
Expand All @@ -44,7 +44,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.2', '8.3', '8.4', '8.5']
php-versions: ['8.3', '8.4', '8.5']

steps:
- name: Setup PHP, with composer and extensions
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
fail-fast: true
matrix:
operating-system: [windows-latest]
php-versions: ['8.2', '8.3', '8.4', '8.5']
php-versions: ['8.3', '8.4', '8.5']

steps:
- name: Setup PHP, with composer and extensions
Expand Down Expand Up @@ -225,7 +225,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
# Should be the lowest supported version
php-version: '8.2'
php-version: '8.3'
extensions: ctype, date, dom, filter, hash, intl, mbstring, openssl, pcre, spl, xml
tools: composer
coverage: none
Expand Down
25 changes: 3 additions & 22 deletions .github/workflows/reusable_phplinter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on: # yamllint disable-line rule:truthy
default: ${{ github.ref }}

env:
supported: '["7.4", "8.0", "8.1", "8.2", "8.3", "8.4", "8.5"]'
supported: '["8.3", "8.4", "8.5"]'

jobs:
linter:
Expand All @@ -45,29 +45,10 @@ jobs:
coverage: "none"
extensions: :redis

- name: Install overtrue/phplint (v3.4)
if: inputs.php-version == '7.4'
- name: Install overtrue/phplint (v9.7)
run: |
sleep $((random % 10))
phive install overtrue/phplint@~3.4.0 --force-accept-unsigned --target ./bin

- name: Install overtrue/phplint (v4.5)
if: inputs.php-version == '8.0'
run: |
sleep $((random % 10))
phive install overtrue/phplint@~4.5.0 --force-accept-unsigned --target ./bin

- name: Install overtrue/phplint (v9.4)
if: inputs.php-version == '8.1'
run: |
sleep $((random % 10))
phive install overtrue/phplint@~9.4.0 --force-accept-unsigned --target ./bin

- name: Install overtrue/phplint (v9.6)
if: inputs.php-version != '7.4' && inputs.php-version != '8.0' && inputs.php-version != '8.1'
run: |
sleep $((random % 10))
phive install overtrue/phplint@~9.6.0 --force-accept-unsigned --target ./bin
phive install overtrue/phplint@~9.7.1 --force-accept-unsigned --target ./bin

- name: Lint PHP files
run: |
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@
}
},
"require": {
"php": "^8.2",
"php": "^8.3",
"ext-curl": "*",

"icanhazstring/composer-unused": "^0.9",
"maglnet/composer-require-checker": "^4",
"maglnet/composer-require-checker": "^4.19",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-mockery": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpunit/phpunit": "^11.5 || ^12.3",
"phpunit/phpunit": "^12.3",
"psr/log": "^3.0",
"slevomat/coding-standard": "^8.20",
"slevomat/coding-standard": "^8.25",
"squizlabs/php_codesniffer": "^4.0",
"symfony/phpunit-bridge": "^7.3 || ^8.0"
"symfony/phpunit-bridge": "^8.0"
},
"require-dev": {
"simplesamlphp/simplesamlphp": "^2.5@dev"
Expand Down
2 changes: 1 addition & 1 deletion lib/ArrayLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use SimpleSAML\Logger\LoggingHandlerInterface;

/**
* @deprecated - superseeded by PSR-3 compliant SimpleTestLogger
*/
class ArrayLogger implements LoggingHandlerInterface
{
Expand All @@ -18,6 +17,7 @@ class ArrayLogger implements LoggingHandlerInterface
public array $logs = [];


#[\Deprecated('Superseeded by PSR-3 compliant SimpleTestLogger', '20-05-2023')]
public function __construct(Configuration $config)
{
// don't do anything with the configuration
Expand Down
18 changes: 4 additions & 14 deletions lib/BuiltInServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,23 @@ class BuiltInServer
{
/**
* The PID of the running server.
*
* @var int
*/
protected $pid = 0;
protected int $pid = 0;

/**
* The address (host:port) where the server is listening for connections after being started.
*
* @var string
*/
protected $address = 'example.org';
protected string $address = 'example.org';

/**
* The name of a "router" file to run for every request performed to this server.
*
* @var string
*/
protected $router = '';
protected string $router = '';

/**
* The document root of the server.
*
* @var string
*/
protected $docroot;
protected string $docroot;


/**
Expand Down Expand Up @@ -158,7 +150,6 @@ public function start(): string

/**
* Stop the built-in server.
* @return void
*/
public function stop(): void
{
Expand Down Expand Up @@ -200,7 +191,6 @@ public function getRouter(): string
* Set the "router" file.
*
* @param string $router The name of a "router" file to use when starting the server.
* @return void
*/
public function setRouter(string $router): void
{
Expand Down
7 changes: 1 addition & 6 deletions lib/ClearStateTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ class ClearStateTestCase extends TestCase
{
/**
* Used for managing and clearing state
* @var \SimpleSAML\TestUtils\StateClearer|null
*/
protected static $stateClearer = null;
protected static ?StateClearer $stateClearer = null;


/**
* @return void
*/
public static function setUpBeforeClass(): void
{
Expand All @@ -31,7 +29,6 @@ public static function setUpBeforeClass(): void


/**
* @return void
*/
protected function setUp(): void
{
Expand All @@ -40,7 +37,6 @@ protected function setUp(): void


/**
* @return void
*/
public static function tearDownAfterClass(): void
{
Expand All @@ -50,7 +46,6 @@ public static function tearDownAfterClass(): void

/**
* Clear any SSP global state to reduce spill over between tests.
* @return void
*/
public static function clearState(): void
{
Expand Down
4 changes: 2 additions & 2 deletions lib/ReduceSpillOverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

/**
* Test that ensures state doesn't spill over between tests
*
* @package SimpleSAML\Test\Utils
*/
class ReduceSpillOverTest extends ClearStateTestCase
{
/**
* Set some global state
* @return void
*/
public function testSetState(): void
{
Expand All @@ -28,7 +28,7 @@ public function testSetState(): void

/**
* Confirm global state removed prior to next test
* @return void
*
* @throws \SimpleSAML\Error\ConfigurationError
*/
public function testStateRemoved(): void
Expand Down
37 changes: 11 additions & 26 deletions lib/SigningTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,31 @@
*/
class SigningTestCase extends TestCase
{
/** @var \SimpleSAML\Configuration */
protected $config;
protected Configuration $config;

/** @var string $root_directory */
protected $root_directory;
protected string $root_directory;

/** @var string $cert_directory */
protected $cert_directory = 'certificates/rsa-pem';
protected string $cert_directory = 'certificates/rsa-pem';

/** @var string $ca_private_key_file */
protected $ca_private_key_file = 'simplesamlphp.org-ca_nopasswd.key';
protected string $ca_private_key_file = 'simplesamlphp.org-ca_nopasswd.key';

/** @var string $ca_certificate_file */
protected $ca_certificate_file = 'simplesamlphp.org-ca.crt';
protected string $ca_certificate_file = 'simplesamlphp.org-ca.crt';

/** @var string $good_private_key_file */
protected $good_private_key_file = 'signed.simplesamlphp.org_nopasswd.key';
protected string $good_private_key_file = 'signed.simplesamlphp.org_nopasswd.key';

/** @var string $good_certificate_file */
protected $good_certificate_file = 'signed.simplesamlphp.org.crt';
protected string $good_certificate_file = 'signed.simplesamlphp.org.crt';

// openssl genrsa -out example.org-ca.key 1024
/** @var string $ca_private_key */
protected $ca_private_key;
protected string $ca_private_key;

// openssl req -key example.org-ca.key -new -x509 -days 36500 -out example.org-ca.crt
/** @var string $ca_certificate */
protected $ca_certificate;
protected string $ca_certificate;

// openssl genrsa -out signed.example.org.key 1024
/** @var string $good_private_key */
protected $good_private_key;
protected string $good_private_key;

// openssl req -key signed.example.org.key -new -out signed.example.org.crt
/** @var string $good_certificate */
protected $good_certificate;
protected string $good_certificate;


/**
Expand All @@ -69,7 +58,6 @@ public function __construct()


/**
* @return array
*/
public function getCertDirContent(): array
{
Expand All @@ -83,7 +71,6 @@ public function getCertDirContent(): array


/**
* @return void
*/
public function setUp(): void
{
Expand All @@ -94,7 +81,6 @@ public function setUp(): void


/**
* @return void
*/
public function tearDown(): void
{
Expand All @@ -106,7 +92,6 @@ public function tearDown(): void
* @param \SimpleSAML\Configuration $service
* @param class-string $className
* @param mixed|null $value
* @return void
*/
protected function clearInstance(Configuration $service, string $className, $value = null): void
{
Expand Down
7 changes: 0 additions & 7 deletions lib/SimpleTestLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
final class SimpleTestLogger extends AbstractLogger
{
/**
* @var array
*/
private array $messages = [];

Expand All @@ -27,8 +26,6 @@ final class SimpleTestLogger extends AbstractLogger
* @param mixed $level
* @param string|\Stringable $message
* @param mixed[] $context
*
* @return void
*/
public function log($level, string|Stringable $message, array $context = []): void
{
Expand All @@ -44,8 +41,6 @@ public function log($level, string|Stringable $message, array $context = []): vo
* Get all the messages logged at the specified level
*
* @param mixed $level
*
* @return array
*/
public function getMessagesForLevel($level): array
{
Expand All @@ -59,8 +54,6 @@ public function getMessagesForLevel($level): array
* Check if the given message exists within the log
*
* @param string|\Stringable $messageToFind
*
* @return bool
*/
public function hasMessage(string|Stringable $messageToFind): bool
{
Expand Down
Loading