Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

PhpUnit vs sake test behaviour


Go to End


1163 Views

Avatar
alvonso

Community Member, 6 Posts

5 October 2012 at 12:38pm

Edited: 05/10/2012 12:41pm

Hi everybody,

I would like to run unit test via phpunit as described here:
http://doc.silverstripe.org/framework/en/howto/phpunit-configuration

Running Test with phpunit and sake seems to behave differently.
Some test pass in sake but don't in phpunit.

For example phpunit sapphire/tests/SiteTreeBacklinksTest.php
results in ...FFF and a
Fatal error: Call to a member function obj() on a non-object in .../sapphire/tests/SiteTreeBacklinksTest.php on line 227

sake dev/tests/SiteTreeBacklinksTest
results in .......
ALL TEST PASS

This behavior occures with multiple files. They pass in sake but fail in phpunit.

I'm running SS 2.4.5 and
PHPUnit 3.5.14

Any ideas how I could get the tests to pass with PHPUnit.

Thanks