Answer the question
In order to leave comments, you need to log in
Why is DbTestCase not found?
DbTestCase not found although everything is in place, the class also requires to implement the run and count methods when they should not seem to be there.
<?php
namespace tests\unit;
use PHPUnit\Framework\TestResult;
use yii\codeception\DbTestCase;
class SynchronizationTest extends DbTestCase
{
public function testSynchronization()
{
$this->assertTrue(true);
}
public function testSaveAreas()
{
$this->assertTrue(true);
}
public function testSaveProjects()
{
$this->assertTrue(true);
}
public function testSaveEvents()
{
$this->assertTrue(true);
}
/**
* Count elements of an object
* @link http://php.net/manual/en/countable.count.php
* @return int The custom count as an integer.
* </p>
* <p>
* The return value is cast to an integer.
* @since 5.1.0
*/
public function count()
{
// TODO: Implement count() method.
}
/**
* Runs a test and collects its result in a TestResult instance.
*
* @param TestResult $result
*
* @return TestResult
*/
public function run(TestResult $result = null)
{
// TODO: Implement run() method.
}
}
Answer the question
In order to leave comments, you need to log in
1 - you need to check if the necessary files are included in the bootstrap file
2 - Is it really necessary to inherit from yii\codeception\DbTestCase? I do not approve, but vozmzhno there other class.
ps tests that use the database are not unit, but rather functional.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question