ServerShellTest.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  4. * Copyright (c) Cake Software Foundation, Inc. (http://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. (http://cakefoundation.org)
  11. * @link http://cakephp.org CakePHP(tm) Project
  12. * @since 3.1.9
  13. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  14. */
  15. namespace Cake\Test\TestCase\Shell;
  16. use Cake\Cache\Cache;
  17. use Cake\Datasource\ConnectionManager;
  18. use Cake\Shell\ServerShell;
  19. use Cake\TestSuite\TestCase;
  20. /**
  21. * ServerShell test.
  22. */
  23. class ServerShellTest extends TestCase
  24. {
  25. /**
  26. * setup method
  27. *
  28. * @return void
  29. */
  30. public function setUp()
  31. {
  32. parent::setUp();
  33. $this->io = $this->getMock('Cake\Console\ConsoleIo');
  34. $this->shell = new ServerShell($this->io);
  35. }
  36. /**
  37. * Test that the option parser is shaped right.
  38. *
  39. * @return void
  40. */
  41. public function testGetOptionParser()
  42. {
  43. $parser = $this->shell->getOptionParser();
  44. $options = $parser->options();
  45. $this->assertArrayHasKey('host', $options);
  46. $this->assertArrayHasKey('port', $options);
  47. $this->assertArrayHasKey('document_root', $options);
  48. }
  49. }