Task_Lite_Test.php 908 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * PhpUnderControl_TaskLite_Test
  4. *
  5. * 针对 ../Lite.php Task_Lite 类的PHPUnit单元测试
  6. *
  7. * @author: dogstar 20150514
  8. */
  9. require_once dirname(__FILE__) . '/bootstrap.php';
  10. class PhpUnderControl_TaskLite_Test extends PHPUnit_Framework_TestCase
  11. {
  12. public $taskLite;
  13. protected function setUp()
  14. {
  15. parent::setUp();
  16. $this->taskLite = new PhalApi\Task\Lite(new PhalApi\Task\MQ\FileMQ());
  17. }
  18. protected function tearDown()
  19. {
  20. }
  21. /**
  22. * @group testAdd
  23. */
  24. public function testAdd()
  25. {
  26. $service = 'Demo.Update';
  27. $params = array (
  28. 'id' => 888
  29. );
  30. $rs = $this->taskLite->add($service, $params);
  31. $this->assertTrue($rs);
  32. }
  33. public function testAddWrong()
  34. {
  35. $service = 'Demo';
  36. $rs = $this->taskLite->add($service);
  37. $this->assertFalse($rs);
  38. }
  39. }