/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { parent::setUp(); // Clear the static caches. JAccess::clearStatics(); $this->object = new JAccess(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { parent::setUp(); // Get the mocks $this->saveFactoryState(); JFactory::$session = $this->getMockSession(); $this->object = new JTableContent(self::$dbo); }
/** * Sets up the fixture */ protected function setUp() { parent::setUp(); parent::setUpBeforeClass(); // Force loading the component language $lang = JFactory::getLanguage(); $lang->load('com_attachments', JPATH_BASE . '/administrator/components/com_attachments'); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { jimport('joomla.user.user'); parent::setUp(); $this->saveFactoryState(); $this->saveErrorHandlers(); $this->setErrorCallback('JUserHelperTest'); JUserHelperTest::$actualError = array(); $this->object = new JUserHelper(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void */ protected function setUp() { include_once JPATH_BASE . '/libraries/joomla/event/dispatcher.php'; include_once JPATH_BASE . '/libraries/joomla/user/authentication.php'; parent::setUp(); $this->saveErrorHandlers(); $this->setErrorCallback('JAuthenticationTest'); JAuthenticationTest::$actualError = array(); $this->saveFactoryState(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 11.1 */ protected function setUp() { @(include_once JPATH_TESTS . '/config_mysql.php'); if (class_exists('JMySQLTestConfig')) { $config = new JMySQLTestConfig(); } else { $this->markTestSkipped('There is no mysql test config file present.'); } $this->object = JDatabase::getInstance(array('driver' => $config->dbtype, 'database' => $config->db, 'host' => $config->host, 'user' => $config->user, 'password' => $config->password)); parent::setUp(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void */ protected function setUp() { include_once JPATH_BASE . '/libraries/joomla/database/table.php'; include_once JPATH_BASE . '/libraries/joomla/user/user.php'; parent::setUp(); parent::setUpBeforeClass(); $this->saveFactoryState(); JUser::getTable('user', 'JTable'); $this->object = new JUser(42); $params = new JRegistry(); $this->object->setParameters($params); }
/** * Tests the JAccess::getAuthorisedViewLevels method. * * @return void * * @since 11.1 */ public function testGetAuthorisedViewLevels() { // Run the parent::setUp() method here to save time (since we only need to run it once) parent::setUp(); if (defined('DB_NOT_AVAILABLE')) { $this->markTestSkipped('The database is not available'); } $access = new JAccess(); $array1 = array(0 => 1, 1 => 3); $this->assertThat($access->getAuthorisedViewLevels(42), $this->equalTo($array1), 'Line:' . __LINE__ . ' Super user gets Public, Special (levels 1,3)'); $array2 = array(0 => 1); $this->assertThat($access->getAuthorisedViewLevels(50), $this->equalTo($array2), 'Line:' . __LINE__ . ' User 50 gets Public (level 1)'); $array3 = array(0 => 1, 1 => 4); $this->assertThat($access->getAuthorisedViewLevels(99), $this->equalTo($array3), 'Line:' . __LINE__ . ' User 99 gets Level 4'); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 11.3 */ protected function setUp() { parent::setUp(); jimport('joomla.html.html'); }
/** * Sets up the fixture */ protected function setUp() { parent::setUp(); parent::setUpBeforeClass(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 11.1 */ protected function setUp() { $config = new JTestConfig(); $this->object = JDatabase::getInstance(array('driver' => $config->dbtype, 'database' => $config->db, 'host' => $config->host, 'user' => $config->user, 'password' => $config->password)); parent::setUp(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 11.3 */ protected function setUp() { parent::setUp(); }
/** * 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(); $this->object = new JUserHelper(); }
/** * 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->object = new JAccess(); }