Inheritance: extends phpbb_test_case
コード例 #1
0
ファイル: template_test_case.php プロジェクト: phpbb/phpbb
 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);
 }
コード例 #2
0
ファイル: pagination_test.php プロジェクト: TupambaeNet/phpbb
	public function setUp()
	{
		parent::setUp();

		global $phpbb_dispatcher, $phpbb_root_path, $phpEx;

		$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
		$this->user = $this->getMock('\phpbb\user', array(), array(
			new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)),
			'\phpbb\datetime'
		));
		$this->user->expects($this->any())
			->method('lang')
			->will($this->returnCallback(array($this, 'return_callback_implode')));

		$filesystem = new \phpbb\filesystem\filesystem();
		$manager = new phpbb_mock_extension_manager(dirname(__FILE__) . '/', array());

		$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
		$router = new phpbb_mock_router(new phpbb_mock_container_builder(), $filesystem, dirname(__FILE__) . '/', 'php', PHPBB_ENVIRONMENT, $manager);
		$router->find_routing_files($manager->all_enabled(false));
		$router->find(dirname(__FILE__) . '/');

		$request = new phpbb_mock_request();
		$request->overwrite('SCRIPT_NAME', '/app.php', \phpbb\request\request_interface::SERVER);
		$request->overwrite('SCRIPT_FILENAME', 'app.php', \phpbb\request\request_interface::SERVER);
		$request->overwrite('REQUEST_URI', '/app.php', \phpbb\request\request_interface::SERVER);

		$symfony_request = new \phpbb\symfony_request(
			$request
		);

		$this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $router, $symfony_request, $request, $filesystem, '', 'php', dirname(__FILE__) . '/');
		$this->pagination = new \phpbb\pagination($this->template, $this->user, $this->helper, $phpbb_dispatcher);
	}