Exemplo n.º 1
0
 protected function setUp()
 {
     parent::setUp();
     $this->test = new mpv_tests_modx(new mpv());
     $this->test->modx_object = new phpbb_mock_modx_object();
     $this->version = new phpbb_mock_modx_version();
 }
Exemplo n.º 2
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     if (version_compare(PHP_VERSION, '5.3.19', '<')) {
         self::markTestSkipped('UI test case requires at least PHP 5.3.19.');
     } else {
         if (!class_exists('\\RemoteWebDriver')) {
             self::markTestSkipped('Could not find RemoteWebDriver class. ' . 'Run "php ../composer.phar install" from the tests folder.');
         }
     }
     self::$config = phpbb_test_case_helpers::get_test_config();
     self::$root_url = self::$config['phpbb_functional_url'];
     // Important: this is used both for installation and by
     // test cases for querying the tables.
     // Therefore table prefix must be set before a board is
     // installed, and also before each test case is run.
     self::$config['table_prefix'] = 'phpbb_';
     if (!isset(self::$config['phpbb_functional_url'])) {
         self::markTestSkipped('phpbb_functional_url was not set in test_config and wasn\'t set as PHPBB_FUNCTIONAL_URL environment variable either.');
     }
     if (!self::$webDriver) {
         try {
             $capabilities = array(\WebDriverCapabilityType::BROWSER_NAME => 'firefox');
             self::$webDriver = RemoteWebDriver::create(self::$host . ':' . self::$port, $capabilities);
         } catch (WebDriverCurlException $e) {
             self::markTestSkipped('PhantomJS webserver is not running.');
         }
     }
     if (!self::$already_installed) {
         self::install_board();
         self::$already_installed = true;
     }
 }
Exemplo n.º 3
0
 public function setUp()
 {
     parent::setUp();
     $filesystem = new \phpbb\filesystem\filesystem();
     $this->set_phpbb_root_path($filesystem);
     $this->path_helper = new \phpbb\path_helper(new \phpbb\symfony_request(new phpbb_mock_request()), new \phpbb\filesystem\filesystem(), $this->getMock('\\phpbb\\request\\request'), $this->phpbb_root_path, 'php');
 }
Exemplo n.º 4
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $reflection_class = new ReflectionClass('\\phpbb\\extension\\base');
     self::$reflection_method_get_migration_file_list = $reflection_class->getMethod('get_migration_file_list');
     self::$reflection_method_get_migration_file_list->setAccessible(true);
 }
Exemplo n.º 5
0
 protected function setUp()
 {
     parent::setUp();
     global $user;
     $user = new phpbb_mock_user();
     $user->lang = new phpbb_mock_lang();
 }
Exemplo n.º 6
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $reflection = new ReflectionClass('\\phpbb\\language\\language');
     self::$language_reflection_lang = $reflection->getProperty('lang');
     self::$language_reflection_lang->setAccessible(true);
 }
Exemplo n.º 7
0
 public function setUp()
 {
     parent::setUp();
     $this->user = new \phpbb\user('\\phpbb\\datetime');
     $this->user->data = array('user_lang' => 'en');
     $this->user->add_lang('common');
 }
Exemplo n.º 8
0
 protected function setUp()
 {
     parent::setUp();
     global $config, $user, $request;
     $user = new phpbb_mock_user();
     $request = new phpbb_mock_request();
 }
Exemplo n.º 9
0
 public function setUp()
 {
     parent::setUp();
     $this->config = new \phpbb\config\config(array());
     $this->db = new \phpbb\db\driver\sqlite();
     $this->db_tools = new \phpbb\db\tools($this->db);
     $this->table_prefix = 'phpbb_';
 }
Exemplo n.º 10
0
 public function setUp()
 {
     parent::setUp();
     global $phpbb_container;
     $phpbb_container = new phpbb_mock_container_builder();
     $phpbb_container->set('auth.provider_collection', array('auth.provider.acp_board_valid' => new phpbb\auth\provider\acp\board_valid(), 'auth.provider.acp_board_invalid' => new phpbb\auth\provider\acp\board_invalid()));
     $this->acp_board = new acp_board();
 }
Exemplo n.º 11
0
 public function setUp()
 {
     global $cache, $user, $phpbb_dispatcher;
     parent::setUp();
     $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
     $config = new \phpbb\config\config(array());
     set_config(null, null, null, $config);
 }
Exemplo n.º 12
0
 protected function tearDown()
 {
     parent::tearDown();
     if (self::$db instanceof \phpbb\db\driver\driver_interface) {
         // Close the database connections again this test
         self::$db->sql_close();
     }
 }
Exemplo n.º 13
0
 public function setUp()
 {
     parent::setUp();
     global $phpbb_root_path, $phpEx;
     include_once $phpbb_root_path . 'includes/functions.' . $phpEx;
     $this->cache = $this->getMockBuilder('\\phpbb\\cache\\service')->disableOriginalConstructor()->getMock();
     $this->version_helper = new \phpbb\version_helper($this->cache, new \phpbb\config\config(array('version' => '3.1.0')), new \phpbb\file_downloader(), new \phpbb\user('\\phpbb\\datetime'));
 }
Exemplo n.º 14
0
 public function setUp()
 {
     parent::setUp();
     $user = new \phpbb\user('\\phpbb\\datetime');
     $user->add_lang('ucp');
     $request = $this->getMock('\\phpbb\\request\\request');
     $template = $this->getMock('\\phpbb\\template\\template');
     $this->field = new \phpbb\profilefields\type\type_googleplus($request, $template, $user);
 }
 public function setUp()
 {
     global $cache, $user, $phpbb_dispatcher;
     parent::setUp();
     $cache = new phpbb_mock_cache();
     $user = new phpbb_mock_user();
     $user->optionset('viewcensors', false);
     $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
 }
Exemplo n.º 16
0
 public function setUp()
 {
     $container = new phpbb_mock_container_builder();
     $container->set('foo', new StdClass());
     $container->set('bar', new StdClass());
     $this->service_collection = new \phpbb\di\service_collection($container);
     $this->service_collection->add('foo');
     $this->service_collection->add('bar');
     parent::setUp();
 }
Exemplo n.º 17
0
 protected function setUp()
 {
     global $user, $phpbb_dispatcher, $phpbb_container, $phpbb_root_path, $phpbb_path_helper;
     parent::setUp();
     $phpbb_container = new phpbb_mock_container_builder();
     $user = new phpbb_mock_user();
     $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
     $phpbb_path_helper = new \phpbb\path_helper(new \phpbb\symfony_request(new phpbb_mock_request()), new \phpbb\filesystem\filesystem(), $this->getMock('\\phpbb\\request\\request'), $phpbb_root_path, 'php');
     $phpbb_container->set('path_helper', $phpbb_path_helper);
 }
Exemplo n.º 18
0
 public function setUp()
 {
     parent::setUp();
     global $auth, $phpbb_dispatcher, $user;
     $auth = $this->getMock('\\phpbb\\auth\\auth');
     $auth->expects($this->any())->method('acl_get')->with($this->stringContains('_'), $this->anything())->will($this->returnValueMap(array(array('u_viewprofile', true))));
     $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
     $user->data['user_id'] = ANONYMOUS;
     $user->lang['GUEST'] = 'Guest';
 }
Exemplo n.º 19
0
 public function setUp()
 {
     parent::setUp();
     global $phpbb_root_path, $phpEx;
     $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
     $lang = new \phpbb\language\language($lang_loader);
     $user = new \phpbb\user($lang, '\\phpbb\\datetime');
     $this->user = $user;
     $this->user->data = array('user_lang' => 'en');
     $this->user->add_lang('common');
 }
Exemplo n.º 20
0
 public function setUp()
 {
     $this->phpbb_root_path = dirname(__FILE__) . '/';
     $this->config_php = new \phpbb\config_php_file($this->phpbb_root_path . 'fixtures/', 'php');
     $this->builder = new phpbb_mock_phpbb_di_container_builder($this->config_php, $this->phpbb_root_path . 'fixtures/', 'php');
     $this->filename = $this->phpbb_root_path . '../tmp/container.php';
     if (is_file($this->filename)) {
         unlink($this->filename);
     }
     parent::setUp();
 }
 public function setUp()
 {
     global $config, $phpbb_container, $phpbb_dispatcher;
     parent::setUp();
     $config = new \phpbb\config\config(array());
     set_config(null, null, null, $config);
     $phpbb_container = new phpbb_mock_container_builder();
     $phpbb_container->set('config', $config);
     $this->get_test_case_helpers()->set_s9e_services($phpbb_container);
     $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
 }
Exemplo n.º 22
0
 public function setUp()
 {
     parent::setUp();
     global $phpbb_root_path, $phpEx;
     $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
     $lang = new \phpbb\language\language($lang_loader);
     $user = new \phpbb\user($lang, '\\phpbb\\datetime');
     $user->add_lang('ucp');
     $request = $this->getMock('\\phpbb\\request\\request');
     $template = $this->getMock('\\phpbb\\template\\template');
     $this->field = new \phpbb\profilefields\type\type_googleplus($request, $template, $user);
 }
Exemplo n.º 23
0
	public function __construct($name = NULL, array $data = array(), $dataName = '')
	{
		parent::__construct($name, $data, $dataName);

		$this->backupStaticAttributesBlacklist += array(
			'phpbb_functional_test_case' => array('config', 'already_installed'),
		);

		if (!static::$already_installed)
		{
			$this->install_board();
			$this->bootstrap();
			static::$already_installed = true;
		}
	}
Exemplo n.º 24
0
 public function setUp()
 {
     parent::setUp();
     global $phpbb_root_path, $phpEx;
     include_once $phpbb_root_path . 'includes/functions.' . $phpEx;
     $config = new \phpbb\config\config(array('version' => '3.1.0'));
     $container = new \phpbb_mock_container_builder();
     $db = new \phpbb\db\driver\factory($container);
     $this->cache = $this->getMock('\\phpbb\\cache\\service', array('get'), array(new \phpbb\cache\driver\null(), $config, $db, '../../', 'php'));
     $this->cache->expects($this->any())->method('get')->with($this->anything())->will($this->returnValue(false));
     $this->file_downloader = new phpbb_mock_file_downloader();
     $this->version_helper = new \phpbb\version_helper($this->cache, $config, $this->file_downloader, new \phpbb\user('\\phpbb\\datetime'));
     $this->user = new \phpbb\user('\\phpbb\\datetime');
     $this->user->add_lang('acp/common');
 }
 /**
  * Set up test environment
  */
 public function setUp()
 {
     parent::setUp();
     $this->auth = $this->getMock('\\phpbb\\auth\\auth');
     $this->user = $this->getMockBuilder('\\phpbb\\user')->disableOriginalConstructor()->getMock();
 }
Exemplo n.º 26
0
 public function setUp()
 {
     parent::setUp();
     $this->filesystem = new \phpbb\filesystem\filesystem();
 }
Exemplo n.º 27
0
 protected function setUp()
 {
     parent::setUp();
     $this->helper = new phpbb_functions_validate_data_helper($this);
 }
Exemplo n.º 28
0
 public function setUp()
 {
     parent::setUp();
     global $phpbb_filesystem;
     $phpbb_filesystem = new \phpbb\filesystem\filesystem();
 }
Exemplo n.º 29
0
 public function setUp()
 {
     parent::setUp();
     global $phpbb_root_path;
     $this->exporter = new \phpbb\event\php_exporter($phpbb_root_path);
 }
Exemplo n.º 30
0
 public function setUp()
 {
     parent::setUp();
     $this->helper = new \phpbb\db\migration\helper();
 }