Monday, March 09, 2009

Welcome the PDTT - PHP 5.3 Code Assist Engine Tests

pdtt is a clone of the popular phpt. Eclipse PDT uses this mechanism for testing its PHP 5.3 code assist engine. 

Since Michael has just finished implementing the second phase for PHP 5.3 support in PDT, we can now expose unit tests and ask users to add more cases to the code assist tests reposiroty.

As written in the pdtt wiki page
"The first thing you need to know about tests is that we need more!!! Although Eclipse PDT code assist works just great 99.99% of the time, not having a very comprehensive test suite means that we take more risks every time we add to or modify the Eclipse PDT Code Assist Engine implementation. The second thing you need to know is that if you can write PHP you can write tests. Thirdly - we are a friendly and welcoming community, don't be scared about writing to (pdt-dev@eclipse.org) - we won't bite!"

Basic Format for a pdtt file:
--TEST-- 
Tests a simple class name completion in namespace 
--FILE-- 
<? namespace My; class A{} class b{} $a = new My\| ?> 
--EXPECT-- 
type(A) 
type(B)

I guess that once we get some feedback from our members we will expose a better (automatic) way to submit pdtt files.

Enjoy ;)