Skip to content

Conversation

@joshtrichards
Copy link
Member

@joshtrichards joshtrichards commented Dec 11, 2025

  • Resolves: #

Summary

Mimetype handling fixes/improvements

  • Fixes a bug in the file_get_contents() stub within the testVerifyCoreSignatureWithModifiedMimetypelistSignatureData() test that was returning a null value and passing (false negative test)
  • Fixes a bug the MimeTypeDetector stub within the same test that wasn't decoding json in the same manner as implementation (false positive test / though it was covered by the prior bug)
  • Uses a willReturnCallback for file_get_contents that throws on unexpected paths — this makes missing entries fail fast and avoids accidental nulls

General IntegrityCheck unit tests improvements

  • Moves universal stubs to setUp() to reduce duplicate code
  • Drops the unused getAppValue() stub from setUp()
  • Adds createRsaAndX509() helper to reduce boilerplate
  • Adds expectSignaturePutContents)_ je;[er tp replace repetitive file_put_contents boilerplate

TODO

  • ...

Checklist

@joshtrichards joshtrichards changed the title Jtr/test checkertest streamline test: refactor CheckerTest to drop duplicate code Dec 11, 2025
- Many tests use the same stubs; move them to setUp() while still supporting custom stubs/expectations within individual tests that require it
- Drop the unused getAppValue stub from setUp

Signed-off-by: Josh <[email protected]>
Refactored tests to use createRsaAndX509 helper method for loading certificates and keys, improving code reuse and readability.

Signed-off-by: Josh <[email protected]>
Signed-off-by: Josh <[email protected]>
Change expects()->method() to method() when overriding setUp() stubs to avoid PHPUnit mock expectation conflicts.

Signed-off-by: Josh <[email protected]>
Signed-off-by: Josh <[email protected]>
Signed-off-by: Josh <[email protected]>
Signed-off-by: Josh <[email protected]>
Signed-off-by: Josh <[email protected]>
Signed-off-by: Josh <[email protected]>
Signed-off-by: Josh <[email protected]>
@joshtrichards joshtrichards force-pushed the jtr/test-checkertest-streamline branch from 72ff218 to 726f5ad Compare December 26, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants