本文整理汇总了PHP中PHPUnit_Extensions_Database_TestCase::assertDataSetsEqual方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Extensions_Database_TestCase::assertDataSetsEqual方法的具体用法?PHP PHPUnit_Extensions_Database_TestCase::assertDataSetsEqual怎么用?PHP PHPUnit_Extensions_Database_TestCase::assertDataSetsEqual使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Extensions_Database_TestCase
的用法示例。
在下文中一共展示了PHPUnit_Extensions_Database_TestCase::assertDataSetsEqual方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAlternateParser
public function testAlternateParser()
{
$table1MetaData = new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('math_table', ['answer']);
$table1 = new PHPUnit_Extensions_Database_DataSet_DefaultTable($table1MetaData);
$table1->addRow(['answer' => 'pi/2']);
$expectedDataSet = new PHPUnit_Extensions_Database_DataSet_DefaultDataSet([$table1]);
$parser = new Extensions_Database_DataSet_YamlDataSetTest_PiOver2Parser();
$yamlDataSet = new PHPUnit_Extensions_Database_DataSet_YamlDataSet(dirname(__FILE__) . '/../_files/YamlDataSets/testDataSet.yaml', $parser);
PHPUnit_Extensions_Database_TestCase::assertDataSetsEqual($expectedDataSet, $yamlDataSet);
}
示例2: testNewAccountCreation
public function testNewAccountCreation()
{
$tester = $this->getDatabaseTester();
$tester->onSetUp();
$project = new C3op_Projects_Project();
$project->setTitle("more other project");
$xml_dataset = new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(dirname(__FILE__) . '/fixture/projects_after_inclusion.xml');
PHPUnit_Extensions_Database_TestCase::assertDataSetsEqual($xml_dataset, $tester->getConnection()->createDataSet());
$tester->onTearDown();
}
示例3: testConstructorReplacements
public function testConstructorReplacements()
{
$table1MetaData = new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table1', array('table1_id', 'column1', 'column2', 'column3', 'column4'));
$table2MetaData = new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table2', array('table2_id', 'column5', 'column6', 'column7', 'column8'));
$table1 = new PHPUnit_Extensions_Database_DataSet_DefaultTable($table1MetaData);
$table2 = new PHPUnit_Extensions_Database_DataSet_DefaultTable($table2MetaData);
$table1->addRow(array('table1_id' => 1, 'column1' => 'My name is Mike Lively', 'column2' => 200, 'column3' => 34.64, 'column4' => 'yghkf;a hahfg8ja h;'));
$table1->addRow(array('table1_id' => 2, 'column1' => 'hk;afg', 'column2' => 654, 'column3' => 46.54, 'column4' => '24rwehhads'));
$table1->addRow(array('table1_id' => 3, 'column1' => 'ha;gyt', 'column2' => 462, 'column3' => 1654.4, 'column4' => NULL));
$table2->addRow(array('table2_id' => 1, 'column5' => 'fhah', 'column6' => 456, 'column7' => 46.5, 'column8' => 'My name is Mike Lively'));
$table2->addRow(array('table2_id' => 2, 'column5' => 'asdhfoih', 'column6' => 654, 'column7' => NULL, 'column8' => '43asdfhgj'));
$table2->addRow(array('table2_id' => 3, 'column5' => 'ajsdlkfguitah', 'column6' => 654, 'column7' => NULL, 'column8' => '[NULL] not really'));
$expected = new PHPUnit_Extensions_Database_DataSet_DefaultDataSet(array($table1, $table2));
$actual = new PHPUnit_Extensions_Database_DataSet_ReplacementDataSet($this->startingDataSet, array('[NULL]' => NULL), array('%%%name%%%' => 'Mike Lively'));
PHPUnit_Extensions_Database_TestCase::assertDataSetsEqual($expected, $actual);
}
示例4: testYamlDataSet
public function testYamlDataSet()
{
$table1MetaData = new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table1', array('table1_id', 'column1', 'column2', 'column3', 'column4'));
$table2MetaData = new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table2', array('table2_id', 'column5', 'column6', 'column7', 'column8'));
$table1 = new PHPUnit_Extensions_Database_DataSet_DefaultTable($table1MetaData);
$table2 = new PHPUnit_Extensions_Database_DataSet_DefaultTable($table2MetaData);
$table1->addRow(array('table1_id' => 1, 'column1' => 'tgfahgasdf', 'column2' => 200, 'column3' => 34.64, 'column4' => 'yghkf;a hahfg8ja h;'));
$table1->addRow(array('table1_id' => 2, 'column1' => 'hk;afg', 'column2' => 654, 'column3' => 46.54, 'column4' => '24rwehhads'));
$table1->addRow(array('table1_id' => 3, 'column1' => 'ha;gyt', 'column2' => 462, 'column3' => 1654.4, 'column4' => 'asfgklg'));
$table2->addRow(array('table2_id' => 1, 'column5' => 'fhah', 'column6' => 456, 'column7' => 46.5, 'column8' => 'fsdb, ghfdas'));
$table2->addRow(array('table2_id' => 2, 'column5' => 'asdhfoih', 'column6' => 654, 'column7' => 'blah', 'column8' => '43asd "fhgj" sfadh'));
$table2->addRow(array('table2_id' => 3, 'column5' => 'ajsdlkfguitah', 'column6' => 654, 'column7' => 'blah', 'column8' => 'thesethasdl
asdflkjsadf asdfsadfhl "adsf, halsdf" sadfhlasdf'));
$expectedDataSet = new PHPUnit_Extensions_Database_DataSet_DefaultDataSet(array($table1, $table2));
$yamlDataSet = new PHPUnit_Extensions_Database_DataSet_YamlDataSet(dirname(__FILE__) . '/../_files/YamlDataSets/testDataSet.yaml');
PHPUnit_Extensions_Database_DataSet_YamlDataSet::write($yamlDataSet, '/tmp/yaml.dataset');
PHPUnit_Extensions_Database_TestCase::assertDataSetsEqual($expectedDataSet, $yamlDataSet);
}
示例5: testCSVDataSet
public function testCSVDataSet()
{
$table1MetaData = new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table1', ['table1_id', 'column1', 'column2', 'column3', 'column4']);
$table2MetaData = new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table2', ['table2_id', 'column5', 'column6', 'column7', 'column8']);
$table1 = new PHPUnit_Extensions_Database_DataSet_DefaultTable($table1MetaData);
$table2 = new PHPUnit_Extensions_Database_DataSet_DefaultTable($table2MetaData);
$table1->addRow(['table1_id' => 1, 'column1' => 'tgfahgasdf', 'column2' => 200, 'column3' => 34.64, 'column4' => 'yghkf;a hahfg8ja h;']);
$table1->addRow(['table1_id' => 2, 'column1' => 'hk;afg', 'column2' => 654, 'column3' => 46.54, 'column4' => '24rwehhads']);
$table1->addRow(['table1_id' => 3, 'column1' => 'ha;gyt', 'column2' => 462, 'column3' => 1654.4, 'column4' => 'asfgklg']);
$table2->addRow(['table2_id' => 1, 'column5' => 'fhah', 'column6' => 456, 'column7' => 46.5, 'column8' => 'fsdb, ghfdas']);
$table2->addRow(['table2_id' => 2, 'column5' => 'asdhfoih', 'column6' => 654, 'column7' => 'blah', 'column8' => '43asd "fhgj" sfadh']);
$table2->addRow(['table2_id' => 3, 'column5' => 'ajsdlkfguitah', 'column6' => 654, 'column7' => 'blah', 'column8' => 'thesethasdl
asdflkjsadf asdfsadfhl "adsf, halsdf" sadfhlasdf']);
$expectedDataSet = new PHPUnit_Extensions_Database_DataSet_DefaultDataSet([$table1, $table2]);
$csvDataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet();
$csvDataSet->addTable('table1', dirname(__FILE__) . '/../_files/CsvDataSets/table1.csv');
$csvDataSet->addTable('table2', dirname(__FILE__) . '/../_files/CsvDataSets/table2.csv');
PHPUnit_Extensions_Database_TestCase::assertDataSetsEqual($expectedDataSet, $csvDataSet);
}
示例6: testNewAccountCreation
public function testNewAccountCreation()
{
$bank_account = new BankAccount('12345678912345678', $this->pdo);
$xml_dataset = new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__) . '/_files/bank-account-after-new-account.xml');
PHPUnit_Extensions_Database_TestCase::assertDataSetsEqual($xml_dataset, $this->tester->getConnection()->createDataSet());
}
示例7: assertDataSetsEqual
/**
* Asserts that two given datasets are equal.
*
* @param PHPUnit_Extensions_Database_DataSet_IDataSet $expected
* @param PHPUnit_Extensions_Database_DataSet_IDataSet $actual
* @param string $message
*/
public static function assertDataSetsEqual($expected, $actual)
{
PHPUnit_Extensions_Database_TestCase::assertDataSetsEqual($expected, $actual);
}
示例8: testCompositeDataSet
public function testCompositeDataSet()
{
$actual = new PHPUnit_Extensions_Database_DataSet_CompositeDataSet(array($this->expectedDataSet1, $this->expectedDataSet2));
PHPUnit_Extensions_Database_TestCase::assertDataSetsEqual($this->expectedDataSet3, $actual);
}