function test_get_rules_from_ini()
  {
    $cache_manager = new full_page_cache_manager();

    register_testing_ini(
      'full_page_cache.ini',
      '
      [rule1]
       path_regex = /root/test1
       optional[] = test1
       optional[] = test2
      [rule2]
       path_regex = /root/test2
       groups[] = members
       groups[] = visitors
      [not_valid_rule]
       path_regex = /root/test3
      '
    );

    $this->assertEqual($cache_manager->get_rules(),
      array(
        array('path_regex' => '/root/test1', 'optional' => array('test1', 'test2')),
        array('path_regex' => '/root/test2', 'groups' => array('members', 'visitors'))
      )
    );

    clear_testing_ini();
  }
  function test_get_rules_from_ini()
  {
    $cache_manager = new partial_page_cache_manager();

    register_testing_ini(
      'partial_page_cache.ini',
      '
      [rule1]
       server_id = test1
       optional[] = test1
       required[] = test2
      [rule2]
       server_id = wow
       groups[] = members
       groups[] = visitors
      [not_valid_rule]
       bla-bla = bla-bla
      '
    );

    $this->assertEqual($cache_manager->get_rules(),
      array(
        array('server_id' => 'test1', 'optional' => array('test1'), 'required' => array('test2')),
        array('server_id' => 'wow', 'groups' => array('members', 'visitors'))
      )
    );

    clear_testing_ini();
  }
 function test_get_jobs_from_ini()
 {
     $cron_manager = new cron_manager();
     register_testing_ini('cron.ini', ' 
   [cron-job1]
    handle = test1.php
    interval = 10
   [cron-job2]
    handle = test2.php
    interval = 20
   [not_valid_cron-job]
    bla-bla = bla-bla
   ');
     $this->assertEqual($cron_manager->get_jobs(), array('cron-job1' => array('handle' => 'test1.php', 'interval' => 10), 'cron-job2' => array('handle' => 'test2.php', 'interval' => 20)));
     clear_testing_ini();
 }
 function tearDown()
 {
   debug_mock :: tally();
   clear_testing_ini();
 }
 function tearDown()
 {
   clear_testing_ini();
 }