sfTestAllTask.class.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /*
  3. * This file is part of the symfony package.
  4. * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. /**
  10. * Launches all tests.
  11. *
  12. * @package symfony
  13. * @subpackage task
  14. * @author Fabien Potencier <fabien.potencier@symfony-project.com>
  15. * @version SVN: $Id: sfTestAllTask.class.php 8148 2008-03-29 07:58:59Z fabien $
  16. */
  17. class sfTestAllTask extends sfBaseTask
  18. {
  19. /**
  20. * @see sfTask
  21. */
  22. protected function configure()
  23. {
  24. $this->aliases = array('test-all');
  25. $this->namespace = 'test';
  26. $this->name = 'all';
  27. $this->briefDescription = 'Launches all tests';
  28. $this->detailedDescription = <<<EOF
  29. The [test:all|INFO] task launches all unit and functional tests:
  30. [./symfony test:all|INFO]
  31. The task launches all tests found in [test/|COMMENT].
  32. If one or more test fail, you can try to fix the problem by launching
  33. them by hand or with the [test:unit|COMMENT] and [test:functional|COMMENT] task.
  34. EOF;
  35. }
  36. /**
  37. * @see sfTask
  38. */
  39. protected function execute($arguments = array(), $options = array())
  40. {
  41. require_once(sfConfig::get('sf_symfony_lib_dir').'/vendor/lime/lime.php');
  42. $h = new lime_harness(new lime_output_color());
  43. $h->base_dir = sfConfig::get('sf_test_dir');
  44. // register all tests
  45. $finder = sfFinder::type('file')->follow_link()->name('*Test.php');
  46. $h->register($finder->in($h->base_dir));
  47. $h->run();
  48. }
  49. }