Is there a way to stop DBUnit from creating a record based on an XML dataset?
I'm trying to test if a query will insert a record then compare it to the XML dataset.
public function testInsert()
{
$statement = $this->getConnection()
->getConnection()
->query(
'insert into Grades (Vendor) values (\'test\')'
);
$actual = $this->getConnection()->createQueryTable(
'Grades',
'select Vendor from Grades'
);
$this->assertTablesEqual(
$this->getDataSet()->getTable('Grades'),
$actual
);
}
public function getDataset()
{
//returns dataset below
}
XML:
<?xml version="1.0" encoding="UTF-8" ?>
<dataset>
<Grades
uid="345"
/>
</dataset>
The result is:
PHPUnit: Failed asserting that
+----------------------+
| Grades |
+----------------------+
| Vendor |
+----------------------+
| test |
+----------------------+
| test |
+----------------------+
is equal to expected
+----------------------+
| Grades |
+----------------------+
| Vendor |
+----------------------+
| test |
+----------------------+
Can someone explain why the XML Dataset is inserted at all and how I can stop it from doing so automatically?