Skip to content

Commit

Permalink
Unit test Plugin/Cache now extends Plugin and resets OODB afterwards.
Browse files Browse the repository at this point in the history
  • Loading branch information
gabordemooij committed Aug 10, 2012
1 parent c8b286a commit edd79ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion testing/RedUNIT/Plugin/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* This source file is subject to the BSD/GPLv2 License that is bundled
* with this source code in the file license.txt.
*/
class RedUNIT_Plugin_Cache extends RedUNIT {
class RedUNIT_Plugin_Cache extends RedUNIT_Plugin {


/**
Expand All @@ -28,6 +28,7 @@ public function getTargetDrivers() {
public function run() {

R::nuke();
$old = R::$redbean;//backup redbean to clean up after test!
R::$redbean = new RedBean_Plugin_Cache(R::$writer);
$cachedOODB = R::$redbean;
$cachedOODB->addListener(R::$adapter);
Expand Down Expand Up @@ -109,6 +110,7 @@ public function run() {
R::load('hamburger',$b->id);
asrt($cachedOODB->getHits(),10);

R::$redbean = $old; //reset for next test
}

}

0 comments on commit edd79ca

Please sign in to comment.