Lime (test Framework)
   HOME

TheInfoList



OR:

lime is a
unit test In computer programming, unit testing is a software testing method by which individual units of source code—sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures&m ...
ing and
functional testing Functional testing is a quality assurance (QA) processPrasad, Dr. K.V.K.K. (2008) ''ISTQB Certification Study Guide'', Wiley, , p. vi and a type of black-box testing that bases its test cases on the specifications of the software component unde ...
framework built specifically for the
Symfony Symfony is a free and open-source PHP web application framework and a set of reusable PHP component libraries. It was published as free software on October 18, 2005, and released under the MIT license. Goal Symfony aims to speed up the creat ...
web application framework A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build and ...
based on the Test::More
Perl Perl is a family of two High-level programming language, high-level, General-purpose programming language, general-purpose, Interpreter (computing), interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it ...
library.Potencier, Fabien; Zaninotto, François. ''The Definitive Guide to symfony'', Apress, January 26, 2007, pp. 317-344. The framework is designed to have readable output from tests, including color formatting, by following the
Test Anything Protocol The Test Anything Protocol (TAP) is a protocol to allow communication between unit tests and a test harness. It allows individual tests (TAP producers) to communicate test results to the testing harness in a language-independent specification, lan ...
which also allows for easy integration with other tools. lime tests are run in a sandbox environment to minimize test executions from influencing each other. Though the lime testing framework is built for testing within
Symfony Symfony is a free and open-source PHP web application framework and a set of reusable PHP component libraries. It was published as free software on October 18, 2005, and released under the MIT license. Goal Symfony aims to speed up the creat ...
, lime is contained within a single
PHP PHP is a General-purpose programming language, general-purpose scripting language geared toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementati ...
file and has no dependency on
Symfony Symfony is a free and open-source PHP web application framework and a set of reusable PHP component libraries. It was published as free software on October 18, 2005, and released under the MIT license. Goal Symfony aims to speed up the creat ...
or any other library. The alpha version of lime 2.0 was announced on November 10, 2009 and is compatible with
Symfony Symfony is a free and open-source PHP web application framework and a set of reusable PHP component libraries. It was published as free software on October 18, 2005, and released under the MIT license. Goal Symfony aims to speed up the creat ...
1.2 and lower.http://blog.naenius.com/2009/08/using-symfonys-lime-in-phpundercontrol/
Symfony Symfony is a free and open-source PHP web application framework and a set of reusable PHP component libraries. It was published as free software on October 18, 2005, and released under the MIT license. Goal Symfony aims to speed up the creat ...
2.0 uses PHPUnit for testing instead of lime.http://symfonyexperts.com/question/show/id/12


Example

lime
unit test In computer programming, unit testing is a software testing method by which individual units of source code—sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures&m ...
s use the lime_test object to make assertions. The following is a basic example lime
unit test In computer programming, unit testing is a software testing method by which individual units of source code—sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures&m ...
to test
PHP PHP is a General-purpose programming language, general-purpose scripting language geared toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementati ...
's built-in in_array function. include(dirname(__FILE__) . '/bootstrap/unit.php'); // Include lime. // Create the lime_test object for 10 number of assertions and color output. $t = new lime_test(10, new lime_output_color()); // The test array. $arr = array('Hello', 'World', 123,); // Output a comment. $t->diag('in_array()'); // Test to make sure in_array returns a boolean value for both values // that are in the array and not in the array. $t->isa_ok(in_array('hey', $arr), 'bool', '\'in_array\' did not return a boolean value.'); $t->isa_ok(in_array('Hello', $arr), 'bool', '\'in_array\' did not return a boolean value.'); $t->isa_ok(in_array(5, $arr), 'bool', '\'in_array\' did not return a boolean value.'); $t->isa_ok(in_array(FALSE, $arr), 'bool', '\'in_array\' did not return a boolean value.'); // Test to make sure in_array can find values that are in the array // and doesn't find values that are not in the array. $t->ok(!in_array('hey', $arr), '\'in_array\' found a value not in the array.'); $t->ok(!in_array(5, $arr), '\'in_array\' found a value not in the array.'); $t->ok(!in_array(FALSE, $arr), '\'in_array\' found a value not in the array.'); $t->ok(in_array('Hello', $arr), '\'in_array\' failed to find a value that was in the array.'); $t->ok(in_array('World', $arr), '\'in_array\' failed to find a value that was in the array.'); $t->ok(in_array(123, $arr), '\'in_array\' failed to find a value that was in the array.');


Version 2.0

The alpha version of lime 2.0 was announced on the Symfony blog on November 10, 2009. The second version of lime was built to be as
backward compatible Backward compatibility (sometimes known as backwards compatibility) is a property of an operating system, product, or technology that allows for interoperability with an older legacy system, or with input designed for such a system, especially ...
with the first version as was possible - the two parts of lime 2.0 that are not compatible with lime 1.0 are the configuration of the
test harness In software testing, a test harness or automated test framework is a collection of software and test data configured to test a program unit by running it under varying conditions and monitoring its behavior and outputs. It has two main parts: the t ...
and the LimeCoverage class. lime 2.0 includes support for
xUnit xUnit is the collective name for several unit testing frameworks that derive their structure and functionality from Smalltalk's SUnit. ''SUnit'', designed by Kent Beck in 1998, was written in a highly structured object-oriented style, which l ...
output, source code annotations, parallel execution of tests, automatic generation of mock and stub objects, and
operator overloading In computer programming, operator overloading, sometimes termed ''operator ad hoc polymorphism'', is a specific case of polymorphism, where different operators have different implementations depending on their arguments. Operator overloading i ...
for data within tests. Unlike the first version of lime, lime 2.0 does have some dependencies on
Symfony Symfony is a free and open-source PHP web application framework and a set of reusable PHP component libraries. It was published as free software on October 18, 2005, and released under the MIT license. Goal Symfony aims to speed up the creat ...
.


See also

* Symfony Framework *
List of unit testing frameworks This article is a list of tables of code-driven unit testing frameworks for various programming languages. Some, but not all, of these are based on xUnit. Columns (classification) * Name: This column contains the name of the framework and wi ...


References


External links


Symfony project homepage
{{PHP Unit testing frameworks PHP frameworks