From b0f90b176c0784f739a149caa9b44416c313579f Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Fri, 27 Feb 2015 11:38:04 +0100 Subject: [PATCH] fix for the addition via configuration of the matchers --- src/Psy/Configuration.php | 1 - test/Psy/Test/ShellTest.php | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Psy/Configuration.php b/src/Psy/Configuration.php index 3cb934d0b..c1a427f09 100644 --- a/src/Psy/Configuration.php +++ b/src/Psy/Configuration.php @@ -33,7 +33,6 @@ class Configuration 'defaultIncludes', 'useReadline', 'usePcntl', 'codeCleaner', 'pager', 'loop', 'configDir', 'dataDir', 'runtimeDir', 'manualDbFile', 'requireSemicolons', 'historySize', 'eraseDuplicates', 'tabCompletion', - 'tabCompletionMatchers', ); private $defaultIncludes; diff --git a/test/Psy/Test/ShellTest.php b/test/Psy/Test/ShellTest.php index 284ef0a6f..1ae80abb0 100644 --- a/test/Psy/Test/ShellTest.php +++ b/test/Psy/Test/ShellTest.php @@ -15,6 +15,7 @@ use Psy\Exception\ParseErrorException; use Psy\Shell; use Psy\Configuration; +use Psy\TabCompletion\Matcher\ClassMethodsMatcher; use Symfony\Component\Console\Output\StreamOutput; class ShellTest extends \PHPUnit_Framework_TestCase @@ -84,6 +85,19 @@ public function testIncludesConfig() $this->assertEquals('/file.php', $includes[0]); } + public function testAddMatchersViaConfig() + { + $config = $this->getConfig(array( + 'tabCompletionMatchers' => array( + new ClassMethodsMatcher(), + ) + )); + + $matchers = $config->getTabCompletionMatchers(); + + $this->assertTrue(array_pop($matchers) instanceof ClassMethodsMatcher); + } + public function testRenderingExceptions() { $shell = new Shell($this->getConfig());