Skip to content

Conversation

@ptondereau
Copy link
Member

Description

Fixes panics when PHPUnit mocks or subclasses don't call the parent constructor.

  • Add the default_init() trait method for types deriving Default
  • Fall back to standard PHP handlers for uninitialized objects
  • Add from_zend_obj_mut_uninit for constructor access
  • Check the handler's pointer to reject non-native objects

@coveralls
Copy link

Pull Request Test Coverage Report for Build 21368712391

Details

  • 8 of 64 (12.5%) changed or added relevant lines in 6 files are covered.
  • 8 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.1%) to 35.363%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/class.rs 0 2 0.0%
src/zend/ex.rs 0 2 0.0%
crates/macros/src/class.rs 8 12 66.67%
src/builders/class.rs 0 4 0.0%
src/types/class_object.rs 0 13 0.0%
src/zend/handlers.rs 0 31 0.0%
Files with Coverage Reduction New Missed Lines %
src/types/class_object.rs 1 0.0%
src/zend/handlers.rs 7 0.0%
Totals Coverage Status
Change from base Build 21336425804: -0.1%
Covered Lines: 1911
Relevant Lines: 5404

💛 - Coveralls

@ptondereau ptondereau marked this pull request as ready for review January 26, 2026 18:59
@ptondereau ptondereau merged commit 9512e77 into master Jan 26, 2026
159 of 190 checks passed
@ptondereau ptondereau deleted the fix/mock-unint branch January 26, 2026 19:06
@Xenira Xenira mentioned this pull request Jan 25, 2026
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.

3 participants