我尝试使用复合词like this exeample对dbunit进行测试,但我有错误说PHPUnit_Extensions_Database_DB_DefaultConnection not found
。
甚至包括require_once 'PHPUnit/Extensions/Database/TestCase.php'
我有这个错误。
答案 0 :(得分:0)
样本中包含拼写错误。
这是修复
diff --git a/Samples/BankAccountDB/BankAccountCompositeTest.php b/Samples/BankAccountDB/BankAccountCompositeTest.php
index 3dc0035..d314c39 100644
--- a/Samples/BankAccountDB/BankAccountCompositeTest.php
+++ b/Samples/BankAccountDB/BankAccountCompositeTest.php
@@ -70,7 +70,7 @@ public function setUp()
*/
protected function getDatabaseTester()
{
- $connection = new PHPUnit_Extensions_Database_DB_DefaultConnection($this->pdo, 'sqlite');
+ $connection = new PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection($this->pdo, 'sqlite');
$tester = new PHPUnit_Extensions_Database_DefaultTester($connection);
$tester->setSetUpOperation(PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT());
$tester->setTearDownOperation(PHPUnit_Extensions_Database_Operation_Factory::NONE());