diff options
Diffstat (limited to 'tests/extension/metadata_manager_test.php')
| -rw-r--r-- | tests/extension/metadata_manager_test.php | 42 | 
1 files changed, 29 insertions, 13 deletions
diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php index 2a746d3792..db573ae0c3 100644 --- a/tests/extension/metadata_manager_test.php +++ b/tests/extension/metadata_manager_test.php @@ -41,26 +41,42 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case  			'version'		=> '3.1.0',  		));  		$this->db = $this->new_dbal(); -		$this->db_tools = new \phpbb\db\tools($this->db); +		$factory = new \phpbb\db\tools\factory(); +		$this->db_tools = $factory->get($this->db);  		$this->phpbb_root_path = dirname(__FILE__) . '/';  		$this->phpEx = 'php';  		$this->user = new \phpbb\user('\phpbb\datetime');  		$this->table_prefix = 'phpbb_'; -		$this->template = new \phpbb\template\twig\twig( -			new \phpbb\path_helper( -				new \phpbb\symfony_request( -					new phpbb_mock_request() -				), -				new \phpbb\filesystem(), -				$this->getMock('\phpbb\request\request'), -				$this->phpbb_root_path, -				$this->phpEx +		$container = new phpbb_mock_container_builder(); +		$cache_path = $this->phpbb_root_path . 'cache/twig'; +		$context = new \phpbb\template\context(); +		$loader = new \phpbb\template\twig\loader(new \phpbb\filesystem\filesystem(), ''); +		$phpbb_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, +			$this->phpEx +		); +		$twig = new \phpbb\template\twig\environment(  			$this->config, -			$this->user, -			new \phpbb\template\context() +			$phpbb_path_helper, +			$container, +			$cache_path, +			null, +			$loader, +			array( +				'cache'			=> false, +				'debug'			=> false, +				'auto_reload'	=> true, +				'autoescape'	=> false, +			)  		); +		$this->template = new phpbb\template\twig\twig($phpbb_path_helper, $this->config, $this->user, $context, $twig, $cache_path, array(new \phpbb\template\twig\extension($context, $this->user))); +		$container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig));  		$container = new phpbb_mock_container_builder(); @@ -82,7 +98,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case  			$container,  			$this->db,  			$this->config, -			new \phpbb\filesystem(), +			new \phpbb\filesystem\filesystem(),  			$this->user,  			'phpbb_ext',  			$this->phpbb_root_path,  | 
