#5860: Testsuite should reset _queryCache for each test
---------------------------+------------------------------------------------
   Reporter:  teemow       |          Owner:     
       Type:  Enhancement  |         Status:  new
   Priority:  Medium       |      Milestone:     
  Component:  Test Suite   |        Version:     
   Severity:  Normal       |       Keywords:     
Php_version:  n/a          |   Cake_version:     
---------------------------+------------------------------------------------
 For each test to be executed without interdependencies the testsuite
 should reset the query cache.
 [[BR]]
 [[BR]]
 Currently those two tests can not run after each other. The second one
 would read the same data that the first one created although the fixtures
 were recreated in the database. The attached diff would solve this issue.
 This could be fixed in endTest() manually for each of your test cases.

 {{{
 class AdTestCase extends CakeTestCase {
     public $Ad = null;
     public $fixtures = array('app.ad');

     public function startTest() {
         $this->Ad =& ClassRegistry::init('Ad');
     }

     function testRefreshCache() {
         $this->Ad->id = 1;
         $this->Ad->refreshCache();

         $data = $this->Ad->read();
         $this->assertEqual(md5($data['Ad']['cache']),
 '7d384e79e709661dcc86fe54c12b0a8f');
         $this->assertEqual($data['Ad']['cache_outdated'], 0);
     }

     function testCheckCache() {
         $this->Ad->id = 1;
         $this->Ad->checkCache();

         $data = $this->Ad->read();
         $this->assertEqual(md5($data['Ad']['cache']), md5(''));
         $this->assertEqual($data['Ad']['cache_outdated'], 1);
     }
 }
 }}}

-- 
Ticket URL: <https://trac.cakephp.org/ticket/5860>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design 
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. 
Our primary goal is to provide a structured framework that enables PHP users at 
all levels to rapidly develop robust web applications, without any loss to 
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tickets cakephp" group.
To post to this group, send email to tickets-cakephp@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to