-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
assertObjectNotEquals()
#5811
Comments
assertObjectNotEquals()
Back when
I wrote the above because I was not convinced that could be inversed as easily as you propose. Of course, I am happy to be proven wrong. :) Quoting again from #4467:
An exception is raised if any of the assumptions is not met. Given the above, do you still think that "just" using |
Sure, that’s fine. The preconditions stay the same and error if unmet and if the equals method returns false, an assertion failure is recorded. |
Thanks! |
…ls() method PHPUnit 11.2.0 introduced the new `Assert::assertObjectNotEquals()` method. This commit: * Adds two traits with the same name. One to polyfill the method when not available in PHPUnit. The other to allow for `use`-ing the trait in PHPUnit versions in which the method is already natively available. * Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used. * Adds tests. As the polyfill contains logic to match the PHPUnit native implementation as closely as possible, while still being PHP and PHPUnit cross-version compatible, extensive unit tests have been added to ensure the behaviour of the polyfill matches that of the original function. Includes: * Adding information on the new polyfill to the README. * Adding the new polyfill to the existing `TestCases` classes. * Updating the class docs for the `InvalidComparisonMethodException` and the `ComparatorValidator` classes. Refs: * sebastianbergmann/phpunit#5811 * sebastianbergmann/phpunit@8e3b7c1 Co-authored-by: Sebastian Bergmann <[email protected]>
…ls() method PHPUnit 11.2.0 introduced the new `Assert::assertObjectNotEquals()` method. This commit: * Adds two traits with the same name. One to polyfill the method when not available in PHPUnit. The other to allow for `use`-ing the trait in PHPUnit versions in which the method is already natively available. * Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used. * Adds tests. As the polyfill contains logic to match the PHPUnit native implementation as closely as possible, while still being PHP and PHPUnit cross-version compatible, extensive unit tests have been added to ensure the behaviour of the polyfill matches that of the original function. Includes: * Adding information on the new polyfill to the README. * Adding the new polyfill to the existing `TestCases` classes. * Updating the class docs for the `InvalidComparisonMethodException` and the `ComparatorValidator` classes. Refs: * sebastianbergmann/phpunit#5811 * sebastianbergmann/phpunit@8e3b7c1 Co-authored-by: Sebastian Bergmann <[email protected]>
…ls() method PHPUnit 11.2.0 introduced the new `Assert::assertObjectNotEquals()` method. This commit: * Adds two traits with the same name. One to polyfill the method when not available in PHPUnit. The other to allow for `use`-ing the trait in PHPUnit versions in which the method is already natively available. * Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used. * Adds tests. As the polyfill contains logic to match the PHPUnit native implementation as closely as possible, while still being PHP and PHPUnit cross-version compatible, extensive unit tests have been added to ensure the behaviour of the polyfill matches that of the original function. Includes: * Adding information on the new polyfill to the README. * Adding the new polyfill to the existing `TestCases` classes. * Updating the class docs for the `InvalidComparisonMethodException` and the `ComparatorValidator` classes. Refs: * sebastianbergmann/phpunit#5811 * sebastianbergmann/phpunit@8e3b7c1 Co-authored-by: Sebastian Bergmann <[email protected]>
…ls() method PHPUnit 11.2.0 introduced the new `Assert::assertObjectNotEquals()` method. This commit: * Adds two traits with the same name. One to polyfill the method when not available in PHPUnit. The other to allow for `use`-ing the trait in PHPUnit versions in which the method is already natively available. * Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used. * Adds tests. As the polyfill contains logic to match the PHPUnit native implementation as closely as possible, while still being PHP and PHPUnit cross-version compatible, extensive unit tests have been added to ensure the behaviour of the polyfill matches that of the original function. Includes: * Adding information on the new polyfill to the README. * Adding the new polyfill to the existing `TestCases` classes. * Updating the class docs for the `InvalidComparisonMethodException` and the `ComparatorValidator` classes. Refs: * sebastianbergmann/phpunit#5811 * sebastianbergmann/phpunit@8e3b7c1 Co-authored-by: Sebastian Bergmann <[email protected]>
…ls() method PHPUnit 11.2.0 introduced the new `Assert::assertObjectNotEquals()` method. This commit: * Adds two traits with the same name. One to polyfill the method when not available in PHPUnit. The other to allow for `use`-ing the trait in PHPUnit versions in which the method is already natively available. * Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used. * Adds tests. As the polyfill contains logic to match the PHPUnit native implementation as closely as possible, while still being PHP and PHPUnit cross-version compatible, extensive unit tests have been added to ensure the behaviour of the polyfill matches that of the original function. Includes: * Adding information on the new polyfill to the README. * Adding the new polyfill to the existing `TestCases` classes. * Updating the class docs for the `InvalidComparisonMethodException` and the `ComparatorValidator` classes. Refs: * sebastianbergmann/phpunit#5811 * sebastianbergmann/phpunit@8e3b7c1 Co-authored-by: Sebastian Bergmann <[email protected]>
…sertObjectNotEquals() method PHPUnit 11.2.0 introduced the new `Assert::assertObjectNotEquals()` method. This commit: * Adds two traits with the same name. One to polyfill the method when not available in PHPUnit. The other to allow for `use`-ing the trait in PHPUnit versions in which the method is already natively available. * Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used. * Adds tests. As the polyfill contains logic to match the PHPUnit native implementation as closely as possible, while still being PHP and PHPUnit cross-version compatible, extensive unit tests have been added to ensure the behaviour of the polyfill matches that of the original function. Includes: * Adding information on the new polyfill to the README. * Adding the new polyfill to the existing `TestCases` classes. * Updating the class docs for the `InvalidComparisonMethodException` and the `ComparatorValidator` classes. Refs: * sebastianbergmann/phpunit#5811 * sebastianbergmann/phpunit@8e3b7c1 Co-authored-by: Sebastian Bergmann <[email protected]>
…sertObjectNotEquals() method PHPUnit 11.2.0 introduced the new `Assert::assertObjectNotEquals()` method. This commit: * Adds two traits with the same name. One to polyfill the method when not available in PHPUnit. The other to allow for `use`-ing the trait in PHPUnit versions in which the method is already natively available. * Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used. * Adds tests. As the polyfill contains logic to match the PHPUnit native implementation as closely as possible, while still being PHP and PHPUnit cross-version compatible, extensive unit tests have been added to ensure the behaviour of the polyfill matches that of the original function. Includes: * Adding information on the new polyfill to the README. * Adding the new polyfill to the existing `TestCases` classes. * Updating the class docs for the `InvalidComparisonMethodException` and the `ComparatorValidator` classes. Refs: * sebastianbergmann/phpunit#5811 * sebastianbergmann/phpunit@8e3b7c1 Co-authored-by: Sebastian Bergmann <[email protected]>
…sertObjectNotEquals() method PHPUnit 11.2.0 introduced the new `Assert::assertObjectNotEquals()` method. This commit: * Adds two traits with the same name. One to polyfill the method when not available in PHPUnit. The other to allow for `use`-ing the trait in PHPUnit versions in which the method is already natively available. * Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used. * Adds tests. As the polyfill contains logic to match the PHPUnit native implementation as closely as possible, while still being PHP and PHPUnit cross-version compatible, extensive unit tests have been added to ensure the behaviour of the polyfill matches that of the original function. Includes: * Adding information on the new polyfill to the README. * Adding the new polyfill to the existing `TestCases` classes. * Updating the class docs for the `InvalidComparisonMethodException` and the `ComparatorValidator` classes. Refs: * sebastianbergmann/phpunit#5811 * sebastianbergmann/phpunit@8e3b7c1 Co-authored-by: Sebastian Bergmann <[email protected]>
…sertObjectNotEquals() method PHPUnit 11.2.0 introduced the new `Assert::assertObjectNotEquals()` method. This commit: * Adds two traits with the same name. One to polyfill the method when not available in PHPUnit. The other to allow for `use`-ing the trait in PHPUnit versions in which the method is already natively available. * Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used. * Adds tests. As the polyfill contains logic to match the PHPUnit native implementation as closely as possible, while still being PHP and PHPUnit cross-version compatible, extensive unit tests have been added to ensure the behaviour of the polyfill matches that of the original function. Includes: * Adding information on the new polyfill to the README. * Adding the new polyfill to the existing `TestCases` classes. * Updating the class docs for the `InvalidComparisonMethodException` and the `ComparatorValidator` classes. Refs: * sebastianbergmann/phpunit#5811 * sebastianbergmann/phpunit@8e3b7c1 Co-authored-by: Sebastian Bergmann <[email protected]>
…sertObjectNotEquals() method PHPUnit 11.2.0 introduced the new `Assert::assertObjectNotEquals()` method. This commit: * Adds two traits with the same name. One to polyfill the method when not available in PHPUnit. The other to allow for `use`-ing the trait in PHPUnit versions in which the method is already natively available. * Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used. * Adds tests. As the polyfill contains logic to match the PHPUnit native implementation as closely as possible, while still being PHP and PHPUnit cross-version compatible, extensive unit tests have been added to ensure the behaviour of the polyfill matches that of the original function. Includes: * Adding information on the new polyfill to the README. * Adding the new polyfill to the existing `TestCases` classes. * Updating the class docs for the `InvalidComparisonMethodException` and the `ComparatorValidator` classes. Refs: * sebastianbergmann/phpunit#5811 * sebastianbergmann/phpunit@8e3b7c1 Co-authored-by: Sebastian Bergmann <[email protected]>
…sertObjectNotEquals() method PHPUnit 11.2.0 introduced the new `Assert::assertObjectNotEquals()` method. This commit: * Adds two traits with the same name. One to polyfill the method when not available in PHPUnit. The other to allow for `use`-ing the trait in PHPUnit versions in which the method is already natively available. * Logic to the custom autoloader which will load the correct trait depending on the PHPUnit version used. * Adds tests. As the polyfill contains logic to match the PHPUnit native implementation as closely as possible, while still being PHP and PHPUnit cross-version compatible, extensive unit tests have been added to ensure the behaviour of the polyfill matches that of the original function. Includes: * Adding information on the new polyfill to the README. * Adding the new polyfill to the existing `TestCases` classes. * Updating the class docs for the `InvalidComparisonMethodException` and the `ComparatorValidator` classes. Refs: * sebastianbergmann/phpunit#5811 * sebastianbergmann/phpunit@8e3b7c1 Co-authored-by: Sebastian Bergmann <[email protected]>
assertObjectEquals
is great for VOs and it would be lovely to have the opposite available as well,assertObjectNotEquals
. Sure, it’s trivial to polyfill but still it would be lovely if PHPUnit could offer it out of the box.The text was updated successfully, but these errors were encountered: