From 1050bee698923f19c16a186efafd6679e9ba0ae8 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Mon, 29 Aug 2016 12:57:16 -0400 Subject: [PATCH] Fully cover SQL cache driver with tests --- tests/Ion/Cache/Driver/SQLDriverTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/Ion/Cache/Driver/SQLDriverTest.php b/tests/Ion/Cache/Driver/SQLDriverTest.php index 7d61ad1..2102d9f 100644 --- a/tests/Ion/Cache/Driver/SQLDriverTest.php +++ b/tests/Ion/Cache/Driver/SQLDriverTest.php @@ -2,6 +2,7 @@ namespace Aviat\Ion\Tests\Cache\Driver; +use Aviat\Ion\Config; use Aviat\Ion\Friend; use Aviat\Ion\Cache\Driver\SQLDriver; @@ -17,4 +18,13 @@ class CacheSQLDriverTest extends \Ion_TestCase { $friend = new Friend($this->driver); $friend->db->query('CREATE TABLE IF NOT EXISTS "cache" ("key" TEXT NULL, "value" TEXT NULL, PRIMARY KEY ("key"))'); } + + public function testMissingConfig() + { + $this->expectException('Aviat\Ion\Exception\ConfigException'); + $this->expectExceptionMessage('Missing \'[cache]\' section in database config.'); + + $this->container->setInstance('config', new Config([])); + $this->driver = new SQLDriver($this->container->get('config')); + } } \ No newline at end of file