Esempio n. 1
0
 /**
  * Tests that $cacheSources can only be disabled in the db using model settings, not enabled
  *
  * @access public
  * @return void
  */
 function testCacheSourcesDisabling()
 {
     $this->db->cacheSources = true;
     $TestModel = new JoinA();
     $TestModel->cacheSources = false;
     $TestModel->setSource('join_as');
     $this->assertFalse($this->db->cacheSources);
     $this->db->cacheSources = false;
     $TestModel = new JoinA();
     $TestModel->cacheSources = true;
     $TestModel->setSource('join_as');
     $this->assertFalse($this->db->cacheSources);
 }
Esempio n. 2
0
 /**
  * Tests that $cacheSources is restored despite the settings on the model.
  *
  * @return void
  */
 public function testCacheSourcesRestored()
 {
     $this->loadFixtures('JoinA', 'JoinB', 'JoinAB', 'JoinC', 'JoinAC');
     $this->db->cacheSources = true;
     $TestModel = new JoinA();
     $TestModel->cacheSources = false;
     $TestModel->setSource('join_as');
     $this->assertTrue($this->db->cacheSources);
     $this->db->cacheSources = false;
     $TestModel = new JoinA();
     $TestModel->cacheSources = true;
     $TestModel->setSource('join_as');
     $this->assertFalse($this->db->cacheSources);
 }