From 5f2fbc8151fa9f154b06c073fe4a7d096cb848c9 Mon Sep 17 00:00:00 2001 From: Simon Holywell Date: Tue, 15 Jan 2013 09:35:17 +0000 Subject: Add in some PHPUnit tests --- test/bootstrap.php | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 test/bootstrap.php (limited to 'test/bootstrap.php') diff --git a/test/bootstrap.php b/test/bootstrap.php new file mode 100644 index 0000000..6f42c87 --- /dev/null +++ b/test/bootstrap.php @@ -0,0 +1,3 @@ + Date: Thu, 17 Jan 2013 17:33:13 +0000 Subject: Begin moving query building tests into phpunit --- test/bootstrap.php | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'test/bootstrap.php') diff --git a/test/bootstrap.php b/test/bootstrap.php index 6f42c87..da97d2f 100644 --- a/test/bootstrap.php +++ b/test/bootstrap.php @@ -1,3 +1,41 @@ current_row == 5) { + return false; + } else { + $this->current_row++; + return array('name' => 'Fred', 'age' => 10, 'id' => '1'); + } + } +} + +/** + * + * Mock database class implementing a subset + * of the PDO API. + * + */ +class MockPDO extends PDO { + + /** + * Return a dummy PDO statement + */ + public function prepare($statement, $driver_options=array()) { + $this->last_query = new MockPDOStatement($statement); + return $this->last_query; + } +} \ No newline at end of file -- cgit v1.2.3