Maher4Ever / guard-phpunit

Guard::PHPUnit automatically runs your tests
http://maher4ever.github.com/guard-phpunit/
MIT License
73 stars 47 forks source link

Not growling correctly: always 0/0 tests #1

Closed MPV closed 12 years ago

MPV commented 12 years ago

Using the following Guardfile:

# A sample Guardfile
# More info at https://github.com/guard/guard#readme

notification :growl

guard 'phpunit', :tests_path => 'tests/unit', :cli => '--colors --bootstrap tests/lib/InitTests.php --stderr' do
  # Watch tests files
  watch(%r{^.+Test\.php$})

  # Watch library files and run their tests
  watch(%r{^/(.+)\.php}) { |m| "tests/unit/#{m[1]}Test.php" }
end

It always growls the following result (with a green tick icon):

PHPUnit results
0 tests, 0 failures
in 0 seconds

Even though the terminal output might look like this:

$ guard
WARNING: You are using Guard outside of Bundler, this is dangerous and could not work. Using `bundle exec guard` is safer.
Guard uses Growl to send notifications.
Guard is now watching at '/Users/myuser/path/to/folder'
Running all tests
PHPUnit 3.6.7 by Sebastian Bergmann.

............................F.......................

Time: 3 seconds, Memory: 28.00Mb

There was 1 failure:
...
Maher4Ever commented 12 years ago

guard-phpunit parses the output of the terminal and displays it with a notifier (Growl in your case). To do that I have made a special printer for the results of phpunit, but I can see it is not being passed correctly to phpunit from the output of your terminal.

I think this might have something to do with your --bootstrap file. Can you please post the contents of the tests/lib/InitTests.php file?

Maher4Ever commented 12 years ago

I think you might have fixed this problem on your end by now, so I will close this issue. If you didn't, I will be happy to help you with it,

MPV commented 12 years ago

Hi Maher, Just saw that you had replied. The solution was removing the --stderr (and not any of the contents of the --bootstrap file.

Thank you for your help you, I wouldn't have been able to find it without your help.

Also, the output is a lot prettier now with the phpunit-progress extension.

Maher4Ever commented 12 years ago

Glad I could help :)

villimagg commented 11 years ago

Not growling correctly also! (Or should I say libnotifying?) Always shows a green checkmark and 0 tests, 0 failures even if I do assertTrue(FALSE); in my test.