当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPUnit_Extensions_Database_TestCase::assertDataSetsEqual方法代码示例

本文整理汇总了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);
 }
开发者ID:pihh,项目名称:mariana-framework,代码行数:10,代码来源:YamlDataSetTest.php

示例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();
 }
开发者ID:racporto,项目名称:c3op,代码行数:10,代码来源:dbXest.php

示例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);
 }
开发者ID:newsn31,项目名称:StarterTheme,代码行数:16,代码来源:ReplacementDataSetTest.php

示例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);
    }
开发者ID:naderman,项目名称:dbunit,代码行数:18,代码来源:YamlDataSetTest.php

示例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);
    }
开发者ID:pihh,项目名称:mariana-framework,代码行数:19,代码来源:CsvDataSetTest.php

示例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());
 }
开发者ID:newsn31,项目名称:StarterTheme,代码行数:6,代码来源:BankAccountCompositeTest.php

示例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);
 }
开发者ID:TheOnlyMerlin,项目名称:phpunit-extensions,代码行数:11,代码来源:TestCase.php

示例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);
 }
开发者ID:sethcasana,项目名称:phpunit,代码行数:5,代码来源:CompositeDataSetTest.php


注:本文中的PHPUnit_Extensions_Database_TestCase::assertDataSetsEqual方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。