"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "public_html/lists/base/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Command/HelpCommandTest.php" between
phplist-3.4.5.tgz and phplist-3.4.6.tgz

About: phpList is a one-way email announcement delivery system for newsletters, publicity lists, notifications, and many other uses (requires PHP and MySQL).

HelpCommandTest.php  (phplist-3.4.5.tgz):HelpCommandTest.php  (phplist-3.4.6.tgz)
skipping to change at line 28 skipping to change at line 28
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
class HelpCommandTest extends TestCase class HelpCommandTest extends TestCase
{ {
public function testExecuteForCommandAlias() public function testExecuteForCommandAlias()
{ {
$command = new HelpCommand(); $command = new HelpCommand();
$command->setApplication(new Application()); $command->setApplication(new Application());
$commandTester = new CommandTester($command); $commandTester = new CommandTester($command);
$commandTester->execute(['command_name' => 'li'], ['decorated' => false] ); $commandTester->execute(['command_name' => 'li'], ['decorated' => false] );
$this->assertContains('list [options] [--] [<namespace>]', $commandTeste $this->assertStringContainsString('list [options] [--] [<namespace>]', $
r->getDisplay(), '->execute() returns a text help for the given command alias'); commandTester->getDisplay(), '->execute() returns a text help for the given comm
$this->assertContains('format=FORMAT', $commandTester->getDisplay(), '-> and alias');
execute() returns a text help for the given command alias'); $this->assertStringContainsString('format=FORMAT', $commandTester->getDi
$this->assertContains('raw', $commandTester->getDisplay(), '->execute() splay(), '->execute() returns a text help for the given command alias');
returns a text help for the given command alias'); $this->assertStringContainsString('raw', $commandTester->getDisplay(), '
->execute() returns a text help for the given command alias');
} }
public function testExecuteForCommand() public function testExecuteForCommand()
{ {
$command = new HelpCommand(); $command = new HelpCommand();
$commandTester = new CommandTester($command); $commandTester = new CommandTester($command);
$command->setCommand(new ListCommand()); $command->setCommand(new ListCommand());
$commandTester->execute([], ['decorated' => false]); $commandTester->execute([], ['decorated' => false]);
$this->assertContains('list [options] [--] [<namespace>]', $commandTeste $this->assertStringContainsString('list [options] [--] [<namespace>]', $
r->getDisplay(), '->execute() returns a text help for the given command'); commandTester->getDisplay(), '->execute() returns a text help for the given comm
$this->assertContains('format=FORMAT', $commandTester->getDisplay(), '-> and');
execute() returns a text help for the given command'); $this->assertStringContainsString('format=FORMAT', $commandTester->getDi
$this->assertContains('raw', $commandTester->getDisplay(), '->execute() splay(), '->execute() returns a text help for the given command');
returns a text help for the given command'); $this->assertStringContainsString('raw', $commandTester->getDisplay(), '
->execute() returns a text help for the given command');
} }
public function testExecuteForCommandWithXmlOption() public function testExecuteForCommandWithXmlOption()
{ {
$command = new HelpCommand(); $command = new HelpCommand();
$commandTester = new CommandTester($command); $commandTester = new CommandTester($command);
$command->setCommand(new ListCommand()); $command->setCommand(new ListCommand());
$commandTester->execute(['--format' => 'xml']); $commandTester->execute(['--format' => 'xml']);
$this->assertContains('<command', $commandTester->getDisplay(), '->execu te() returns an XML help text if --xml is passed'); $this->assertStringContainsString('<command', $commandTester->getDisplay (), '->execute() returns an XML help text if --xml is passed');
} }
public function testExecuteForApplicationCommand() public function testExecuteForApplicationCommand()
{ {
$application = new Application(); $application = new Application();
$commandTester = new CommandTester($application->get('help')); $commandTester = new CommandTester($application->get('help'));
$commandTester->execute(['command_name' => 'list']); $commandTester->execute(['command_name' => 'list']);
$this->assertContains('list [options] [--] [<namespace>]', $commandTeste $this->assertStringContainsString('list [options] [--] [<namespace>]', $
r->getDisplay(), '->execute() returns a text help for the given command'); commandTester->getDisplay(), '->execute() returns a text help for the given comm
$this->assertContains('format=FORMAT', $commandTester->getDisplay(), '-> and');
execute() returns a text help for the given command'); $this->assertStringContainsString('format=FORMAT', $commandTester->getDi
$this->assertContains('raw', $commandTester->getDisplay(), '->execute() splay(), '->execute() returns a text help for the given command');
returns a text help for the given command'); $this->assertStringContainsString('raw', $commandTester->getDisplay(), '
->execute() returns a text help for the given command');
} }
public function testExecuteForApplicationCommandWithXmlOption() public function testExecuteForApplicationCommandWithXmlOption()
{ {
$application = new Application(); $application = new Application();
$commandTester = new CommandTester($application->get('help')); $commandTester = new CommandTester($application->get('help'));
$commandTester->execute(['command_name' => 'list', '--format' => 'xml']) ; $commandTester->execute(['command_name' => 'list', '--format' => 'xml']) ;
$this->assertContains('list [--raw] [--format FORMAT] [--] [&lt;namespac $this->assertStringContainsString('list [--raw] [--format FORMAT] [--] [
e&gt;]', $commandTester->getDisplay(), '->execute() returns a text help for the &lt;namespace&gt;]', $commandTester->getDisplay(), '->execute() returns a text h
given command'); elp for the given command');
$this->assertContains('<command', $commandTester->getDisplay(), '->execu $this->assertStringContainsString('<command', $commandTester->getDisplay
te() returns an XML help text if --format=xml is passed'); (), '->execute() returns an XML help text if --format=xml is passed');
} }
} }
 End of changes. 5 change blocks. 
24 lines changed or deleted 27 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)