Closed marcelaraujo closed 9 years ago
What is wrong with expectedException?
@anorgan If you give a wrong parameter type, you got PHP parser error instead of an exception.
So, if you got a parser error, you can't expect an exception.
You managed to baffle me :). How does my original code pass the test ( https://travis-ci.org/anorgan/QuTee/jobs/25477277) whereas your fixed does not (https://travis-ci.org/anorgan/QuTee/jobs/55643500)?
On Wed, 25 Mar 2015 9:03 PM Marcel Araujo notifications@github.com wrote:
@anorgan https://github.com/anorgan If you give a wrong parameter type, you got PHP parser error instead of an exception.
— Reply to this email directly or view it on GitHub https://github.com/anorgan/QuTee/pull/17#issuecomment-86197257.
Sorry dude!
I'm running on my Mac
PHP 5.5.14 (cli) (built: Sep 9 2014 19:09:25) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
And your current commit
And I got these errors
Another thing!!!
The tests are only broken on PHP 5.3
Try on your local machine
php -r 'class A { public function test(Closure $a) {}} $a = new A(); print_r($a->test(new stdClass())); ';
You should got
PHP Catchable fatal error: Argument 1 passed to A::test() must be an instance of Closure, instance of stdClass given, called in Command line code on line 1 and defined in Command line code on line 1
hahahahahah @anorgan I know what's happening
The parser error message has been changed since PHP 5.4.
PHP 5.3 -> must be an array, string given, called in PHP 5.4 -> must be of the type array, string given, called in
¬¬
Now, it's ok :+1:
Ping???
Thanks sir!!!
Ok, I did accept your pull request, but had to modify things a bit. Thanks!
Thanks for the PR. Phpunit would have to be under require-dev section, it is not needed in production. Also, I would be more than happy to list you as a contributor, but it seems to early to put you as author.