diff options
author | Simon Holywell <[email protected]> | 2013-01-23 14:37:20 +0000 |
---|---|---|
committer | Simon Holywell <[email protected]> | 2013-01-23 14:37:20 +0000 |
commit | 8296e52b053ecb29a8ee1ac2f9be95e36bf84cac (patch) | |
tree | f74d5bf163ad56ef35f304525a6e0a5936ba6009 | |
parent | 8fae01b172b5c6006e6f96383f538147d73601b6 (diff) |
Separate test for multiple connection caches
-rw-r--r-- | test/CacheTest.php | 6 |
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 |