개발자 | Fabien Potencier |
---|---|
발표일 | 2007년 1월 29일(18년 전)(2007-01-29) |
안정화 버전 | |
미리보기 버전 | 2.0.0alpha1 / 2009년 11월 9일(15년 전)(2009-11-09) |
저장소 | |
프로그래밍 언어 | PHP |
운영 체제 | 크로스 플랫폼 |
종류 | 테스트 도구 |
라이선스 | MIT 허가서 |
웹사이트 | www |
라임(lime)은펄 라이브러리 기반의심포니웹 프레임워크를 위해 빌드된유닛 테스트 및기능 테스트프레임워크이다.[2] 이 프레임워크는 컬러 포맷팅을 포함하여 테스트로부터 읽기 가능한 출력물을 가져오기 위해 설계되었으며, 또테스트 애니띵 프로토콜을 따르기 때문에 다른 도구들과 쉬운 연동이 가능하다.[2] 라임 테스트들은샌드박스 환경에서 구동되므로 테스트 실행 중에 서로에게 미치는 영향을 최소화한다.[2] 라임 테스팅 프레임워크가심포니 안에서 테스트하기 위해 빌드되어 있지만 라임은 하나의PHP 파일 내에 포함되므로심포니나 기타 어떠한 라이브러리와도 의존성이 없다.[1][2]
알파 버전의 라임 2.0은 2009년 9월 10일에 발표되었으며[3]심포니 1.2 이하와 호환된다.[4]심포니 2.0은 테스트를 위해 라임 대신에PHPUnit을 사용한다.[5]
라임유닛 테스트들은lime_test
오브젝트를 사용하여표명(어서션)을 만들 수 있다. 다음은PHP 내장in_array
함수를 테스트하기 위한 라임유닛 테스트 기본 예제이다.
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.');
라임 알파 버전 2.0이 2009년 11월 10일 심포니 블로그에서 발표되었다.[6] 라임의 두 번째 버전은 가능하면 최초 버전과하위 호환되도록 개발되었으며 라임 1.0과 호환되지 않는 라임 2.0의 두 부분은테스트 하네스 구성과LimeCoverage
클래스이다.[3] 라임 2.0은XUnit 출력 지원, 소스 코드 애너테이션, 테스트 병렬 실행, 자동목/스텁 오브젝트 생성, 테스트 내 데이터를 위한연산자 오버로딩이 포함된다.[3] 라임의 최초 버전과 달리 라임 2.0은심포니에 약간의 의존성이 있다.[5]