PHPUnit_Extensions_Database_DataSet_QueryTable::assertEquals PHP Method

assertEquals() public method

Asserts that the given table matches this table.
public assertEquals ( PHPUnit_Extensions_Database_DataSet_ITable $other )
$other PHPUnit_Extensions_Database_DataSet_ITable
    public function assertEquals(PHPUnit_Extensions_Database_DataSet_ITable $other)
    {
        $this->loadData();
        return parent::assertEquals($other);
    }

Usage Example

Example #1
0
 public function testAssertEqualsFails()
 {
     $this->setExpectedException('Exception', 'Expected row count of 2, has a row count of 3');
     $expected_table = new PHPUnit_Extensions_Database_DataSet_DefaultTable(new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table1', array('col1', 'col2', 'col3')));
     $expected_table->addRow(array('col1' => 'value1', 'col2' => 'value2', 'col3' => 'value3'));
     $expected_table->addRow(array('col1' => 'value4', 'col2' => 'value5', 'col3' => 'value6'));
     $expected_table->addRow(array('col1' => 'value7', 'col2' => 'value8', 'col3' => 'value9'));
     $this->table->assertEquals($expected_table);
 }