Development

Changeset 12026

You must first sign up to be able to contribute.

Changeset 12026

Show
Ignore:
Timestamp:
10/07/08 13:40:22 (2 months ago)
Author:
blacksun
Message:

fixed config-dependent test

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfModerationPlugin/test/unit/all/sfModerationBasicFeaturesTest.php

    r11988 r12026  
    5151))); 
    5252 
     53 
     54function remove_config_key($code) 
     55{ 
     56  $whole_conf = sfConfig::getAll(); 
     57  sfConfig::clear(); 
     58  if (isset($whole_conf[$code])) 
     59  { 
     60    unset($whole_conf[$code]); 
     61  } 
     62  foreach ($whole_conf as $conf_key => $conf_value) 
     63  { 
     64    sfConfig::set($conf_key, $conf_value); 
     65  } 
     66} 
    5367 
    5468// Now we can start to test 
     
    159173$t->is(call_user_func(array($test_peer_class, 'doCount'), new Criteria()), 2, 'Setting sfPropelModerationBehavior::enable() enables the spam check in selections'); 
    160174 
    161  
    162 //$t->is($item1->); 
    163  
    164175$t->diag('Monitoring and sfModeratedContent'); 
     176remove_config_key('app_sfModerationPlugin_is_monitored'); 
    165177sfConfig::set('app_sfModerationPlugin_monitoring_treshold', sfPropelModerationBehavior::TAGGED_SAFE); 
    166178$item1 = new $test_class();