From 73ac9315e7fba5b82edd16cd870f57cad64c638f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20D=2E=20Rodas?= Date: Tue, 12 Nov 2013 14:36:14 -0300 Subject: [PATCH] added tests --- tests/DBTest.php | 20 ++++++++++++++++++++ tests/bootstrap.php | 10 ++++++++++ 2 files changed, 30 insertions(+) create mode 100644 tests/DBTest.php create mode 100644 tests/bootstrap.php diff --git a/tests/DBTest.php b/tests/DBTest.php new file mode 100644 index 0000000..58db8b1 --- /dev/null +++ b/tests/DBTest.php @@ -0,0 +1,20 @@ +createDatabase("test_foobar"); + } + + /** + * @expectedException RuntimeException + */ + public function testCreateException() + { + $client = new Client; + return $client->createDatabase("test_foobar"); + } +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..de33d98 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,10 @@ +getDatabases() as $db) { + if (preg_match("/^test_/", $db->getName())) { + $db->drop(); + } +}