On Wed, 01 Jun 2011 11:47:31 +0100, Robert Goldsmith <rgoldsm...@names.co.uk> wrote:

Interesting question - anyone tried unit testing Tales? Any ideas how to do so?


What exactly do you want to test?

If you want to test your TALES expressions or modifiers, then you could use PHPTAL->setSource() to create small snippets of code and run them, check results:

$this->assertEquals("HELLO", PHPTAL::create()->setSource("${toUpperCase:string:hello}")->execute());

For its own purpose PHPTAL tests result returned by phptal_tales() directly, but that exposes more than 3rd party application would want to know about PHPTAL internals, so I don't recommend that.

--
regards, Kornel Lesiński

_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to