PHP Classes

PHP Autotest: Run automated test again when project files change

Recommend this page to a friend!
  Info   View files View files (18)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-09 (4 months ago) RSS 2.0 feedNot enough user ratingsTotal: 239 This week: 2All time: 8,044 This week: 31Up
Version License PHP version Categories
php-autotest 1.0.12BSD License5.3PHP 5, Testing
Description 

Author

This class can run automated test again when project files change.

It can monitor directories of source files involved in the defined tests to detect any changes.

The class can run PHPUnit to execute all tests again if there are source files that were changed since last time.

Innovation Award
PHP Programming Innovation award nominee
April 2014
Number 3


Prize: One subscription to the PDF edition of the PHP Architect magazine
PHPUnit is a popular tool frequently used by PHP developers for testing PHP projects.

You do not need to run tests of a project every time if the project files did not change.

This class can automate the execution of tests using PHPUnit only after your project files changed.

It is able to figure which files are used in the tests and checks if they changed to determine if the tests should be run again.

Manuel Lemos
Picture of Dmitry M. Merkushin
  Performance   Level  
Name: Dmitry M. Merkushin is available for providing paid consulting. Contact Dmitry M. Merkushin .
Classes: 2 packages by
Country: Russian Federation Russian Federation
Age: 39
All time rank: 261875 in Russian Federation Russian Federation
Week rank: 36 Up3 in Russian Federation Russian Federation Up
Innovation award
Innovation award
Nominee: 1x

Details

Build Status Autotest for PHP

Requirements

  • PHP 5.3+
  • PHPUnit
  • Symfony/Console

Installation

Download and unpack php.autotest.

Download Composer (http://getcomposer.org) and run:

composer.phar install

Composer installs Console component

Optionally link bin/autotest.php to your /usr/bin like this:

ln bin/autotest.php /usr/bin/autotest

Usage

Run bin/autotest.php with optional params from the root of your application:

  • 
    
  • 
    
  • 
    

Example (assuming file is linked to bin directory):

autotest --cmd=/usr/local/zend/bin/phpunit --src_path=source --tests_path=MyTests --timeout=60

  Files folder image Files  
File Role Description
Files folder imagebin (1 file)
Files folder imagesrc (1 directory)
Files folder imagetests (1 directory)
Files folder imagetests_fixtures (2 files)
Accessible without login Plain text file composer.json Data use Symfony/Console
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  bin  
File Role Description
  Accessible without login Plain text file autotest.php Appl. Application script

  Files folder image Files  /  src  
File Role Description
Files folder imageAutotest (5 files, 1 directory)

  Files folder image Files  /  src  /  Autotest  
File Role Description
Files folder imageConsole (2 files)
  Plain text file Autotest.php Class Class source
  Plain text file Config.php Class Class source
  Plain text file Extractor.php Class Class source
  Plain text file Runner.php Class Class source
  Plain text file Watcher.php Class Class source

  Files folder image Files  /  src  /  Autotest  /  Console  
File Role Description
  Plain text file Application.php Class Class source
  Plain text file Command.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imageAutotestTest (5 files)

  Files folder image Files  /  tests  /  AutotestTest  
File Role Description
  Plain text file AutotestTest.php Class Class source
  Plain text file ConfigTest.php Class Class source
  Plain text file ExtractorTest.php Class Class source
  Plain text file RunnerTest.php Class Class source
  Plain text file WatcherTest.php Class Class source

  Files folder image Files  /  tests_fixtures  
File Role Description
  Accessible without login Plain text file Example1Test.php Test Unit test script
  Accessible without login Plain text file Example2Test.php Test Unit test script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:239
This week:2
All time:8,044
This week:31Up