/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 3.1 */ protected function setUp() { $this->toolbar = JToolbar::getInstance(); $this->object = $this->toolbar->loadButtonType('link'); $this->saveFactoryState(); JFactory::$application = $this->getMockApplication(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 3.0 */ protected function setUp() { $this->toolbar = JToolbar::getInstance(); $this->object = $this->toolbar->loadButtonType('confirm'); $this->saveFactoryState(); JFactory::$application = $this->getMockCmsApp(); $this->backupServer = $_SERVER; $_SERVER['HTTP_HOST'] = 'example.com'; $_SERVER['SCRIPT_NAME'] = ''; }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { $this->toolbar = JToolbar::getInstance(); $this->object = $this->toolbar->loadButtonType('confirm'); }
/** * K2import entry point for K2import Component * * @package K2import * @link http://www.individual-it.net * @license GNU/GPL */ // no direct access defined('_JEXEC') or die('Restricted access'); // Require the base controller require_once JPATH_COMPONENT . DS . 'controller.php'; require_once JPATH_COMPONENT . DS . 'helper.php'; //Create a new toolbar: jimport('joomla.html.toolbar'); $toolbar = new JToolbar('toolbar'); //Add the Jix button path & load the upload button type: $toolbar->addButtonPath(JPATH_COMPONENT . DS . 'button'); $button =& $toolbar->loadButtonType('Upload', true); $button =& $toolbar->loadButtonType('Export', true); $button =& $toolbar->loadButtonType('Instructions', true); // Require specific controller if requested if ($controller = JRequest::getVar('controller')) { require_once JPATH_COMPONENT . DS . 'controllers' . DS . $controller . '.php'; } // Create the controller $classname = 'K2importController' . $controller; $controller = new $classname(); // Perform the Request task $controller->execute(JRequest::getVar('task')); // Redirect if set by the controller $controller->redirect();
/** * @todo Implement testLoadButtonType(). */ public function testLoadButtonType() { $this->assertThat($this->object->loadButtonType('Separator'), $this->isInstanceOf('JToolbarButtonSeparator')); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 3.0 */ protected function setUp() { parent::setUp(); $this->toolbar = JToolbar::getInstance(); $this->object = $this->toolbar->loadButtonType('custom'); }