public function setUp()
 {
     parent::setUp();
     parent::setUpBeforeClass();
     $this->saveFactoryState();
     SHFactory::$config = null;
 }
Exemplo n.º 2
0
 /**
  * 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();
 }
Exemplo n.º 4
0
 /**
  * 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');
 }
Exemplo n.º 5
0
 /**
  * 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');
 }
Exemplo n.º 6
0
 /**
  * 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();
 }
Exemplo n.º 8
0
 /**
  * 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();
 }
Exemplo n.º 10
0
 /**
  * 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';
 }
Exemplo n.º 11
0
 /**
  * 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());
 }
Exemplo n.º 16
0
	/**
	 * 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);
 }
Exemplo n.º 19
0
 /**
  * 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;
 }
Exemplo n.º 20
0
 /**
  * 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);
 }
Exemplo n.º 21
0
 /**
  * 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);
 }
Exemplo n.º 22
0
 /**
  * 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());
 }
Exemplo n.º 25
0
 /**
  * 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'] = '';
 }
Exemplo n.º 26
0
 /**
  * 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'));
 }
Exemplo n.º 28
0
 /**
  * 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));
 }
Exemplo n.º 29
0
 /**
  * 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'] = '';
 }
Exemplo n.º 30
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();
     // 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();
 }