function test_Flags() { $this->dir('Flags'); Scaffold::flag_set('flag2'); Scaffold::flag_set('flag3'); $original = file_get_contents($this->dir() . 'in.css'); $expected = file_get_contents($this->dir() . 'out.css'); $css = Flags::post_process($original); $this->assertEqual($css, $expected); }
/** * Sets flags for different times of the day * * @author Anthony Short * @return void */ public static function flag() { $now = time() + 60 * 60 * Scaffold::$config['Time']['offset']; self::set_current_time($now); $condition_types = array_keys(self::$types); foreach (Scaffold::$config['Time']['flags'] as $flag_name => $conditions) { foreach ($condition_types as $check) { if (!isset($conditions[$check])) { continue; } if (is_array($conditions[$check])) { $result[] = self::is_between($conditions[$check]['from'], $conditions[$check]['to'], $check, $now); } else { $result[] = $conditions[$check] == self::$current[$check] ? true : false; } } # It met all the conditions! Set the flag me hearties! if (array_search(false, $result) === false) { Scaffold::flag_set($flag_name); } # Reset the results array $result = array(); } }
function testSetFlag() { $this->assertTrue(Scaffold::flag_set('Flag')); }
public static function flag() { Scaffold::flag_set('paginator'); Scaffold::flag_set(sprintf('pagestart=%d', @$_GET['pageStart'])); Scaffold::flag_set(sprintf('pageend=%d', @$_GET['pageEnd'])); }