You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Following the CI4 documents, I created a test class as below:
<?php namespace App;
use CodeIgniter\Test\FeatureTestCase;
class MyAppTest extends FeatureTestCase
{
public function setUp()
{
parent::setUp();
}
public function tearDown()
{
parent::tearDown();
}
}
After run:
./phpunit ./tests/app/MyAppTest.php
I got:
PHP Fatal error: Declaration of App\MyAppTest::setUp() must be compatible with CodeIgniter\Test\CIDatabaseTestCase::setUp(): void in ***/tests/app/MyAppTest.php on line 7
Afte learning the test demo in tests/unit/HealthTest.php, I modified the test class as below:
<?php namespace App;
use CodeIgniter\Test\FeatureTestCase;
class MyAppTest extends FeatureTestCase
{
public function setUp(): void
{
parent::setUp();
}
public function tearDown(): void
{
parent::tearDown();
}
}
and run './phpunit ./tests/app/MyAppTest.php' again, all comes OK.
I'm not sure if it's a bug, or the document is not up-to-date.
Rgds!
CodeIgniter 4 version
Which version (and branch, if applicable) the bug is in. v4.0.3
Affected module(s)
Which package or class is the bug in, if known.
Maybe the documents, of "CodeIgniter\Test\FeatureTestCase" ? I'm not sure.
Expected behavior, and steps to reproduce if appropriate
None.
Context
OS: macOS Catalina
Web server: Apache/2.4.43 (Unix)
PHP version: PHP/7.4.5
The text was updated successfully, but these errors were encountered:
isiungk
added
the
bug
Verified issues on the current code behavior or pull requests that will fix them
label
May 14, 2020
Direction
The example of "The Test Class“ is not working in Documets>Testing>Database>The Test Class.
Describe the bug
Following the CI4 documents, I created a test class as below:
After run:
I got:
Afte learning the test demo in
tests/unit/HealthTest.php
, I modified the test class as below:and run './phpunit ./tests/app/MyAppTest.php' again, all comes OK.
I'm not sure if it's a bug, or the document is not up-to-date.
Rgds!
CodeIgniter 4 version
Which version (and branch, if applicable) the bug is in.
v4.0.3
Affected module(s)
Which package or class is the bug in, if known.
Maybe the documents, of "CodeIgniter\Test\FeatureTestCase" ? I'm not sure.
Expected behavior, and steps to reproduce if appropriate
None.
Context
The text was updated successfully, but these errors were encountered: