Lime (test framework)

Last updated
lime
Original author(s) Fabien Potencier
Developer(s) Bernhard Schussek
Initial releaseJanuary 29, 2007;17 years ago (2007-01-29)
Final release
1.0.9 [1] / May 19, 2010;13 years ago (2010-05-19)
Preview release
2.0.0alpha1 / November 9, 2009;14 years ago (2009-11-09)
Repository
Written in PHP
Operating system Cross-platform
Type Test tool
License MIT License
Website www.symfony-project.org

lime is a unit testing and functional testing framework built specifically for the Symfony web application framework based on the Test::More Perl library. [2] The framework is designed to have readable output from tests, including color formatting, by following the Test Anything Protocol which also allows for easy integration with other tools. [2] lime tests are run in a sandbox environment to minimize test executions from influencing each other. [2] Though the lime testing framework is built for testing within Symfony, lime is contained within a single PHP file and has no dependency on Symfony or any other library. [1] [2]

Contents

The alpha version of lime 2.0 was announced on November 10, 2009 [3] and is compatible with Symfony 1.2 and lower. [4] Symfony 2.0 uses PHPUnit for testing instead of lime. [5]

Example

lime unit tests use the lime_test object to make assertions. The following is a basic example lime unit test to test PHP'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=newlime_test(10,newlime_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. [6] The second version of lime was built to be as backward compatible 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 and the LimeCoverage class. [3] lime 2.0 includes support for xUnit output, source code annotations, parallel execution of tests, automatic generation of mock and stub objects, and operator overloading for data within tests. [3] Unlike the first version of lime, lime 2.0 does have some dependencies on Symfony. [5]

See also

Related Research Articles

In computer programming, the interpreter pattern is a design pattern that specifies how to evaluate sentences in a language. The basic idea is to have a class for each symbol in a specialized computer language. The syntax tree of a sentence in the language is an instance of the composite pattern and is used to evaluate (interpret) the sentence for a client. See also Composite pattern.

In computer science, primitive data types are a set of basic data types from which all other data types are constructed. Specifically it often refers to the limited set of data representations in use by a particular processor, which all compiled programs must use. Most processors support a similar set of primitive data types, although the specific representations vary. More generally, "primitive data types" may refer to the standard data types built into a programming language. Data types which are not primitive are referred to as derived or composite.

<span class="mw-page-title-main">Apache Groovy</span> Programming language

Apache Groovy is a Java-syntax-compatible object-oriented programming language for the Java platform. It is both a static and dynamic language with features similar to those of Python, Ruby, and Smalltalk. It can be used as both a programming language and a scripting language for the Java Platform, is compiled to Java virtual machine (JVM) bytecode, and interoperates seamlessly with other Java code and libraries. Groovy uses a curly-bracket syntax similar to Java's. Groovy supports closures, multiline strings, and expressions embedded in strings. Much of Groovy's power lies in its AST transformations, triggered through annotations.

<span class="mw-page-title-main">ActionScript</span> Object-oriented programming language created for the Flash multimedia platform

ActionScript is an object-oriented programming language originally developed by Macromedia Inc.. It is influenced by HyperTalk, the scripting language for HyperCard. It is now an implementation of ECMAScript, though it originally arose as a sibling, both being influenced by HyperTalk. ActionScript code is usually converted to byte-code format by a compiler.

<span class="mw-page-title-main">Java syntax</span> Set of rules defining correctly structured program

The syntax of Java is the set of rules defining how a Java program is written and interpreted.

In computer science, the Boolean is a data type that has one of two possible values which is intended to represent the two truth values of logic and Boolean algebra. It is named after George Boole, who first defined an algebraic system of logic in the mid 19th century. The Boolean data type is primarily associated with conditional statements, which allow different actions by changing control flow depending on whether a programmer-specified Boolean condition evaluates to true or false. It is a special case of a more general logical data type—logic does not always need to be Boolean.

A bit array is an array data structure that compactly stores bits. It can be used to implement a simple set data structure. A bit array is effective at exploiting bit-level parallelism in hardware to perform operations quickly. A typical bit array stores kw bits, where w is the number of bits in the unit of storage, such as a byte or word, and k is some nonnegative integer. If w does not divide the number of bits to be stored, some space is wasted due to internal fragmentation.

TestNG is a testing framework for the Java programming language created by Cedric_Beust and inspired by JUnit and NUnit. The design goal of TestNG is to cover a wider range of test categories: unit, functional, end-to-end, integration, etc., with more powerful and easy-to-use functionalities.

In software engineering, a plain old Java object (POJO) is an ordinary Java object, not bound by any special restriction. The term was coined by Martin Fowler, Rebecca Parsons and Josh MacKenzie in September 2000:

"We wondered why people were so against using regular objects in their systems and concluded that it was because simple objects lacked a fancy name. So we gave them one, and it's caught on very nicely."

IP Pascal is an implementation of the Pascal programming language using the IP portability platform, a multiple machine, operating system and language implementation system. It implements the language "Pascaline", and has passed the Pascal Validation Suite.

<span class="mw-page-title-main">Symfony</span> PHP web application framework for MVC applications

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.

<span class="mw-page-title-main">JavaScript syntax</span> Set of rules defining correctly structured programs

The syntax of JavaScript is the set of rules that define a correctly structured JavaScript program.

Generics are a facility of generic programming that were added to the Java programming language in 2004 within version J2SE 5.0. They were designed to extend Java's type system to allow "a type or method to operate on objects of various types while providing compile-time type safety". The aspect compile-time type safety was not fully achieved, since it was shown in 2016 that it is not guaranteed in all cases.

This Comparison of programming languages (associative arrays) compares the features of associative array data structures or array-lookup processing for over 40 computer programming languages.

The syntax and semantics of PHP, a programming language, form a set of rules that define how a PHP program can be written and interpreted.

XPath is an expression language designed to support the query or transformation of XML documents. It was defined by the World Wide Web Consortium (W3C) in 1999, and can be used to compute values from the content of an XML document. Support for XPath exists in applications that support XML, such as web browsers, and many programming languages.

<span class="mw-page-title-main">Jasmine (software)</span> Open-source testing framework for JavaScript

Jasmine is an open-source testing framework for JavaScript. It aims to run on any JavaScript-enabled platform, to not intrude on the application nor the IDE, and to have easy-to-read syntax. It is heavily influenced by other unit testing frameworks, such as ScrewUnit, JSSpec, JSpec, and RSpec.

QUnit is a JavaScript unit testing framework. Originally developed for testing jQuery, jQuery UI and jQuery Mobile, it is a generic framework for testing any JavaScript code. It supports client-side environments in web browsers, and server-side.

In software engineering, the module pattern is a design pattern used to implement the concept of software modules, defined by modular programming, in a programming language with incomplete direct support for the concept.

Hack is a programming language for the HipHop Virtual Machine (HHVM), created by Meta as a dialect of PHP. The language implementation is open-source, licensed under the MIT License.

References

  1. 1 2 "/tools/lime/tags/RELEASE_1_0_9 (log)". symfony - Trac. Archived from the original on 2016-07-30.
  2. 1 2 3 4 Potencier, Fabien; Zaninotto, François. The Definitive Guide to symfony, Apress, January 26, 2007, pp. 317-344. ISBN   1-59059-786-9
  3. 1 2 3 "Lime 2 alpha released (Symfony Blog)".
  4. "Using Symfony's Lime in phpUnderControl". Archived from the original on 2018-02-05.
  5. 1 2 "Can someone post a full working example of Lime 2 annotations?". Archived from the original on 2013-04-06.
  6. SensioLabs. "(Press Release) Lime 2 alpha released" . Retrieved 2017-11-23.