SimpleTest

From Wikipedia, the free encyclopedia
Jump to: navigation, search
SimpleTest
Developer(s) Marcus Baker
Stable release 1.1.0 / January 23, 2012 (2012-01-23)
Written in PHP
Operating system Cross-platform
Available in English, French
Type Web browser
License GNU Lesser General Public License 2.1
Website http://www.simpletest.org

SimpleTest is an open source unit test framework for the PHP programming language and was created by Marcus Baker. The test structure is similar to JUnit/PHPUnit. SimpleTest supports mock objects and can be used to automate the regression testing of web applications with a scriptable HTTP Client that can parse HTML pages and simulate things like clicking on links and submitting forms.

Example[edit]

The following file HelloWorld.php, located in the framework folder, will test its own presence and the absence of another file successfully:

<?php
require_once('autorun.php');
class TestHelloWorld extends UnitTestCase {
	function TestFilesExistence() {
		$this->assertTrue(file_exists($_SERVER['SCRIPT_FILENAME']));
		$this->assertFalse(file_exists('HelloWikipedia.php'));
	}
}
?>

See also[edit]

External links[edit]

Articles[edit]