phpunit test fixes

This commit is contained in:
Clemens Schwaighofer
2023-02-24 09:43:24 +09:00
parent da67d1bde3
commit 7cae3e701a
10 changed files with 49 additions and 36 deletions

View File

@@ -1,9 +1,11 @@
#!/bin/env bash
base="/storage/var/www/html/developers/clemens/core_data/php_libraries/trunk/"; base="/storage/var/www/html/developers/clemens/core_data/php_libraries/trunk/";
# -c phpunit.xml # -c phpunit.xml
# --testdox # --testdox
# call with "t" to give verbose testdox output # call with "t" to give verbose testdox output
# SUPPORTED: https://www.php.net/supported-versions.php # SUPPORTED: https://www.php.net/supported-versions.php
# call with 7.4, 8.0, 8.1 to force a certain php version # call with php version number to force a certain php version
opt_testdox=""; opt_testdox="";
if [ "${1}" = "t" ] || [ "${2}" = "t" ]; then if [ "${1}" = "t" ] || [ "${2}" = "t" ]; then

View File

@@ -712,12 +712,23 @@ final class CoreLibsCombinedArrayHandlerTest extends TestCase
*/ */
public function testArrayMergeRecursiveWarningA(): void public function testArrayMergeRecursiveWarningA(): void
{ {
set_error_handler(
static function (int $errno, string $errstr): never {
throw new Exception($errstr, $errno);
},
E_USER_WARNING
);
$arrays = func_get_args(); $arrays = func_get_args();
// first is expected warning // first is expected warning
$warning = array_shift($arrays); $warning = array_shift($arrays);
$this->expectWarning();
$this->expectWarningMessage($warning); // phpunit 10.0 compatible
$this->expectExceptionMessage(($warning));
\CoreLibs\Combined\ArrayHandler::arrayMergeRecursive(...$arrays); \CoreLibs\Combined\ArrayHandler::arrayMergeRecursive(...$arrays);
restore_error_handler();
} }
/** /**

View File

@@ -3456,7 +3456,7 @@ final class CoreLibsDBIOTest extends TestCase
'id' => '51', 'id' => '51',
'error' => 'Max query call needs to be set to at least 1', 'error' => 'Max query call needs to be set to at least 1',
// run:: can be +1 if called in set and not direct // run:: can be +1 if called in set and not direct
'source' => "/^main::run::run::run::run::run::run::(run::)?runBare::runTest::testDbErrorHandling::dbSetMaxQueryCall$/", 'source' => "/^include::main::run::run::run::run::run::run::(run::)?runBare::runTest::testDbErrorHandling::dbSetMaxQueryCall$/",
'pg_error' => '', 'pg_error' => '',
'msg' => '', 'msg' => '',
] ]

View File

@@ -393,7 +393,7 @@ final class CoreLibsDebugSupportTest extends TestCase
* Undocumented function * Undocumented function
* *
* @cover ::getCallerMethodList * @cover ::getCallerMethodList
* @testWith [["main", "run", "run", "run", "run", "run", "run", "runBare", "runTest", "testGetCallerMethodList"],["main", "run", "run", "run", "run", "run", "run", "run", "runBare", "runTest", "testGetCallerMethodList"]] * @testWith [["main", "run", "run", "run", "run", "run", "run", "runBare", "runTest", "testGetCallerMethodList"],["include", "main", "run", "run", "run", "run", "run", "run", "run", "runBare", "runTest", "testGetCallerMethodList"]]
* @testdox getCallerMethodList check if it returns $expected [$_dataName] * @testdox getCallerMethodList check if it returns $expected [$_dataName]
* *
* @param array $expected * @param array $expected

12
composer.lock generated
View File

@@ -612,16 +612,16 @@
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "1.10.0", "version": "1.10.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan.git", "url": "https://github.com/phpstan/phpstan.git",
"reference": "71b28a67f01ac231f9a8f1ce242270bf4ec1f99c" "reference": "a2ffec7db373d8da4973d1d62add872db5cd22dd"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/71b28a67f01ac231f9a8f1ce242270bf4ec1f99c", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a2ffec7db373d8da4973d1d62add872db5cd22dd",
"reference": "71b28a67f01ac231f9a8f1ce242270bf4ec1f99c", "reference": "a2ffec7db373d8da4973d1d62add872db5cd22dd",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -651,7 +651,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/phpstan/phpstan/issues", "issues": "https://github.com/phpstan/phpstan/issues",
"source": "https://github.com/phpstan/phpstan/tree/1.10.0" "source": "https://github.com/phpstan/phpstan/tree/1.10.2"
}, },
"funding": [ "funding": [
{ {
@@ -667,7 +667,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-02-21T13:50:49+00:00" "time": "2023-02-23T14:36:46+00:00"
}, },
{ {
"name": "psr/container", "name": "psr/container",

View File

@@ -635,17 +635,17 @@
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "1.10.0", "version": "1.10.2",
"version_normalized": "1.10.0.0", "version_normalized": "1.10.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan.git", "url": "https://github.com/phpstan/phpstan.git",
"reference": "71b28a67f01ac231f9a8f1ce242270bf4ec1f99c" "reference": "a2ffec7db373d8da4973d1d62add872db5cd22dd"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/71b28a67f01ac231f9a8f1ce242270bf4ec1f99c", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a2ffec7db373d8da4973d1d62add872db5cd22dd",
"reference": "71b28a67f01ac231f9a8f1ce242270bf4ec1f99c", "reference": "a2ffec7db373d8da4973d1d62add872db5cd22dd",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -654,7 +654,7 @@
"conflict": { "conflict": {
"phpstan/phpstan-shim": "*" "phpstan/phpstan-shim": "*"
}, },
"time": "2023-02-21T13:50:49+00:00", "time": "2023-02-23T14:36:46+00:00",
"bin": [ "bin": [
"phpstan", "phpstan",
"phpstan.phar" "phpstan.phar"
@@ -677,7 +677,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/phpstan/phpstan/issues", "issues": "https://github.com/phpstan/phpstan/issues",
"source": "https://github.com/phpstan/phpstan/tree/1.10.0" "source": "https://github.com/phpstan/phpstan/tree/1.10.2"
}, },
"funding": [ "funding": [
{ {

View File

@@ -3,7 +3,7 @@
'name' => '__root__', 'name' => '__root__',
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'reference' => '16c3653ceefd43b6d150bbce587d230fb2f0f3b6', 'reference' => 'da67d1bde3260de1ef8d778f5d75f4e2c60de869',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
@@ -13,7 +13,7 @@
'__root__' => array( '__root__' => array(
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'reference' => '16c3653ceefd43b6d150bbce587d230fb2f0f3b6', 'reference' => 'da67d1bde3260de1ef8d778f5d75f4e2c60de869',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
@@ -110,9 +110,9 @@
'dev_requirement' => true, 'dev_requirement' => true,
), ),
'phpstan/phpstan' => array( 'phpstan/phpstan' => array(
'pretty_version' => '1.10.0', 'pretty_version' => '1.10.2',
'version' => '1.10.0.0', 'version' => '1.10.2.0',
'reference' => '71b28a67f01ac231f9a8f1ce242270bf4ec1f99c', 'reference' => 'a2ffec7db373d8da4973d1d62add872db5cd22dd',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../phpstan/phpstan', 'install_path' => __DIR__ . '/../phpstan/phpstan',
'aliases' => array(), 'aliases' => array(),

Binary file not shown.

View File

@@ -1,16 +1,16 @@
-----BEGIN PGP SIGNATURE----- -----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE0yaA1ZV9xxFr4pwUzxoQjQ565yAFAmP0zCIACgkQzxoQjQ56 iQIzBAABCgAdFiEE0yaA1ZV9xxFr4pwUzxoQjQ565yAFAmP3eecACgkQzxoQjQ56
5yDVPBAAjOsIlFKSsJGP+LXYuQ/lhBuwigOxj6SM6ZLTBPB6MGKKTyPqXayF0Js8 5yAH6A//R+CaBjUmbQhmamLiYATpskxv25DC/BQQ1+aK5sz8IlKcxPViN3Ke9QAq
qZV0XxKbHN3RxeM0L4E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