A Codeception module containing various assertions.
PHP 8.0
or higher.
composer require "codeception/module-asserts" --dev
Codeception Module Asserts
is open-sourced software licensed under the MIT License.
© Codeception PHP Testing Framework
Codeception module containing various assertions
License: MIT License
A Codeception module containing various assertions.
PHP 8.0
or higher.composer require "codeception/module-asserts" --dev
Codeception Module Asserts
is open-sourced software licensed under the MIT License.
© Codeception PHP Testing Framework
I can not install the latest version v2.0.1
.
Composer install results in:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires codeception/module-asserts 2.0.1 -> satisfiable by codeception/module-asserts[2.0.1].
- codeception/module-asserts 2.0.1 requires codeception/lib-asserts ^2.0 -> found codeception/lib-asserts[2.0.0] but the package is fixed to 1.13.2 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
Reason:
Latest version of codeception/codeception
(v4.1.24) requires codeception/lib-asserts
(^1.0)
The $expectedCode
parameter of the Asserts->checkThrowable
function is typed as ?int
, but this is incorrect, see https://www.php.net/manual/en/throwable.getcode.php ("Returns the exception code as int in Exception but possibly as other type in Exception descendants")
For this reason our tests now give type errors when trying to use module-asserts v2.
Related to: Support for full PHPUnit public API
Codeception PHP Testing Framework v4.1.4
Powered by PHPUnit 8.5.3 by Sebastian Bergmann and contributors.
Running with seed:
Fatal error: The modifiers of the trait method assertMatchesRegularExpression() are changed, but this method does not exist. Error in /builds/redacted/redacted/vendor/codeception/module-asserts/src/Codeception/Module/Asserts.php on line 11
I started getting errors after this upgrade, i.e.
[Error] Call to undefined method Codeception\PHPUnit\TestCase::assertMatchesRegularExpression()
going down the rabbit hole, it seems like this is going through the phpunit wrapper to a method in phpunit with the same name, but assertMatchesRegularExpression
wasn't present in phpunit ^8. Trying to force phpunit to 9.5 results in:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires phpunit/phpunit ^9.5, found phpunit/phpunit[9.5.0, ..., 9.5.x-dev] but these were not loaded, likely because it conflicts with another require.
Problem 2
- codeception/phpunit-wrapper 8.1.6 requires phpunit/phpunit ^8.0 -> found phpunit/phpunit[8.0.0, ..., 8.5.x-dev] but it conflicts with your root composer.json require (^9.5).
- codeception/codeception 4.2.2 requires codeception/phpunit-wrapper >6.0.15 <6.1.0 | ^6.6.1 | ^7.7.1 | ^8.1.1 | ^9.0 -> satisfiable by codeception/phpunit-wrapper[8.1.6].
- codeception/codeception is locked to version 4.2.2 and an update of this package was not requested.
Am I missing something here?
Using codeception 4.2.2, php 8.0, phpunit 8.5.30, lib-asserts 1.13.2, module-asserts 1.3.1
Hey there, this is in relation to #13. This may be similar to #9 which is from our prior colleague.
I would expect that expectThrowable
would simply accept Throwable
. It is impossible for us to make copies of every error class just so that it works with this weird new Throwable. If i look at your code, i can see that you're also expecting the PHP one. Something may just have gone wrong by using the use statement instead of the backslash.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.