diff options
Diffstat (limited to 'test')
-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 |