ServerShellTest.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  4. * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  5. *
  6. * Licensed under The MIT License
  7. * For full copyright and license information, please see the LICENSE.txt
  8. * Redistributions of files must retain the above copyright notice.
  9. *
  10. * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  11. * @link https://cakephp.org CakePHP(tm) Project
  12. * @since 3.1.9
  13. * @license https://opensource.org/licenses/mit-license.php MIT License
  14. */
  15. namespace Cake\Test\TestCase\Shell;
  16. use Cake\Shell\ServerShell;
  17. use Cake\TestSuite\TestCase;
  18. /**
  19. * ServerShell test.
  20. */
  21. class ServerShellTest extends TestCase
  22. {
  23. /**
  24. * setup method
  25. *
  26. * @return void
  27. */
  28. public function setUp()
  29. {
  30. parent::setUp();
  31. $this->io = $this->getMockBuilder('Cake\Console\ConsoleIo')->getMock();
  32. $this->shell = new ServerShell($this->io);
  33. }
  34. /**
  35. * Test that the option parser is shaped right.
  36. *
  37. * @return void
  38. */
  39. public function testGetOptionParser()
  40. {
  41. $parser = $this->shell->getOptionParser();
  42. $options = $parser->options();
  43. $this->assertArrayHasKey('host', $options);
  44. $this->assertArrayHasKey('port', $options);
  45. $this->assertArrayHasKey('ini_path', $options);
  46. $this->assertArrayHasKey('document_root', $options);
  47. }
  48. }