[ticket/11465] Add comments explaining the tests

PHPBB3-11465
This commit is contained in:
Marc Alexander 2013-05-10 11:53:26 +02:00
parent 7240759e34
commit 6a1fa3e0f4
3 changed files with 13 additions and 2 deletions

View file

@ -1,5 +1,8 @@
<?php <?php
/*
* Due to the mismatch between the class name and the file name, this module
* file shouldn't be found by the extension finder
*/
class phpbb_ext_foo_acp_foo_info class phpbb_ext_foo_acp_foo_info
{ {
public function module() public function module()

View file

@ -1,5 +1,8 @@
<?php <?php
/*
* Due to the mismatch between the class name and the file name of the module
* info file, this module's info file shouldn't be found
*/
class phpbb_ext_foo_acp_fail_module class phpbb_ext_foo_acp_fail_module
{ {
} }

View file

@ -47,6 +47,7 @@ class phpbb_extension_modules_test extends phpbb_test_case
// Correctly set the root path for this test to this directory, so the classes can be found // Correctly set the root path for this test to this directory, so the classes can be found
$phpbb_root_path = dirname(__FILE__) . '/'; $phpbb_root_path = dirname(__FILE__) . '/';
// Find acp module info files
$this->acp_modules->module_class = 'acp'; $this->acp_modules->module_class = 'acp';
$acp_modules = $this->acp_modules->get_module_infos(); $acp_modules = $this->acp_modules->get_module_infos();
$this->assertEquals(array( $this->assertEquals(array(
@ -68,6 +69,7 @@ class phpbb_extension_modules_test extends phpbb_test_case
), ),
), $acp_modules); ), $acp_modules);
// Find mcp module info files
$this->acp_modules->module_class = 'mcp'; $this->acp_modules->module_class = 'mcp';
$acp_modules = $this->acp_modules->get_module_infos(); $acp_modules = $this->acp_modules->get_module_infos();
$this->assertEquals(array( $this->assertEquals(array(
@ -81,6 +83,7 @@ class phpbb_extension_modules_test extends phpbb_test_case
), ),
), $acp_modules); ), $acp_modules);
// Find a specific module info file (mcp_a_module)
$this->acp_modules->module_class = 'mcp'; $this->acp_modules->module_class = 'mcp';
$acp_modules = $this->acp_modules->get_module_infos('mcp_a_module'); $acp_modules = $this->acp_modules->get_module_infos('mcp_a_module');
$this->assertEquals(array( $this->assertEquals(array(
@ -94,10 +97,12 @@ class phpbb_extension_modules_test extends phpbb_test_case
), ),
), $acp_modules); ), $acp_modules);
// The mcp module info file we're looking for shouldn't exist
$this->acp_modules->module_class = 'mcp'; $this->acp_modules->module_class = 'mcp';
$acp_modules = $this->acp_modules->get_module_infos('mcp_a_fail'); $acp_modules = $this->acp_modules->get_module_infos('mcp_a_fail');
$this->assertEquals(array(), $acp_modules); $this->assertEquals(array(), $acp_modules);
// As there are no ucp modules we shouldn't find any
$this->acp_modules->module_class = 'ucp'; $this->acp_modules->module_class = 'ucp';
$acp_modules = $this->acp_modules->get_module_infos(); $acp_modules = $this->acp_modules->get_module_infos();
$this->assertEquals(array(), $acp_modules); $this->assertEquals(array(), $acp_modules);