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

assertObjectHasProperty() and assertObjectNotHasProperty() #5229 #5231

Closed
wants to merge 1 commit into from
Closed

assertObjectHasProperty() and assertObjectNotHasProperty() #5229 #5231

wants to merge 1 commit into from

Conversation

jasverix
Copy link
Contributor

@jasverix jasverix commented Feb 21, 2023

Fix #5220

@jasverix
Copy link
Contributor Author

Yeah, I havent used GitHub that much, so I managed to kill the old PR when squashing. But here is a squashed PR with passing CI's.

@codecov
Copy link

codecov bot commented Feb 21, 2023

Codecov Report

Merging #5231 (1623e66) into main (dddc9b5) will increase coverage by 0.02%.
The diff coverage is 94.11%.

@@             Coverage Diff              @@
##               main    #5231      +/-   ##
============================================
+ Coverage     81.30%   81.33%   +0.02%     
- Complexity     5853     5863      +10     
============================================
  Files           629      630       +1     
  Lines         18544    18578      +34     
============================================
+ Hits          15078    15110      +32     
- Misses         3466     3468       +2     
Impacted Files Coverage Δ
.../Framework/Constraint/Object/ObjectHasProperty.php 90.00% <90.00%> (ø)
src/Framework/Assert.php 92.93% <100.00%> (+0.13%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@sebastianbergmann sebastianbergmann added this to the PHPUnit 10.1 milestone Feb 23, 2023
@sebastianbergmann sebastianbergmann added feature/assertion Issues related to assertions and expectations type/enhancement A new idea that should be implemented labels Feb 23, 2023
@sebastianbergmann
Copy link
Owner

Merged manually, thanks.

jrfnl added a commit to jrfnl/phpunit that referenced this pull request Apr 1, 2023
…ute()

... now PHPUnit 10.1.0 introduces the `assertObjectHasProperty()` and `assertObjectNotHasProperty()` methods.

Refs:
* sebastianbergmann#5231
* sebastianbergmann@f18856c
sebastianbergmann pushed a commit that referenced this pull request Apr 11, 2023
…ute()

... now PHPUnit 10.1.0 introduces the `assertObjectHasProperty()` and `assertObjectNotHasProperty()` methods.

Refs:
* #5231
* f18856c
@jasverix jasverix deleted the feature/object-has-property branch April 12, 2023 11:35
jrfnl added a commit to Yoast/PHPUnit-Polyfills that referenced this pull request Apr 16, 2023
…tObject[Not]HasProperty() methods

PHPUnit 10.1.0 introduces the new `Assert::assertObjectHasProperty()` and `Assert::assertObjectNotHasProperty()` methods.

This commit:
* Adds two traits with the same name.
    One to polyfill the methods when not available in PHPUnit.
    The other - an empty trait - to allow for `use`-ing the trait in PHPUnit versions in which the methods are already natively available.
* Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used.
* An availability test and functional tests for the functionality polyfilled.

Includes:
* Adding the new polyfill to the existing `TestCases` classes.

Refs:
* sebastianbergmann/phpunit#5220
* sebastianbergmann/phpunit#5231 (and follow up commits/PRs)

Co-authored-by: Jan-Sverre Riksfjord <jasverix@gmail.com>
Co-authored-by: Sebastian Bergmann <sb@sebastian-bergmann.de>
jrfnl added a commit to Yoast/PHPUnit-Polyfills that referenced this pull request Aug 19, 2023
…ertObject[Not]HasProperty() methods

PHPUnit 10.1.0 introduced the new `Assert::assertObjectHasProperty()` and `Assert::assertObjectNotHasProperty()` methods.

These methods have now been backported to PHPUnit 9.6.11, so should be made available in the PHPUnit Polyfills 1.x series.

This commit:
* Adds two traits with the same name.
    One to polyfill the methods when not available in PHPUnit.
    The other - an empty trait - to allow for `use`-ing the trait in PHPUnit versions in which the methods are already natively available.
* Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used.
* An availability test and functional tests for the functionality polyfilled.

Includes:
* Adding the new polyfill to the existing `TestCases` classes.

Refs:
* sebastianbergmann/phpunit#5220
* sebastianbergmann/phpunit#5231 (and follow up commits/PRs)
* sebastianbergmann/phpunit#5478

Co-authored-by: Jan-Sverre Riksfjord <jasverix@gmail.com>
Co-authored-by: Sebastian Bergmann <sb@sebastian-bergmann.de>
jrfnl added a commit to Yoast/PHPUnit-Polyfills that referenced this pull request Aug 19, 2023
…ertObject[Not]HasProperty() methods

PHPUnit 10.1.0 introduced the new `Assert::assertObjectHasProperty()` and `Assert::assertObjectNotHasProperty()` methods.

These methods have now been backported to PHPUnit 9.6.11, so should be made available in the PHPUnit Polyfills 1.x series.

This commit:
* Adds two traits with the same name.
    One to polyfill the methods when not available in PHPUnit.
    The other - an empty trait - to allow for `use`-ing the trait in PHPUnit versions in which the methods are already natively available.
* Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used.
* An availability test and functional tests for the functionality polyfilled.

Includes:
* Adding the new polyfill to the existing `TestCases` classes.

Refs:
* sebastianbergmann/phpunit#5220
* sebastianbergmann/phpunit#5231 (and follow up commits/PRs)
* sebastianbergmann/phpunit#5478

Co-authored-by: Jan-Sverre Riksfjord <jasverix@gmail.com>
Co-authored-by: Sebastian Bergmann <sb@sebastian-bergmann.de>
jrfnl added a commit to Yoast/PHPUnit-Polyfills that referenced this pull request Aug 19, 2023
…ertObject[Not]HasProperty() methods

PHPUnit 10.1.0 introduced the new `Assert::assertObjectHasProperty()` and `Assert::assertObjectNotHasProperty()` methods.

These methods have now been backported to PHPUnit 9.6.11, so should be made available in the PHPUnit Polyfills 1.x series.

This commit:
* Adds two traits with the same name.
    One to polyfill the methods when not available in PHPUnit.
    The other - an empty trait - to allow for `use`-ing the trait in PHPUnit versions in which the methods are already natively available.
* Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used.
* An availability test and functional tests for the functionality polyfilled.

Includes:
* Adding the new polyfill to the existing `TestCases` classes.

Refs:
* sebastianbergmann/phpunit#5220
* sebastianbergmann/phpunit#5231 (and follow up commits/PRs)
* sebastianbergmann/phpunit#5478

Co-authored-by: Jan-Sverre Riksfjord <jasverix@gmail.com>
Co-authored-by: Sebastian Bergmann <sb@sebastian-bergmann.de>
jrfnl added a commit to Yoast/PHPUnit-Polyfills that referenced this pull request Aug 19, 2023
…ertObject[Not]HasProperty() methods

PHPUnit 10.1.0 introduced the new `Assert::assertObjectHasProperty()` and `Assert::assertObjectNotHasProperty()` methods.

These methods have now been backported to PHPUnit 9.6.11, so should be made available in the PHPUnit Polyfills 1.x series.

This commit:
* Adds two traits with the same name.
    One to polyfill the methods when not available in PHPUnit.
    The other - an empty trait - to allow for `use`-ing the trait in PHPUnit versions in which the methods are already natively available.
* Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used.
* An availability test and functional tests for the functionality polyfilled.

Includes:
* Adding the new polyfill to the existing `TestCases` classes.

Refs:
* sebastianbergmann/phpunit#5220
* sebastianbergmann/phpunit#5231 (and follow up commits/PRs)
* sebastianbergmann/phpunit#5478

Co-authored-by: Jan-Sverre Riksfjord <jasverix@gmail.com>
Co-authored-by: Sebastian Bergmann <sb@sebastian-bergmann.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/assertion Issues related to assertions and expectations type/enhancement A new idea that should be implemented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add assertObjectHasProperty() and assertObjectHasNotProperty()
2 participants