public function testGetConnection() { $testAdapter = $this->getMock('Zend_Test_DbAdapter'); $testAdapter->expects($this->any())->method('delete')->will($this->throwException(new Exception())); $connection = new Zend_Test_PHPUnit_Db_Connection($testAdapter, "schema"); $databaseTester = new Zend_Test_PHPUnit_Db_SimpleTester($connection); $this->assertSame($connection, $databaseTester->getConnection()); }
/** * Assert that a given table has a given amount of rows * * @param string $tableName Name of the table * @param int $expected Expected amount of rows in the table * @param string $message Optional message */ public function assertTableRowCount($tableName, $expected, $message = '') { $constraint = new PHPUnit_Extensions_Database_Constraint_TableRowCount($tableName, $expected); $actual = $this->databaseTester->getConnection()->getRowCount($tableName); self::assertThat($actual, $constraint, $message); }