public function setUp() { parent::setUp(); parent::setUpBeforeClass(); $this->saveFactoryState(); SHFactory::$config = null; }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 3.2 */ protected function setUp() { parent::setUp(); $this->saveFactoryState(); $this->object = new JHelper(); JFactory::$application = $this->getMockCmsApp(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 3.2 */ protected function setUp() { parent::setUp(); $this->saveFactoryState(); JFactory::$application = $this->getMockCmsApp(); JFactory::$session = $this->getMockSession(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 3.2 */ protected function setUp() { parent::setUp(); $this->saveFactoryState(); JFactory::$application = $this->getMockWeb(); $this->object = new JUcmBase('com_content.article'); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 3.2 */ protected function setUp() { parent::setUp(); $this->saveFactoryState(); JFactory::$application = $this->getMockWeb(); $this->object = new JUcmContent(JTable::getInstance('Content'), 'com_content.article'); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 12.1 */ protected function setUp() { parent::setUp(); $this->saveFactoryState(); JFactory::$application = $this->getMockCmsApp(); JFactory::$application->expects($this->any())->method('triggerEvent')->willReturn([]); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 3.2 */ protected function setUp() { parent::setUp(); $this->saveFactoryState(); JFactory::$application = $this->getMockApplication(); $this->object = new JUcmType(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 12.1 */ protected function setUp() { parent::setUp(); $this->saveFactoryState(); // Set the session object for JUserHelper::addUserToGroup() JFactory::$session = $this->getMockSession(); }
/** * Sets up the fixture. * * This method is called before a test is executed. * * @return void */ protected function setUp() { JFactory::$application = $this->getMockApplication(); JFactory::$document = $this->getMockDocument(); $this->_instance = new JDocumentRendererMessage(JFactory::getDocument()); parent::setUp(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 3.4 */ protected function setUp() { parent::setUp(); JUri::reset(); $this->server = $_SERVER; $_SERVER['HTTP_HOST'] = 'mydomain.com'; }
/** * Setup each test. * * @since 3.4 * * @return void */ public function setUp() { parent::setUp(); $this->saveFactoryState(); JFactory::$application = $this->getMockCmsApp(); $this->object = new JModelList(array("filter_fields" => array("field1", "field2"))); }
/** * Sets up dependencies for the test. * * @return void * * @since 11.1 */ protected function setUp() { parent::setUp(); require_once JPATH_PLATFORM . '/joomla/form/fields/accesslevel.php'; include_once dirname(__DIR__) . '/inspectors.php'; }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 3.5 */ protected function setUp() { parent::setUp(); $app = $this->getMockCmsApp(); JFactory::$application = $app; $router = new JComponentRouterViewInspector($app, $app->getMenu()); $router->set('name', 'content'); $categories = new JComponentRouterViewconfiguration('categories'); $categories->setKey('id'); $router->registerView($categories); $category = new JComponentRouterViewconfiguration('category'); $category->setKey('id')->setParent($categories)->setNestable()->addLayout('blog'); $router->registerView($category); $article = new JComponentRouterViewconfiguration('article'); $article->setKey('id')->setParent($category, 'catid'); $router->registerView($article); $archive = new JComponentRouterViewconfiguration('archive'); $router->registerView($archive); $featured = new JComponentRouterViewconfiguration('featured'); $router->registerView($featured); $form = new JComponentRouterViewconfiguration('form'); $router->registerView($form); $router->menu = new MockJComponentRouterRulesMenuMenuObject(); $this->object = new JComponentRouterRulesMenuInspector($router); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 3.2 */ public function setUp() { parent::setUp(); // Add JApplication and JLanguage dependencies $this->saveFactoryState(); JFactory::$language = $this->getMockLanguage(); JFactory::$application = $this->getMockCmsApp(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 3.4 */ protected function setUp() { parent::setUp(); $app = $this->getMockCmsApp(); JFactory::$application = $app; JFactory::$session = $this->getMockSession(); $this->object = new JComponentRouterViewInspector($app, $app->getMenu()); }
/** * Sets up the fixture. * * This method is called before a test is executed. * * @return void * * @since 12.1 */ protected function setUp() { parent::setUp(); $this->saveFactoryState(); $this->object = new JUser('42'); }
/** * Setup for testing. * * @return void */ public function setUp() { parent::setUp(); // Mock JFilter $filterMock = $this->getMock('JFilterInput', array('filter')); $filterSig = md5(serialize(array(array(), array(), 0, 0, 1))); TestReflection::setValue('JFilterInput', 'instances', array($filterSig => $filterMock)); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void */ protected function setUp() { parent::setUp(); // Get the mocks $this->saveFactoryState(); JFactory::$session = $this->getMockSession(); $this->object = new JTableLanguage(self::$driver); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 12.3 */ protected function setUp() { parent::setUp(); $this->saveFactoryState(); $mockApp = $this->getMockCmsApp(); $mockApp->expects($this->any())->method('getDispatcher')->willReturn($this->getMockDispatcher()); JFactory::$application = $mockApp; }
/** * 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() { parent::setUp(); // Get the mocks $this->saveFactoryState(); JFactory::$session = $this->getMockSession(); $this->object = new JTableCorecontent(static::$driver); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 12.3 */ protected function setUp() { parent::setUp(); $this->saveFactoryState(); $mockApp = $this->getMockCmsApp(); $mockApp->expects($this->any())->method('getDispatcher')->willReturn($this->getMockDispatcher()); JFactory::$application = $mockApp; $this->object = new TableDbTestComposite(TestCaseDatabase::$driver); }
/** * 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() { parent::setUp(); $this->saveFactoryState(); $mockApp = $this->getMockCmsApp(); $mockApp->expects($this->any())->method('getDispatcher')->willReturn($this->getMockDispatcher()); JFactory::$application = $mockApp; $this->object = new JTableContenttype(static::$driver); }
/** * Sets up dependencies for the test. * * @since 11.3 * * @return void */ protected function setUp() { parent::setUp(); $this->saveFactoryState(); JFactory::$application = $this->getMockCmsApp(); $this->backupServer = $_SERVER; $_SERVER['HTTP_HOST'] = 'example.com'; $_SERVER['SCRIPT_NAME'] = ''; }
/** * Sets up the fixture. * * This method is called before a test is executed. */ protected function setUp() { parent::setUp(); $this->saveFactoryState(); JFactory::$application = $this->getMockCmsApp(); JFactory::$document = $this->getMockDocument(); JFactory::$session = $this->getMockSession(); $this->instance = new JDocumentRendererMessage(JFactory::getDocument()); }
/** * 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() { parent::setUp(); $this->saveFactoryState(); JFactory::$application = $this->getMockCmsApp(); JFactory::$language = JLanguage::getInstance('en-GB', false); $this->backupServer = $_SERVER; $_SERVER['HTTP_HOST'] = 'example.com'; $_SERVER['SCRIPT_NAME'] = ''; }
/** * Setup each test. * * @since 12.3 * * @return void */ public function setUp() { parent::setUp(); // Get the mocks $this->saveFactoryState(); $mockApp = $this->getMockCmsApp(); $mockApp->expects($this->any())->method('getDispatcher')->willReturn($this->getMockDispatcher()); JFactory::$application = $mockApp; $this->fixture = JModelLegacy::getInstance('Lead', 'TestModel'); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 3.6 */ protected function setUp() { parent::setUp(); $this->saveFactoryState(); JFactory::$application = $this->getMockCmsApp(); JFactory::$session = $this->getMockSession(); $this->dispatcher = new JEventDispatcher(); TestReflection::setValue($this->dispatcher, 'instance', $this->dispatcher); $this->dispatcher->register('onAfterRenderModules', array($this, 'eventCallback')); }
/** * Setup for testing. * * @return void */ public function setUp() { parent::setUp(); $this->saveFactoryState(); JFactory::$application = $this->getMockCmsApp(); // Mock JFilter $filterMock = $this->getMock('JFilterInput', array('filter')); $filterSig = md5(serialize(array(array(), array(), 0, 0, 1))); TestReflection::setValue('JFilterInput', 'instances', array($filterSig => $filterMock)); }
/** * 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() { parent::setUp(); require_once JPATH_PLATFORM . '/joomla/form/fields/number.php'; $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() { parent::setUp(); // Store the factory state so we can mock the necessary objects $this->saveFactoryState(); JFactory::$application = $this->getMockCmsApp(); JFactory::$database = $this->getMockDatabase('Mysqli'); JFactory::$session = $this->getMockSession(); // Register the object $this->object = FinderIndexer::getInstance(); }