Skip to content

Commit

Permalink
fix for the addition via configuration of the matchers
Browse files Browse the repository at this point in the history
  • Loading branch information
Markcial committed Feb 27, 2015
1 parent 3b99222 commit b0f90b1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/Psy/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class Configuration
'defaultIncludes', 'useReadline', 'usePcntl', 'codeCleaner', 'pager',
'loop', 'configDir', 'dataDir', 'runtimeDir', 'manualDbFile',
'requireSemicolons', 'historySize', 'eraseDuplicates', 'tabCompletion',
'tabCompletionMatchers',
);

private $defaultIncludes;
Expand Down
14 changes: 14 additions & 0 deletions test/Psy/Test/ShellTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit b0f90b1

Please sign in to comment.