Closed Amar-45 closed 6 years ago
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.
`
use PHPUnit\Framework\TestCase;
use PHPUnit\DbUnit\TestCaseTrait;
abstract class SampleTest extends TestCase { use TestCaseTrait;
// only instantiate pdo once for test clean-up/fixture load
static private $pdo = null;
// only instantiate PHPUnit_Extensions_Database_DB_IDatabaseConnection once per test
private $conn = null;
public function getConnection()
{
if ($this->conn === null) {
if (self::$pdo == null) {
self::$pdo = new PDO($GLOBALS['DB_DSN'], $GLOBALS['DB_USER'], $GLOBALS['DB_PASSWD']);
}
$this->conn = $this->createDefaultDBConnection(self::$pdo, $GLOBALS['DB_DBNAME']);
}
}
public function getDataSet()
{
return $this->createMySQLXMLDataSet('D:/xampp/htdocs/UnitTest/myFlatXmlFixture.xml');
}
} `
Iam using Php Version : 7.0 and phpunit version 6.4
How did you install PHPUnit? How did you install DbUnit?
by using composer require phpunit/phpunit and composer require phpunit/dbunit
iam stuck while connecting with db
Hi @Amar-45, I don't have this problem. And here is my repo that you can refer.
I use the Same PHP version and package version that are for your specific version.
Check out the MyDbTest.php
in tests
folder to see more details about this.
Thanks.
This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had activity since it was marked as stale. Thank you for your contributions.
trait phpunit/dbunit/testcasetrait not found while connecting dbunit with phpunit