summaryrefslogtreecommitdiff
path: root/test/CacheTest.php
diff options
context:
space:
mode:
authorSimon Holywell <[email protected]>2013-01-23 14:37:20 +0000
committerSimon Holywell <[email protected]>2013-01-23 14:37:20 +0000
commit8296e52b053ecb29a8ee1ac2f9be95e36bf84cac (patch)
treef74d5bf163ad56ef35f304525a6e0a5936ba6009 /test/CacheTest.php
parent8fae01b172b5c6006e6f96383f538147d73601b6 (diff)
Separate test for multiple connection caches
Diffstat (limited to 'test/CacheTest.php')
-rw-r--r--test/CacheTest.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/CacheTest.php b/test/CacheTest.php
index 4d9e778..8479d13 100644
--- a/test/CacheTest.php
+++ b/test/CacheTest.php
@@ -32,12 +32,14 @@ class CacheTest extends PHPUnit_Framework_TestCase {
$expected = ORM::get_last_query();
ORM::for_table('widget')->where('name', 'Fred')->where('age', 17)->find_one(); // this shouldn't run a query!
$this->assertEquals($expected, ORM::get_last_query());
+ }
+ public function testQueryGenerationOnlyOccursOnceWithMultipleConnections() {
// Test caching with multiple connections (also a bit of a hack)
ORM::for_table('widget', self::ALTERNATE)->where('name', 'Steve')->where('age', 80)->find_one();
ORM::for_table('widget', self::ALTERNATE)->where('name', 'Tom')->where('age', 120)->find_one();
- $expectedToo = ORM::get_last_query();
+ $expected = ORM::get_last_query();
ORM::for_table('widget', self::ALTERNATE)->where('name', 'Steve')->where('age', 80)->find_one(); // this shouldn't run a query!
- $this->assertEquals($expectedToo, ORM::get_last_query(self::ALTERNATE));
+ $this->assertEquals($expected, ORM::get_last_query(self::ALTERNATE));
}
} \ No newline at end of file