Re: [Semanticscuttle-devel] Status for configurable privacy ....
Brought to you by:
cweiske
|
From: Christian W. <cw...@cw...> - 2011-04-14 17:46:34
|
Hello Brett, > I'm having trouble with a few items in PostsAddTest.php. I tried to > run this test in PHPUnit and kept getting 404 responses from the Web > server. Then I noticed line 36: > > protected $urlPart = 'api/posts/add'; > > I thought maybe this should be 'api/posts_add' and changed it. That > eliminated the 404s, and so I thought it might be a mistake I'll check that - we have URL rewriting rules that may affect that. >, but I was > also unable to get the tests to run without explicitly specifying > $urlSuffix because it was not getting set in TestBaseApi.php. You need to set $urlPart in each test class to the URL file you're about to test. Then $urlSuffix is only necessary for i.e. URL parameters like "?id=foo" or such. > I assume that I'm missing a bunch of setup tasks because these tests > should not be able to pass as I first attempted to run them in > PHPUnit. Or maybe I should be running the tests all at once? No, every test should be runnable standalone and may never depend on data set/generated by previous tests. This has several reasons: - Tests just may be run alone by i.e. > phpunit --filter $nameoftestmethod . - You could activate process isolation in phpunit which means every test is run in an different php instance. -- Regards/Mit freundlichen Grüßen Christian Weiske -=≡ Geeking around in the name of science since 1982 ≡=- |