예제 #1
0
파일: modx_test.php 프로젝트: phpbb/mpv
 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();
 }
예제 #2
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');
 }
예제 #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');
 }
예제 #4
0
 protected function setUp()
 {
     parent::setUp();
     global $config, $user, $request;
     $user = new phpbb_mock_user();
     $request = new phpbb_mock_request();
 }
    public function setUp()
    {
        parent::setUp();
        if (!self::$install_success) {
            $this->fail('Installing phpBB has failed.');
        }
        $this->bootstrap();
        self::$cookieJar = new CookieJar();
        self::$client = new Goutte\Client(array(), null, self::$cookieJar);
        // Clear the language array so that things
        // that were added in other tests are gone
        $this->lang = array();
        $this->add_lang('common');
        $db = $this->get_db();
        foreach (static::setup_extensions() as $extension) {
            $this->purge_cache();
            $sql = 'SELECT ext_active
				FROM ' . EXT_TABLE . "\n\t\t\t\tWHERE ext_name = '" . $db->sql_escape($extension) . "'";
            $result = $db->sql_query($sql);
            $status = (bool) $db->sql_fetchfield('ext_active');
            $db->sql_freeresult($result);
            if (!$status) {
                $this->install_ext($extension);
            }
        }
    }
예제 #6
0
 protected function setUp()
 {
     parent::setUp();
     global $user;
     $user = new phpbb_mock_user();
     $user->lang = new phpbb_mock_lang();
 }
예제 #7
0
    public function setUp()
    {
        parent::setUp();
        $this->bootstrap();
        self::$cookieJar = new CookieJar();
        self::$client = new Goutte\Client(array(), null, self::$cookieJar);
        // Reset the curl handle because it is 0 at this point and not a valid
        // resource
        self::$client->getClient()->getCurlMulti()->reset(true);
        // Clear the language array so that things
        // that were added in other tests are gone
        $this->lang = array();
        $this->add_lang('common');
        $db = $this->get_db();
        foreach (static::setup_extensions() as $extension) {
            $this->purge_cache();
            $sql = 'SELECT ext_active
				FROM ' . EXT_TABLE . "\n\t\t\t\tWHERE ext_name = '" . $db->sql_escape($extension) . "'";
            $result = $db->sql_query($sql);
            $status = (bool) $db->sql_fetchfield('ext_active');
            $db->sql_freeresult($result);
            if (!$status) {
                $this->install_ext($extension);
            }
        }
    }
예제 #8
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_';
 }
 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);
 }
예제 #10
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'));
 }
예제 #11
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();
 }
예제 #12
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();
 }
예제 #14
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();
 }
예제 #15
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);
 }
예제 #16
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';
 }
예제 #17
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');
 }
예제 #18
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();
 }
예제 #20
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);
 }
예제 #21
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');
 }
예제 #22
0
 public function setUp()
 {
     parent::setUp();
     $this->bootstrap();
     self::$cookieJar = new CookieJar();
     self::$client = new Goutte\Client(array(), null, self::$cookieJar);
     // Reset the curl handle because it is 0 at this point and not a valid
     // resource
     self::$client->getClient()->getCurlMulti()->reset(true);
     // Clear the language array so that things
     // that were added in other tests are gone
     $this->lang = array();
     $this->add_lang('common');
     $this->purge_cache();
 }
예제 #23
0
 public function setUp()
 {
     parent::setUp();
     $this->filesystem = new \phpbb\filesystem\filesystem();
 }
예제 #24
0
 protected function setUp()
 {
     parent::setUp();
     $this->helper = new phpbb_functions_validate_data_helper($this);
 }
예제 #25
0
 public function setUp()
 {
     parent::setUp();
     global $phpbb_filesystem;
     $phpbb_filesystem = new \phpbb\filesystem\filesystem();
 }
예제 #26
0
 public function setUp()
 {
     parent::setUp();
     global $phpbb_root_path;
     $this->exporter = new \phpbb\event\php_exporter($phpbb_root_path);
 }
예제 #27
0
 public function setUp()
 {
     parent::setUp();
     $this->viewonline_helper = new \phpbb\viewonline_helper(new \phpbb\filesystem());
 }
예제 #28
0
파일: globals_test.php 프로젝트: phpbb/mpv
 protected function setUp()
 {
     parent::setUp();
     $this->test = new mpv_tests_code(new mpv());
 }
 /**
  * Set up test environment
  */
 public function setUp()
 {
     parent::setUp();
     $this->auth = $this->getMock('\\phpbb\\auth\\auth');
     $this->user = $this->getMockBuilder('\\phpbb\\user')->disableOriginalConstructor()->getMock();
 }
예제 #30
0
 public function setUp()
 {
     parent::setUp();
     $this->helper = new \phpbb\db\migration\helper();
 }