Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev: phpunit 15 risky & 3 failures tests #802

Closed
datamweb opened this issue Aug 26, 2023 · 4 comments
Closed

Dev: phpunit 15 risky & 3 failures tests #802

datamweb opened this issue Aug 26, 2023 · 4 comments
Labels

Comments

@datamweb
Copy link
Collaborator

datamweb commented Aug 26, 2023

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
@datamweb datamweb added the dev label Aug 26, 2023
@datamweb datamweb changed the title Dev: phpunit 15 risky tests Dev: phpunit 15 risky & 3 failures tests Aug 26, 2023
@datamweb
Copy link
Collaborator Author

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.

--

@kenjis
Copy link
Member

kenjis commented Aug 26, 2023

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

@kenjis
Copy link
Member

kenjis commented Aug 27, 2023

I sent PR to fix: codeigniter4/CodeIgniter4#7867

@datamweb
Copy link
Collaborator Author

datamweb commented Sep 5, 2023

CodeIgniter 4.4.1 released, all issues fixed.

@kenjis thank you!

@datamweb datamweb closed this as completed Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants