EncodingShellTest.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. App::uses('EncodingShell', 'Tools.Console/Command');
  3. App::uses('MyCakeTestCase', 'Tools.TestSuite');
  4. App::uses('TestConsoleOutput', 'Tools.TestSuite');
  5. class EncodingShellTest extends MyCakeTestCase {
  6. public $EncodingShell;
  7. public function setUp() {
  8. parent::setUp();
  9. $output = new TestConsoleOutput();
  10. $error = $this->getMock('ConsoleOutput', array(), array(), '', false);
  11. $input = $this->getMock('ConsoleInput', array(), array(), '', false);
  12. $this->EncodingShell = new TestEncodingShell($output, $error, $input);
  13. $this->EncodingShell->initialize();
  14. $this->EncodingShell->startup();
  15. }
  16. public function testObject() {
  17. $this->assertTrue(is_object($this->EncodingShell));
  18. $this->assertInstanceOf('EncodingShell', $this->EncodingShell);
  19. }
  20. public function testFolder() {
  21. $this->EncodingShell->params['ext'] = '';
  22. $this->EncodingShell->params['verbose'] = false;
  23. $this->EncodingShell->args[] = dirname(__FILE__);
  24. $this->EncodingShell->folder();
  25. }
  26. }
  27. class TestEncodingShell extends EncodingShell {
  28. public function found() {
  29. return $this->_found;
  30. }
  31. }