Closed fezfez closed 5 years ago
Possibly related to https://github.com/zendframework/zend-test/issues/71
@fezfez this is something related with this PHPUnit issue https://github.com/sebastianbergmann/phpunit/issues/3026. Can you try to apply the workaround reported here? Let me know, thanks!
@ezimuel I indeed found the bug, thanks !
<?php
declare(strict_types=1);
namespace MyNamespace\Controller\ErrorController;
use MyNamespace\Test\ServiceManagerFactory;
use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase;
class MyIndexActionTest extends AbstractHttpControllerTestCase
{
public function setUp() : void
{
$this->setApplicationConfig(ServiceManagerFactory::getConfiguration());
}
public function testCanBeAccess() : void
{
$this->dispatch('/aroute', 'GET');
$this->assertResponseStatusCode(200);
}
}
Result :
./vendor/bin/phpunit --filter MyIndexActionTest
PHPUnit 7.5.1 by Sebastian Bergmann and contributors.
. 1 / 1 (100%)
<?php
declare(strict_types=1);
namespace MyNamespace\Controller\ErrorController;
use MyNamespace\Test\ServiceManagerFactory;
use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase;
class MyIndexActionTest extends AbstractHttpControllerTestCase
{
public function setUp() : void
{
$this->setApplicationConfig(ServiceManagerFactory::getConfiguration());
parent::setUp();
}
public function testCanBeAccess() : void
{
$this->dispatch('/aroute', 'GET');
$this->assertResponseStatusCode(200);
}
}
Result :
./vendor/bin/phpunit --filter MyIndexActionTest
PHPUnit 7.5.1 by Sebastian Bergmann and contributors.
. 1 / 1 (100%)
Time: 277 ms, Memory: 36.00MB
OK (1 test, 1 assertions)
I wasn't calling parent::setUp
!
Maybe we can fix this by providing a mechanism to check if setUp was call ?
Thanks for your help :+1:
@fezfez I don't see a way for checking this automatically. Anyway, I'm glad that you solved and thanks for reporting it.
Hello,
My test suite suddenly break and return code 255 without summary when i update to release 3.2.1.
With 3.2.1
With 3.2.0
I was able to find the issue with strace and phpdbg, the php-timer library break on line https://github.com/sebastianbergmann/php-timer/blob/9ef9968ba27999219d76ae3cef97aa0fa87bd90f/src/Timer.php#L64
composer show
Do you know how to resolve this issue ?
Thanks in advance for your awesome work !