From 39825daf7003600c221bacf73210178fd1189080 Mon Sep 17 00:00:00 2001 From: Joel Marcey Date: Wed, 28 Aug 2013 07:39:28 -0700 Subject: Update bootstrap.php so the tests can run on both HHVM and Zend PDOStatement does not have a direct constructor (i.e., __construct). Newing up a PDOStatement or subclass (e.g., MockPDOStatement) does technically work in Zend, but HHVM throws. A correct way to have the code currently structured in bootstrap.php work correctly on both Zend and HHVM is provide a default constructor and execute method in MockPDOStatement. It would probably best long term to avoid newing up a PDOStatement and create the queries another way. But this works for now. --- test/bootstrap.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/bootstrap.php') diff --git a/test/bootstrap.php b/test/bootstrap.php index ec13cc7..4e8795d 100644 --- a/test/bootstrap.php +++ b/test/bootstrap.php @@ -13,6 +13,14 @@ class MockPDOStatement extends PDOStatement { /** * Return some dummy data */ + + /** + * These are necessary to run the tests on hhvm. In fact, newing up a PDOStatement (or derivative) should not be + * technically used since there is no direct constructor for PDOStatement, even though it does work with Zend + */ + public function __construct() {} + public function execute($params) {} + public function fetch($fetch_style=PDO::FETCH_BOTH, $cursor_orientation=PDO::FETCH_ORI_NEXT, $cursor_offset=0) { if ($this->current_row == 5) { return false; -- cgit v1.2.3