anorgan / QuTee

PHP Background Jobs (Tasks) Manager
GNU Lesser General Public License v2.1
72 stars 12 forks source link

Fixes tests and update vendor libraries #17

Closed marcelaraujo closed 9 years ago

anorgan commented 9 years ago

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.

anorgan commented 9 years ago

What is wrong with expectedException?

marcelaraujo commented 9 years ago

@anorgan If you give a wrong parameter type, you got PHP parser error instead of an exception.

marcelaraujo commented 9 years ago

screen shot 2015-03-25 at 17 04 03

So, if you got a parser error, you can't expect an exception.

anorgan commented 9 years ago

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.

marcelaraujo commented 9 years ago

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

screen shot 2015-03-25 at 17 21 05

And I got these errors

screen shot 2015-03-25 at 17 22 16

marcelaraujo commented 9 years ago

Another thing!!!

The tests are only broken on PHP 5.3

marcelaraujo commented 9 years ago

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

marcelaraujo commented 9 years ago

hahahahahah @anorgan I know what's happening

http://3v4l.org/VSge6

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

¬¬

marcelaraujo commented 9 years ago

Now, it's ok :+1:

marcelaraujo commented 9 years ago

Ping???

marcelaraujo commented 9 years ago

Thanks sir!!!

anorgan commented 9 years ago

Ok, I did accept your pull request, but had to modify things a bit. Thanks!