Permalink
Browse files

- Merge [842].

  • Loading branch information...
1 parent c430980 commit 04b23fade2cf1edb16553a8ba15eb229d73d6857 @sebastianbergmann committed Jul 26, 2007
Showing with 10 additions and 2 deletions.
  1. +10 −2 PHPUnit/Util/PDO.php
View
@@ -146,15 +146,23 @@ public static function factory($dsn)
$dsn .= ";unix_socket=$socket";
}
- return new PDO($dsn, $user, $pass, $driverOptions);
+ $dbh = new PDO($dsn, $user, $pass, $driverOptions);
}
break;
case 'sqlite': {
- return new PDO($dsn);
+ $dbh = new PDO($dsn);
}
break;
+
+ default: {
+ throw new InvalidArgumentException;
+ }
}
+
+ $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+
+ return $dbh;
}
/**

0 comments on commit 04b23fa

Please sign in to comment.