Example #1
0
 /**
  * Test debug().
  */
 public function testDebug()
 {
     $m = new DebugMock();
     $this->assertEquals(false, $m->debug);
     $m->debug();
     $this->assertEquals(true, $m->debug);
     $m->debug(false);
     $this->assertEquals(false, $m->debug);
     $m->debug(true);
     $this->assertEquals(true, $m->debug);
     $m->debug(false)->debug('switch on');
     $this->assertEquals(false, $m->debug);
 }
  function tally()
  {
    $debug =& DebugMock :: instance();

    $debug->mock->tally();
    $debug->expected_data = array();
  }
  function tearDown()
  {
    DebugMock :: tally();

    unset($this->resolver);

    clearTestingIni();

    PackagesInfo :: instance()->reset();
  }
 function tearDown()
 {
   DebugMock :: tally();
   clearTestingIni();
 }
  function tearDown()
  {
    DebugMock :: tally();

    $this->db->sqlDelete('sys_param');
  }
  function testGetGroup()
  {
    registerTestingIni(
      'testing.ini',
      '
        unassigned =
        test = 1

        [test]
        test = 1
      '
    );

    $ini = getIni('testing.ini');

    $this->assertEqual($ini->getGroup('default'), array('unassigned' => '', 'test' => 1));
    $this->assertEqual($ini->getGroup('test'), array('test' => 1));

    DebugMock :: expectWriteNotice('undefined group',
      array(
        'ini' => $ini->getOriginalFile(),
        'group' => 'no_such_group'
      )
    );

    $this->assertNull($ini->getGroup('no_such_group'));
  }