-
-
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
Tests not executed and marked as correct #3306
Comments
Thank you for your report. Please provide a minimal, self-contained, reproducing test case that shows the problem you are reporting. Without such a minimal, self-contained, reproducing test case I will not be able to investigate this issue. Please disable custom test listeners such as |
I have updated PHP and the problem was not solved. Simply run any test with the next bootstrap.php: <?php
class MySessionHandler implements SessionHandlerInterface
{
function open($savePath, $sessionName)
{
return true;
}
function close()
{
return true;
}
function read($id)
{
return '';
}
function write($id, $data)
{
return true;
}
function destroy($id)
{
return true;
}
function gc($maxlifetime)
{
return true;
}
}
$handler = new MySessionHandler();
session_set_save_handler($handler, true); // CAUSES STRANGE BEHAVIOR
session_start(); myTest.php <?php
namespace MyTest;
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Constraint;
final class myTestTest extends TestCase
{
public function testSession()
{
sleep(100); // 1.66 minutes
$this->assertTrue(true);
}
} phpunit.xml <phpunit bootstrap="bootstrap.php"
colors="true"
processIsolation="true"
verbose="false">
<testsuites>
<testsuite name="Addons">
<directory>./tests/error</directory>
</testsuite>
</testsuites>
</phpunit> The test is marked as correct, but never executed: The expected result is the following: |
If I set |
Now I have the following problem #1416, since my tests use cookie and session |
Solved: |
Since php 7.2 it is not possible to set 'user' save handler by ini_set(). When running tests with
In the isolated process PHPUnit sets all php-ini-settings again within a long list of @ini_set-calls (.s This long list contains also the following call I think PHPUnit have to exclude all non-editable ini-settings |
@yya Please open a new ticket for this. |
Was a new ticket every created for this? I have just spent the day debugging to find this is exactly why all of our @runInSeparateProcess tests are failing. Simply removing the session.save_handler ini setting is enough to get the tests running again. |
All tests marked as correct with a time of 0ms. I checked and no test was executed.
The results are a false positive affected by session_set_save_handler().
Could this be possible ?
phpunit.xml
bootstrap.php
Session.php
The text was updated successfully, but these errors were encountered: