PluginLoadedCommandTest.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  5. * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  6. *
  7. * Licensed under The MIT License
  8. * For full copyright and license information, please see the LICENSE.txt
  9. * Redistributions of files must retain the above copyright notice.
  10. *
  11. * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  12. * @link https://cakephp.org CakePHP(tm) Project
  13. * @since 3.1.9
  14. * @license https://opensource.org/licenses/mit-license.php MIT License
  15. */
  16. namespace Cake\Test\TestCase\Command;
  17. use Cake\Console\Command;
  18. use Cake\Core\Plugin;
  19. use Cake\TestSuite\ConsoleIntegrationTestTrait;
  20. use Cake\TestSuite\TestCase;
  21. /**
  22. * PluginLoadedCommand test.
  23. */
  24. class PluginLoadedCommandTest extends TestCase
  25. {
  26. use ConsoleIntegrationTestTrait;
  27. /**
  28. * setUp method
  29. *
  30. * @return void
  31. */
  32. public function setUp(): void
  33. {
  34. parent::setUp();
  35. $this->useCommandRunner();
  36. $this->setAppNamespace();
  37. }
  38. /**
  39. * Tests that list of loaded plugins is shown with loaded command.
  40. *
  41. * @return void
  42. */
  43. public function testLoaded()
  44. {
  45. $expected = Plugin::loaded();
  46. $this->exec('plugin loaded');
  47. $this->assertExitCode(Command::CODE_SUCCESS);
  48. foreach ($expected as $value) {
  49. $this->assertOutputContains($value);
  50. }
  51. }
  52. }