Exemplo n.º 1
0
 /**
  * Create a dataset based on multiple Zend_Db_Table instances
  *
  * @param  array $tables
  * @return Zend_Test_PHPUnit_Db_DataSet_DbTableDataSet
  */
 protected function createDbTableDataSet(array $tables = array())
 {
     $dataSet = new Zend_Test_PHPUnit_Db_DataSet_DbTableDataSet();
     foreach ($tables as $table) {
         $dataSet->addTable($table);
     }
     return $dataSet;
 }
Exemplo n.º 2
0
 public function testZendDbTableEqualsXmlDataSet()
 {
     $fooTable = $this->createFooTable();
     $fooTable->insert(array("id" => null, "foo" => "foo", "bar" => "bar", "baz" => "baz"));
     $fooTable->insert(array("id" => null, "foo" => "bar", "bar" => "bar", "baz" => "bar"));
     $fooTable->insert(array("id" => null, "foo" => "baz", "bar" => "baz", "baz" => "baz"));
     $dataSet = new Zend_Test_PHPUnit_Db_DataSet_DbTableDataSet();
     $dataSet->addTable($fooTable);
     $xmlDataSet = new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__) . "/_files/sqliteIntegrationFixture.xml");
     $this->assertTrue($xmlDataSet->assertEquals($dataSet));
 }
Exemplo n.º 3
0
 public function testGetUnknownTableThrowsException()
 {
     $this->setExpectedException('InvalidArgumentException');
     $dataSet = new Zend_Test_PHPUnit_Db_DataSet_DbTableDataSet();
     $dataSet->getTable('unknown');
 }