You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1002 B

  1. <?php
  2. /*
  3. * @copyright NetMonsters <team@netmonsters.ru>
  4. * @link http://netmonsters.ru
  5. * @package Majestic
  6. * @subpackage UnitTests
  7. * @since 2011-10-28
  8. *
  9. * Unit tests for CommandProfiler class
  10. */
  11. require_once dirname(__FILE__) . '/../../../util/profiler/CommandProfiler.php';
  12. class CommandProfilerTest extends PHPUnit_Framework_TestCase
  13. {
  14. private $profiler;
  15. public function setUp()
  16. {
  17. $this->profiler = new CommandProfiler('method', 'exec');
  18. $this->profiler->end();
  19. }
  20. public function testGetEllapsed()
  21. {
  22. $this->assertGreaterThan(0, $this->profiler->getElapsed());
  23. }
  24. public function testGetType()
  25. {
  26. $this->assertSame('method', $this->profiler->getType());
  27. $this->assertNotEquals('argument', $this->profiler->getType());
  28. }
  29. public function testGetCommand()
  30. {
  31. $this->assertSame('exec', $this->profiler->getCommand());
  32. $this->assertNotEquals('grep', $this->profiler->getCommand());
  33. }
  34. }