On 16 May 2015 at 17:00, Ryan Pallas <derokor...@gmail.com> wrote:
> Why do you want to test parse exceptions? Lint your code before you run it
> and you won't have any. ... maybe I'm missing something
> obvious,


Yeah, there's been a misunderstanding. I'm not talking about wanting
to test whether my code generates parse exceptions, I'm talking about
testing whether the code that catches parse exceptions behaves
correctly.

e.g. Wordpress should be catching ParseExceptions (and other
EngineExceptions) generated by plugins and reporting those plugins as
being problematic.

The code that handles those exceptions needs to tested that it behaves
correctly, which requires the appropriate exception being generated
when the test is run. Although people could use a nasty hack such as
`eval("<?php echo bar(};");`, that seems moderately horrific.

cheers
Dan

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to