예제 #1
0
 public function setUp()
 {
     parent::setUp();
     // Make sure the #__foobar_example table does not exist before running the tests
     $db = static::$container->db;
     $db->dropTable('#__foobar_example', true);
 }
예제 #2
0
파일: ViewTest.php 프로젝트: Joal01/fof
 protected function setUp()
 {
     parent::setUp();
     // Let's set a fake template to the platform
     $platform = static::$container->platform;
     $platform::$template = 'fake_test_template';
     // This is required by View constructor, since it will create an instance of JUri
     $_SERVER['HTTP_HOST'] = 'www.example.com';
 }
예제 #3
0
파일: TemplateTest.php 프로젝트: Joal01/fof
 protected function setUp()
 {
     parent::setUp();
     // Force a JDocumentHTML instance
     $this->saveFactoryState();
     JFactory::$document = JDocument::getInstance('html');
     // Fake the server variables to get JURI working right
     global $_SERVER;
     $this->_stashedServer = $_SERVER;
     $_SERVER['HTTP_HOST'] = 'www.example.com';
     $_SERVER['REQUEST_URI'] = '/index.php?option=com_foobar';
     $_SERVER['SCRIPT_NAME'] = '/index.php';
     // Fake the session
     JFactory::$session = $this->getMockSession();
     $application = JFactory::getApplication('site');
     // Reset the fake platform
     TestJoomlaPlatform::$template = null;
     TestJoomlaPlatform::$baseDirs = null;
     TestJoomlaPlatform::$isAdmin = null;
     TestJoomlaPlatform::$isCli = null;
     TestJoomlaPlatform::$templateSuffixes = null;
     // Reset JURI
     $reflector = new \ReflectionClass('\\JUri');
     $instancesProp = $reflector->getProperty('instances');
     $instancesProp->setAccessible(true);
     $instancesProp->setValue(array());
     $baseProp = $reflector->getProperty('base');
     $baseProp->setAccessible(true);
     $baseProp->setValue(array());
     $rootProp = $reflector->getProperty('root');
     $rootProp->setAccessible(true);
     $rootProp->setValue(array());
     // Fake the template
     $template = (object) array('template' => 'fake_test_template');
     $attribute = new ReflectionProperty($application, 'template');
     $attribute->setAccessible(TRUE);
     $attribute->setValue($application, $template);
 }
예제 #4
0
 protected function setUp()
 {
     parent::setUp();
     $this->saveFactoryState();
     $this->platform = new Platform(static::$container);
 }
 protected function setUp()
 {
     parent::setUp();
     $this->auth = new TransparentAuthentication(static::$container);
     $this->auth->setAuthenticationMethods(array(1, 2, 3, 4, 5));
     $this->auth->setBasicAuthUsername('FOF30user');
     $this->auth->setQueryParam('testAuth');
     $this->auth->setQueryParamPassword('FOF30Password');
     $this->auth->setQueryParamUsername('FOF30Username');
     $this->auth->setTimeStep(30);
     $this->auth->setTotpKey(self::$totpKey);
 }
예제 #6
0
 /**
  * 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::$application = $this->getMockCmsApp();
 }