/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { parent::setup(); $this->saveFactoryState(); JFactory::$session = $this->getMockSession(); $this->object = new JTableCategory(self::$dbo); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @access protected */ protected function setUp() { parent::setup(); $connect = parent::getConnection(); $assets = $this->getDataSet(); $this->_db = JFactory::getDbo(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @access protected */ protected function setUp() { parent::setup(); $connect = parent::getConnection(); $categories = $this->getDataSet(); $this->_db = JFactory::getDbo(); $this->object = new JTableCategory($this->_db); JFactory::$session = $this->getMock('JSession', array('_start')); // Set up a mock database to return db errors $badDB = $this->getMock('JDatabaseMySQL', array('getErrorNum'), array(array('prefix' => 'jos_'))); $badDB->expects($this->any())->method('getErrorNum')->will($this->returnValue('1')); $this->badDB = $badDB; }