/**
  * Set up method
  */
 protected function setUp()
 {
     /* Create mock objects required for testing */
     $this->context = MockContext::getInstance();
     $request = new MockWebRequest();
     // In sfConfigCache, we just need checkConfig method
     $configCache = $this->getMock('sfConfigCache', array('checkConfig'), array(), '', false);
     // Mock of controller, with redirect method mocked.
     $controller = $this->getMock('sfController', array('redirect', 'forward'), array(), '', false);
     $this->context->request = $request;
     $this->context->configCache = $configCache;
     $this->context->controller = $controller;
 }
Ejemplo n.º 2
0
 /**
  * Set up method
  */
 protected function setUp()
 {
     /* Create mock objects required for testing */
     $this->context = MockContext::getInstance();
     $request = new MockWebRequest();
     // In sfConfigCache, we just need checkConfig method
     $configCache = $this->getMock('sfConfigCache', array('checkConfig'), array(), '', false);
     // Mock of controller, with redirect method mocked.
     $controller = $this->getMock('sfController', array('redirect', 'forward'), array(), '', false);
     $this->fixture = sfConfig::get('sf_plugins_dir') . '/orangehrmCoreLeavePlugin/test/fixtures/AssignLeaveAction.yml';
     $this->context->request = $request;
     $this->context->configCache = $configCache;
     $this->context->controller = $controller;
 }