From 9d54867485300eefe7fcd8e8c2080eb655e713ed Mon Sep 17 00:00:00 2001 From: Mate Bartus Date: Wed, 8 Jul 2015 01:00:28 +0200 Subject: [ticket/13740] Test navigation provider PHPBB3-13740 --- tests/installer/navigation_provider_test.php | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/installer/navigation_provider_test.php (limited to 'tests/installer') diff --git a/tests/installer/navigation_provider_test.php b/tests/installer/navigation_provider_test.php new file mode 100644 index 0000000000..5bfce0eba8 --- /dev/null +++ b/tests/installer/navigation_provider_test.php @@ -0,0 +1,34 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +class phpbb_installer_navigation_provider_test extends phpbb_test_case +{ + public function test_navigation() + { + // Mock nav interface + $nav_mock = $this->getMockBuilder('\phpbb\install\helper\navigation\navigation_interface') + ->method('get') + ->willReturn(array('foo' => 'bar')) + ->getMock(); + + // Set up dependencies + $container = new phpbb_mock_container_builder(); + $container->set('foo', $nav_mock); + $nav_collection = new \phpbb\di\service_collection($container); + $nav_collection->add('foo'); + + // Let's test + $nav_provider = new \phpbb\install\helper\navigation\navigation_provider($nav_collection); + $this->assertEquals(array('foo' => 'bar'), $nav_provider->get()); + } +} -- cgit v1.2.1