From 1074a9e2a30c050a0fcb749758515bf7057b53cc Mon Sep 17 00:00:00 2001 From: Tim van Dijen <tvdijen@gmail.com> Date: Sun, 14 Jul 2019 18:31:26 +0200 Subject: [PATCH] Fix MissingParamType --- tests/lib/SimpleSAML/Metadata/SAMLParserTest.php | 6 ++++-- tests/lib/SimpleSAML/Store/RedisTest.php | 15 ++++++++++++--- tests/lib/SimpleSAML/Store/SQLTest.php | 6 ++++-- tests/lib/SimpleSAML/StoreTest.php | 2 ++ tests/lib/SimpleSAML/Utils/EMailTestCase.php | 1 + tests/lib/SimpleSAML/Utils/SystemTest.php | 5 ++++- tests/lib/SimpleSAML/XML/SignerTest.php | 12 ++++++++---- .../saml/lib/Auth/Source/Auth_Source_SP_Test.php | 5 ++++- tests/www/IndexTest.php | 3 ++- 9 files changed, 41 insertions(+), 14 deletions(-) diff --git a/tests/lib/SimpleSAML/Metadata/SAMLParserTest.php b/tests/lib/SimpleSAML/Metadata/SAMLParserTest.php index d7e6ef153..78e15b5a2 100644 --- a/tests/lib/SimpleSAML/Metadata/SAMLParserTest.php +++ b/tests/lib/SimpleSAML/Metadata/SAMLParserTest.php @@ -6,8 +6,8 @@ require_once(__DIR__.'/../../../SigningTestCase.php'); use PHPUnit\Framework\TestCase; use RobRichards\XMLSecLibs\XMLSecurityDSig; -use \SimpleSAML\XML\Signer; -use \SimpleSAML\Metadata\SAMLParser; +use SimpleSAML\XML\Signer; +use SimpleSAML\Metadata\SAMLParser; /** * Test SAML parsing @@ -173,6 +173,8 @@ XML /** + * @param string $algo + * @param string $expected_fingerprint * @return void */ public function _testValidateFingerprint($algo, $expected_fingerprint) diff --git a/tests/lib/SimpleSAML/Store/RedisTest.php b/tests/lib/SimpleSAML/Store/RedisTest.php index cc59a69b7..db6f31cdd 100644 --- a/tests/lib/SimpleSAML/Store/RedisTest.php +++ b/tests/lib/SimpleSAML/Store/RedisTest.php @@ -3,8 +3,8 @@ namespace SimpleSAML\Test\Store; use PHPUnit\Framework\TestCase; -use \SimpleSAML\Configuration; -use \SimpleSAML\Store; +use SimpleSAML\Configuration; +use SimpleSAML\Store; /** * Tests for the Redis store. @@ -52,7 +52,8 @@ class RedisTest extends TestCase /** - * @return \Predis\Client + * @param string $key + * @return \Predis\Client */ public function getMocked($key) { @@ -61,6 +62,8 @@ class RedisTest extends TestCase /** + * @param string $key + * @param mixed $value * @return void */ public function setMocked($key, $value) @@ -70,6 +73,9 @@ class RedisTest extends TestCase /** + * @param string $key + * @param int $expire + * @param mixed $value * @return void */ public function setexMocked($key, $expire, $value) @@ -80,6 +86,7 @@ class RedisTest extends TestCase /** + * @param string $key * @return void */ public function delMocked($key) @@ -220,6 +227,8 @@ class RedisTest extends TestCase /** + * @param \SimpleSAML\Configuration|\SimpleSAML\Store $service + * @param string $className * @return void */ protected function clearInstance($service, $className) diff --git a/tests/lib/SimpleSAML/Store/SQLTest.php b/tests/lib/SimpleSAML/Store/SQLTest.php index f9545575c..bff22681a 100644 --- a/tests/lib/SimpleSAML/Store/SQLTest.php +++ b/tests/lib/SimpleSAML/Store/SQLTest.php @@ -3,8 +3,8 @@ namespace SimpleSAML\Test\Store; use PHPUnit\Framework\TestCase; -use \SimpleSAML\Configuration; -use \SimpleSAML\Store; +use SimpleSAML\Configuration; +use SimpleSAML\Store; /** * Tests for the SQL store. @@ -207,6 +207,8 @@ class SQLTest extends TestCase /** + * @param \SimpleSAML\Configuration|\SimpleSAML\Store $service + * @param string $className * @return void */ protected function clearInstance($service, $className) diff --git a/tests/lib/SimpleSAML/StoreTest.php b/tests/lib/SimpleSAML/StoreTest.php index 0b12b9657..756a53382 100644 --- a/tests/lib/SimpleSAML/StoreTest.php +++ b/tests/lib/SimpleSAML/StoreTest.php @@ -138,6 +138,8 @@ class StoreTest extends TestCase /** + * @param \SimpleSAML\Configuration|\SimpleSAML\Store $service + * @param string $className * @return void */ protected function clearInstance($service, $className) diff --git a/tests/lib/SimpleSAML/Utils/EMailTestCase.php b/tests/lib/SimpleSAML/Utils/EMailTestCase.php index be6fe955d..a79a60e03 100644 --- a/tests/lib/SimpleSAML/Utils/EMailTestCase.php +++ b/tests/lib/SimpleSAML/Utils/EMailTestCase.php @@ -63,6 +63,7 @@ class EMailTestCase extends ClearStateTestCase /** * Test that the data given is visible in the resulting mail * @dataProvider mailTemplates + * @param string $template * @return void */ public function testMailContents($template) diff --git a/tests/lib/SimpleSAML/Utils/SystemTest.php b/tests/lib/SimpleSAML/Utils/SystemTest.php index e64ef4d8a..8b98c6300 100644 --- a/tests/lib/SimpleSAML/Utils/SystemTest.php +++ b/tests/lib/SimpleSAML/Utils/SystemTest.php @@ -296,6 +296,7 @@ class SystemTest extends TestCase /** + * @param string $directory * @return \SimpleSAML\Configuration */ private function setConfigurationTempDir($directory) @@ -309,9 +310,11 @@ class SystemTest extends TestCase /** + * @param \SimpleSAML\Configuration $service + * @param string $className * @return void */ - protected function clearInstance($service, $className) + protected function clearInstance(Configuration $service, $className) { $reflectedClass = new \ReflectionClass($className); $reflectedInstance = $reflectedClass->getProperty('instance'); diff --git a/tests/lib/SimpleSAML/XML/SignerTest.php b/tests/lib/SimpleSAML/XML/SignerTest.php index 70c4f1faa..82b56876c 100644 --- a/tests/lib/SimpleSAML/XML/SignerTest.php +++ b/tests/lib/SimpleSAML/XML/SignerTest.php @@ -5,9 +5,9 @@ namespace SimpleSAML\Test\XML; require_once(__DIR__.'/../../../SigningTestCase.php'); use PHPUnit\Framework\TestCase; -use \SimpleSAML\Configuration; -use \SimpleSAML\Test\SigningTestCase; -use \SimpleSAML\XML\Signer; +use SimpleSAML\Configuration; +use SimpleSAML\Test\SigningTestCase; +use SimpleSAML\XML\Signer; use \org\bovigo\vfs\vfsStream; @@ -96,6 +96,7 @@ NOWDOC; /** + * @param string $certificate * @return string */ private static function getCertificateValue($certificate) @@ -187,9 +188,12 @@ NOWDOC; /** + * @param \SimpleSAML\Configuration $service + * @param string $className + * @param mixed|null $value * @return void */ - protected function clearInstance($service, $className, $value = null) + protected function clearInstance(Configuration $service, $className, $value = null) { $reflectedClass = new \ReflectionClass($className); $reflectedInstance = $reflectedClass->getProperty('instance'); diff --git a/tests/modules/saml/lib/Auth/Source/Auth_Source_SP_Test.php b/tests/modules/saml/lib/Auth/Source/Auth_Source_SP_Test.php index aed55681f..29549d283 100644 --- a/tests/modules/saml/lib/Auth/Source/Auth_Source_SP_Test.php +++ b/tests/modules/saml/lib/Auth/Source/Auth_Source_SP_Test.php @@ -20,9 +20,10 @@ class ExitTestException extends \Exception /** + * @param array $testResult * @return void */ - public function __construct($testResult) + public function __construct(array $testResult) { parent::__construct("ExitTestException", 0, null); $this->testResult = $testResult; @@ -47,6 +48,8 @@ class ExitTestException extends \Exception class SPTester extends \SimpleSAML\Module\saml\Auth\Source\SP { /** + * @param array $info + * @param array $config * @return void */ public function __construct($info, $config) diff --git a/tests/www/IndexTest.php b/tests/www/IndexTest.php index e0da79a34..7d082b701 100644 --- a/tests/www/IndexTest.php +++ b/tests/www/IndexTest.php @@ -55,9 +55,10 @@ class IndexTest extends TestCase /** + * @param array $config * @return void */ - protected function updateConfig($config) + protected function updateConfig(array $config) { @unlink($this->shared_file); $config = "<?php\n\$config = ".var_export($config, true).";\n"; -- GitLab