Comments (6)
Works as expected up to version 5.0.6, but encountering issues starting from 5.0.7
from codeception.
Looks like broken in #6623
from codeception.
same for me
from codeception.
Yes, the same issue after upgrade. Could you please fix it ASAP?
from codeception.
The same issue for me, could check it pls?
from codeception.
I am having the same issue.
The following test code will fail test2 with the failure from test1
<?php
namespace Tests\Unit;
use Codeception\Test\Unit;
use PHPUnit\Framework\AssertionFailedError;
use Tests\Support\UnitTester;
class TestTest extends Unit {
protected UnitTester $tester;
public function test1(){
static::fail(':-(');
}
public function test2(){
$this->expectException(AssertionFailedError::class);
$this->tester->assertFalse(true);
}
}
Using the phpunit assertions in test2 instead of the Assert module will show the test passed as expected
I have identified the source of the failure in Codeception\Test\Test
line from 172
if (method_exists($this, 'getScenario')) {
foreach ($this->getScenario()?->getSteps() ?? [] as $step) {
if ($step->hasFailed()) {
$lastFailure = $result->popLastFailure();
if ($lastFailure !== null) {
throw $lastFailure->getFail();
}
}
}
}
The line from test2 $this->tester->assertFalse(true);
causes a scenario step to fail, but the test succeeds as the exception was expected.
The code from Codeception\Test\Test
then sees the scenario step has failed, and then grabs the last test failure to report which is from a different test
from codeception.
Related Issues (20)
- unit test case error on container HOT 2
- No way to run invividual tests in groups HOT 1
- Providing null data with Examples annotation fails HOT 3
- skip_cleanup_if_failed documentation HOT 1
- Support phpunit 11 HOT 1
- "No primary site exists" only when running unit tests - Craft 4 Pro. No issues with functional and acceptance tests in same environment HOT 4
- Using Symfony 7 Clock ClockSensitiveTrait causes a LogicException HOT 2
- Future of Codeception? HOT 4
- Can I change the format of the exception display? HOT 2
- coverage: whitelist: exclude option has no effect since PHPUnit 11.0 HOT 10
- Running with --no-ansi still uses color HOT 1
- Codeception 5 + Symfony 6 HOT 2
- Run build command without bootstrap
- [JsonException] Non-backed enums have no default serialization
- "Warning: Uninitialized string offset 1 in Parser.php:160" when using readonly on anonymous classes
- Overridden DataProvider function not being called in Codeception v5.1.2 HOT 3
- gherkin:snippets command still produces old syntax
- Show errors in HTML Test report filtering bar HOT 1
- Allow to disable coverage.serialized report and reduce memory usage.
- Symfony module: documentation improvement
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codeception.