Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
10 / 10
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
phpbb_installer_navigation_provider_test
100.00% covered (success)
100.00%
10 / 10
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 test_navigation
100.00% covered (success)
100.00%
10 / 10
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3 *
4 * This file is part of the phpBB Forum Software package.
5 *
6 * @copyright (c) phpBB Limited <https://www.phpbb.com>
7 * @license GNU General Public License, version 2 (GPL-2.0)
8 *
9 * For full copyright and license information, please see
10 * the docs/CREDITS.txt file.
11 *
12 */
13
14class phpbb_installer_navigation_provider_test extends phpbb_test_case
15{
16    public function test_navigation()
17    {
18        // Mock nav interface
19        $nav_stub = $this->getMockBuilder('\phpbb\install\helper\navigation\navigation_interface')
20            ->getMock();
21        $nav_stub->method('get')
22            ->willReturn(array('foo' => 'bar'));
23
24        // Set up dependencies
25        $container = new phpbb_mock_container_builder();
26        $container->set('foo', $nav_stub);
27        $nav_collection = new \phpbb\di\service_collection($container);
28        $nav_collection->add('foo');
29
30        // Let's test
31        $nav_provider = new \phpbb\install\helper\navigation\navigation_provider($nav_collection);
32        $this->assertEquals(array('foo' => 'bar'), $nav_provider->get());
33    }
34}