TextDescriptorTest.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Console\Tests\Descriptor;
  11. use Symfony\Component\Console\Descriptor\TextDescriptor;
  12. use Symfony\Component\Console\Tests\Fixtures\DescriptorApplication2;
  13. use Symfony\Component\Console\Tests\Fixtures\DescriptorApplicationMbString;
  14. use Symfony\Component\Console\Tests\Fixtures\DescriptorCommandMbString;
  15. class TextDescriptorTest extends AbstractDescriptorTest
  16. {
  17. public function getDescribeCommandTestData()
  18. {
  19. return $this->getDescriptionTestData(array_merge(
  20. ObjectsProvider::getCommands(),
  21. array('command_mbstring' => new DescriptorCommandMbString())
  22. ));
  23. }
  24. public function getDescribeApplicationTestData()
  25. {
  26. return $this->getDescriptionTestData(array_merge(
  27. ObjectsProvider::getApplications(),
  28. array('application_mbstring' => new DescriptorApplicationMbString())
  29. ));
  30. }
  31. public function testDescribeApplicationWithFilteredNamespace()
  32. {
  33. $application = new DescriptorApplication2();
  34. $this->assertDescription(file_get_contents(__DIR__.'/../Fixtures/application_filtered_namespace.txt'), $application, array('namespace' => 'command4'));
  35. }
  36. protected function getDescriptor()
  37. {
  38. return new TextDescriptor();
  39. }
  40. protected function getFormat()
  41. {
  42. return 'txt';
  43. }
  44. }