codeigniter4 / shield

Authentication and Authorization for CodeIgniter 4

Home Page:https://shield.codeigniter.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dev: phpunit 15 risky & 3 failures tests

datamweb opened this issue · comments

see https://github.com/codeigniter4/shield/actions/runs/5984579479/job/16235976345?pr=801

There were 15 risky tests:

1) Tests\Authentication\Filters\PermissionFilterTest::testFilterNotAuthorized
Test code or tested code did not (only) close its own output buffers

2) Tests\Authentication\Filters\PermissionFilterTest::testFilterIncorrectGroupNoPrevious
Test code or tested code did not (only) close its own output buffers

3) Tests\Controllers\ActionsTest::testEmailActivateCannotBeBypassed
Test code or tested code did not (only) close its own output buffers

4) Tests\Controllers\ActionsTest::testEmail2FACannotBeBypassed
Test code or tested code did not (only) close its own output buffers

5) Tests\Authentication\Filters\ChainFilterTest::testFilterNotAuthorized
Test code or tested code did not (only) close its own output buffers

6) Tests\Authentication\ForcePasswordResetTest::testRequiresPasswordResetRedirect
Test code or tested code did not (only) close its own output buffers

7) Tests\Authentication\Filters\GroupFilterTest::testFilterNotAuthorized
Test code or tested code did not (only) close its own output buffers

8) Tests\Authentication\Filters\GroupFilterTest::testFilterIncorrectGroupNoPrevious
Test code or tested code did not (only) close its own output buffers

9) Tests\Authentication\Filters\JWTFilterTest::testFilterNotAuthorized
Test code or tested code did not (only) close its own output buffers

10) Tests\Authentication\Filters\TokenFilterTest::testBlocksInactiveUsers
Test code or tested code did not (only) close its own output buffers

11) Tests\Authentication\Filters\TokenFilterTest::testFilterNotAuthorized
Test code or tested code did not (only) close its own output buffers

12) Tests\Authentication\Filters\TokenFilterTest::testFiltersProtectsWithScopes
Test code or tested code did not (only) close its own output buffers

13) Tests\Authentication\Filters\SessionFilterTest::testBlocksInactiveUsers
Test code or tested code did not (only) close its own output buffers

14) Tests\Authentication\Filters\SessionFilterTest::testStoreRedirectsToEntraceUrlIntoSession
Test code or tested code did not (only) close its own output buffers

15) Tests\Authentication\Filters\SessionFilterTest::testFilterNotAuthorized
Test code or tested code did not (only) close its own output buffers

The following appear to be affected by Merger #796 .

There was 1 error:

1) Tests\Unit\Authentication\JWT\JWTManagerTest::testParseCanSpecifyKey
ErrorException: Undefined array key "mobile"

/home/runner/work/shield/shield/src/Authentication/JWT/Adapters/FirebaseAdapter.php:145
/home/runner/work/shield/shield/src/Authentication/JWT/Adapters/FirebaseAdapter.php:112
/home/runner/work/shield/shield/src/Authentication/JWT/JWSEncoder.php:62
/home/runner/work/shield/shield/src/Authentication/JWTManager.php:[73](https://github.com/codeigniter4/shield/actions/runs/5984579479/job/16235976345?pr=801#step:11:74)
/home/runner/work/shield/shield/tests/Unit/Authentication/JWT/JWTManagerTest.php:311

--

There were 3 failures:

1) Tests\Unit\Authentication\JWT\JWTManagerTest::testIssueWithAsymmetricKey
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
 Array &0 (
     'typ' => 'JWT'
-    'alg' => 'RS256'
+    'alg' => 'HS256'
 )

/home/runner/work/shield/shield/tests/Unit/Authentication/JWT/JWTManagerTest.php:227

2) Tests\Unit\Authentication\JWT\JWTManagerTest::testIssueSetKid
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
 Array &0 (
     'typ' => 'JWT'
     'alg' => 'HS256'
-    'kid' => 'Key01'
 )

/home/runner/work/shield/shield/tests/Unit/Authentication/JWT/JWTManagerTest.php:151

3) Tests\Unit\Authentication\JWT\Adapters\FirebaseAdapaterTest::testEncodeLogicExceptionLogicException
Failed asserting that exception of type "CodeIgniter\Shield\Exceptions\LogicException" is thrown.

--
commented

The risky tests seem to be caused by v4.4.0.

CodeIgniter 4.4.1 released, all issues fixed.

@kenjis thank you!