Changeset 3502
- Timestamp:
- 02/18/07 19:28:28 (2 years ago)
- Files:
-
- branches/1.0/lib/controller/sfFrontWebController.class.php (modified) (1 diff)
- branches/1.0/lib/filter/sfCacheFilter.class.php (modified) (1 diff)
- branches/1.0/lib/filter/sfFilter.class.php (modified) (3 diffs)
- branches/1.0/test/unit/filter/sfFilterTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/lib/controller/sfFrontWebController.class.php
r3204 r3502 37 37 } 38 38 39 // reinitialize filters (needed for unit and functional tests) 40 sfFilter::$filterCalled = array(); 41 39 42 // determine our module and action 40 43 $request = $this->getContext()->getRequest(); branches/1.0/lib/filter/sfCacheFilter.class.php
r3244 r3502 52 52 { 53 53 // execute this filter only once, if cache is set and no GET or POST parameters 54 if (! $this->isFirstCall() || !sfConfig::get('sf_cache') || count($_GET) || count($_POST))54 if (!sfConfig::get('sf_cache') || count($_GET) || count($_POST)) 55 55 { 56 56 $filterChain->execute(); branches/1.0/lib/filter/sfFilter.class.php
r3244 r3502 23 23 protected 24 24 $parameterHolder = null, 25 $filterCalled = array(),26 25 $context = null; 26 27 public static 28 $filterCalled = array(); 27 29 28 30 /** … … 34 36 { 35 37 $class = get_class($this); 36 if (isset( $this->filterCalled[$class]))38 if (isset(self::$filterCalled[$class])) 37 39 { 38 40 return false; … … 40 42 else 41 43 { 42 $this->filterCalled[$class] = true;44 self::$filterCalled[$class] = true; 43 45 44 46 return true; branches/1.0/test/unit/filter/sfFilterTest.php
r2276 r3502 12 12 require_once($_test_dir.'/unit/sfContextMock.class.php'); 13 13 14 $t = new lime_test( 19, new lime_output_color());14 $t = new lime_test(20, new lime_output_color()); 15 15 16 16 class myFilter extends sfFilter 17 17 { 18 public function isFirstCall BeforeExecution()18 public function isFirstCall() 19 19 { 20 return parent::isFirstCallBeforeExecution(); 21 } 22 23 public function isFirstCallBeforeRendering() 24 { 25 return parent::isFirstCallBeforeRendering(); 26 } 27 28 public function isFirstCall($type = 'beforeExecution') 29 { 30 return parent::isFirstCall($type); 20 return parent::isFirstCall(); 31 21 } 32 22 } … … 53 43 $t->is($filter->isFirstCall('beforeExecution'), false, '->isFirstCall() returns false if this is not the first call with this argument'); 54 44 45 $filter = new myFilter(); 46 $filter->initialize($context); 47 $t->is($filter->isFirstCall('beforeExecution'), false, '->isFirstCall() returns false if this is not the first call with this argument'); 48 55 49 // parameter holder proxy 56 50 require_once($_test_dir.'/unit/sfParameterHolderTest.class.php');