Skip to content

Instantly share code, notes, and snippets.

@nelsonsar
Created July 6, 2013 20:49
Show Gist options
  • Save nelsonsar/5941237 to your computer and use it in GitHub Desktop.
Save nelsonsar/5941237 to your computer and use it in GitHub Desktop.
Using more than one PHPUnit fixture in one test.
<?php
class DummyTest extends YourDatabaseTestClass
{
protected function getDataSet()
{
$firstDataSet = $this->createXMLDataSet(__DIR__ . '/fixtures/first_fixture.xml');
$secondDataSet = $this->createXMLDataSet(__DIR__ . '/fixtures/second_fixture.xml');
$dataSets = array(
$firstDataSet, $secondDataSet
);
$compositeDataSet = new PHPUnit_Extensions_Database_DataSet_CompositeDataSet($dataSets);
return $compositeDataSet;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment