getRowCount() public method

Returns the number of rows in the given table. You can specify an optional where clause to return a subset of the table.
public getRowCount ( string $tableName, string $whereClause = NULL )
$tableName string
$whereClause string
 public function testRowCountForTableWithTwoRowsReturnsTwo()
 {
     $this->db->exec('INSERT INTO test (field1) VALUES (\'foobar\')');
     $this->db->exec('INSERT INTO test (field1) VALUES (\'foobarbaz\')');
     $conn = new PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection($this->db);
     $this->assertEquals(2, $conn->getRowCount('test'));
 }