function tearDown()
  {
    $this->toolkit->tally();
    $this->uow->tally();

    Limb :: restoreToolkit();
  }
  function tearDown()
  {
    $this->tree->tally();

    $this->_cleanUp();
    Limb :: restoreToolkit();
  }
  function tearDown()
  {
    Limb :: restoreToolkit();

    $this->toolkit->tally();
    $this->response->tally();
  }
 function tearDown()
 {
     $this->toolkit->tally();
     $this->authorizer->tally();
     ClearTestingTemplates();
     Limb::restoreToolkit('SimpleACL');
 }
  function tearDown()
  {
    $this->object->tally();
    $this->tree->tally();
    $this->toolkit->tally();

    Limb :: restoreToolkit();
  }
  function tearDown()
  {
    $this->parent->tally();
    $this->request->tally();
    $this->toolkit->tally();

    Limb :: restoreToolkit();
  }
  function tearDown()
  {
    $this->mapper->tally();
    $this->dao->tally();
    $this->toolkit->tally();

    Limb :: restoreToolkit();
  }
 function tearDown()
 {
     $this->uow->tally();
     $this->toolkit->tally();
     $this->translator->tally();
     Limb::restoreToolkit();
     $this->_cleanUp();
 }
  function tearDown()
  {
    $this->db->delete('sys_session');

    $this->user->tally();

    Limb :: restoreToolkit();
  }
  function tearDown()
  {
    $this->path2id_resolver->tally();

    Limb :: restoreToolkit();

    $this->_cleanUp();
  }
  function tearDown()
  {
    $this->dao->tally();
    $this->sql->tally();
    $this->conn->tally();
    $this->stmt->tally();

    Limb :: restoreToolkit();
  }
  function tearDown()
  {
    Limb :: restoreToolkit();

    $this->action_resolver->tally();
    $this->service_resolver->tally();
    $this->service->tally();
    $this->fc->tally();
  }
  function tearDown()
  {
    $this->path2id_translator->tally();
    $this->toolkit->tally();

    Limb :: restoreToolkit();

    ClearTestingTemplates();
  }
  function tearDown()
  {
    $this->delegated_mapper->tally();
    $this->toolkit->tally();

    $this->_cleanUp();

    Limb :: restoreToolkit();
  }
 function tearDown()
 {
     $this->toolkit->tally();
     $this->response->tally();
     $this->request->tally();
     $this->datasource->tally();
     $this->mime->tally();
     Limb::restoreToolkit();
 }
  function tearDown()
  {
    $this->toolkit->tally();
    $this->tree->tally();

    Limb :: restoreToolkit();

    parent :: tearDown();
  }
  function tearDown()
  {
    $this->ds->tally();
    $this->toolkit->tally();

    Limb :: restoreToolkit();

    ClearTestingTemplates();
  }
  function testPerformOk()
  {
    $response =& new MockHttpResponse($this);
    $toolkit =& new MockLimbToolkit($this);

    $toolkit->setReturnReference('getResponse', $response);

    Limb :: registerToolkit($toolkit);

    $command = new RedirectCommand($path = '/somewhere');

    $response->expectOnce('redirect', array($path));

    $this->assertEqual($command->perform(), LIMB_STATUS_OK);

    $response->tally();
    Limb :: restoreToolkit();
  }
  function testUseOtherLocale()
  {
    $toolkit =& new MockLimbToolkit($this);

    $real_toolkit = Limb :: toolkit();
    $locale = $real_toolkit->getLocale('ru');
    $locale->fract_digits = 4;

    $toolkit->setReturnReference('getLocale', $locale, array('ru'));

    Limb :: registerToolkit($toolkit);

    $template = '<limb:locale:NUMBER locale="ru">100000</limb:locale:NUMBER>';

    RegisterTestingTemplate('/limb/locale_number_russian.html', $template);

    $page =& new Template('/limb/locale_number_russian.html');

    $this->assertEqual($page->capture(), '100,000.0000');

    $toolkit->tally();
    Limb :: restoreToolkit();
  }
 function tearDown()
 {
     $this->toolkit;
     $this->tree;
     Limb::restoreToolkit();
 }
  function testNoConditionsIfTreePathNotFound()
  {
    $criteria = new SingleServiceNodeCriteria();
    $criteria->setPath('/root/no_such_object');
    $this->dao->addCriteria($criteria);

    $toolkit = new SingleServiceNodeCriteriaTestToolkit($this);
    $tree = new MockTree($this);
    $toolkit->setReturnReference('getTree', $tree);

    Limb :: registerToolkit($toolkit);

    $this->sql->expectOnce('addCondition', array('0 = 1'));
    $this->dao->fetch();

    Limb :: restoreToolkit();
  }
  function testGetNextSectionUri()
  {
    $uri = new Uri('http://test.com');

    $toolkit =& new MockLimbToolkit($this);
    $request =& new MockRequest($this);

    $request->setReturnValue('getUri', $uri);

    $toolkit->setReturnReference('getRequest', $request);
    Limb :: registerToolkit($toolkit);

    $this->component->setPagerPrefix('p');
    $this->component->id = 'nav';
    $this->component->setTotalItems(60);
    $this->component->setItemsPerPage(10);
    $this->component->setPagesPerSection(2);

    $request->setReturnValue('export', array('p_nav' => 3));

    $this->component->prepare();

    for($i = 0; $i < 5; $i++)
      $this->component->nextPage();

    $uri = $this->component->getSectionUri(2);

    $this->assertEqual($uri, 'http://test.com?p_nav=5');
    $this->assertEqual($this->component->getSectionBeginPage(), 5);
    $this->assertEqual($this->component->getSectionEndPage(), 6);

    Limb :: restoreToolkit();
  }
  function tearDown()
  {
    Limb :: restoreToolkit();

    $this->form_component->tally();
  }
 function tearDown()
 {
   Limb :: restoreToolkit();
 }
 function tearDown()
 {
     Limb::restoreToolkit();
     clearTestingTemplates();
     $this->_cleanUp();
 }
 function tearDown()
 {
   Limb :: restoreToolkit();
   $this->fc->tally();
 }
 function tearDown()
 {
     Limb::restoreToolkit();
     $this->_cleanUp();
 }
  function testDBEUseOtherLocale()
  {
    $toolkit =& new MockLimbToolkit($this);

    $real_toolkit = Limb :: toolkit();
    $locale = $real_toolkit->getLocale('ru');
    $locale->fract_digits = 4;

    $toolkit->setReturnReference('getLocale', $locale, array('ru'));

    Limb :: registerToolkit($toolkit);

    $template = '{$var|LimbI18NNumber:"","ru"}';

    RegisterTestingTemplate('/limb/locale_number_filter_DBE_other_locale.html', $template);

    $page =& new Template('/limb/locale_number_filter_DBE_other_locale.html');
    $page->set('var', '100000');

    $this->assertEqual($page->capture(), '100,000.0000');

    $toolkit->tally();
    Limb :: restoreToolkit();
  }
  function testSaveToolkit()
  {
    $toolkit = new ImagineryToolkit();

    Limb :: registerToolkit($toolkit, 'test');

    $toolkit2 =& Limb :: saveToolkit('test');
    $this->assertTrue($toolkit2->reseted);

    $toolkit2->foo();

    //restoring saved toolkit
    Limb :: restoreToolkit('test');

    //should be a reference to $toolkit
    $toolkit3 =& Limb :: toolkit('test');
    $toolkit3->bar();

    $this->assertFalse($toolkit->foo_called);
    $this->assertTrue($toolkit->bar_called);

    Limb :: restoreToolkit('test');
  }
  function tearDown()
  {
    clearTestingTemplates();

    Limb :: restoreToolkit();
  }