aboutsummaryrefslogtreecommitdiffstats
path: root/tests/extension/finder_test.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2011-08-22 02:17:00 -0400
committerNils Adermann <naderman@naderman.de>2011-09-29 15:42:47 +0200
commitf6632fcfd08650f13560529a6a04c152aefd4e3c (patch)
tree92560ddafc08aaffec333149df60986b83e10744 /tests/extension/finder_test.php
parent60ad0e21b5d4f940740650df69b7134a573f2a97 (diff)
downloadforums-f6632fcfd08650f13560529a6a04c152aefd4e3c.tar
forums-f6632fcfd08650f13560529a6a04c152aefd4e3c.tar.gz
forums-f6632fcfd08650f13560529a6a04c152aefd4e3c.tar.bz2
forums-f6632fcfd08650f13560529a6a04c152aefd4e3c.tar.xz
forums-f6632fcfd08650f13560529a6a04c152aefd4e3c.zip
[feature/extension-manager] Add filename prefix matching in extension finder
PHPBB3-10323
Diffstat (limited to 'tests/extension/finder_test.php')
-rw-r--r--tests/extension/finder_test.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/extension/finder_test.php b/tests/extension/finder_test.php
index b0c98da554..4acfe53937 100644
--- a/tests/extension/finder_test.php
+++ b/tests/extension/finder_test.php
@@ -55,6 +55,24 @@ class phpbb_extension_finder_test extends phpbb_test_case
);
}
+ public function test_prefix_get_classes()
+ {
+ $classes = $this->finder
+ ->default_path('includes/default/')
+ ->prefix('hidden_')
+ ->default_prefix('')
+ ->get_classes();
+
+ sort($classes);
+ $this->assertEquals(
+ array(
+ 'phpbb_default_implementation',
+ 'phpbb_ext_bar_my_hidden_class',
+ ),
+ $classes
+ );
+ }
+
public function test_directory_get_classes()
{
$classes = $this->finder
@@ -109,8 +127,10 @@ class phpbb_extension_finder_test extends phpbb_test_case
$query = array(
'default_path' => 'includes/foo',
'default_suffix' => false,
+ 'default_prefix' => false,
'default_directory' => 'bar',
'suffix' => false,
+ 'prefix' => false,
'directory' => false,
);