Re: [Semanticscuttle-devel] Status for configurable privacy ....
Brought to you by:
cweiske
From: Brett D. <bs...@fr...> - 2011-04-15 02:11:21
|
Hello, Christian. I've got the relevant tests running for PostsAddTest.php but had another question: The remaining tests make HTTP requests to files that aren't part of the api (viz., edit.php, importNetscape.php, import.php, and bookmarks.php). Should I create new test files for these under tests/Api? It seems like they should go somewhere else. Maybe not a big issue, but worth asking. Rgrds, Brett On Thu, 14 Apr 2011 19:46:22 +0200, Christian Weiske <cw...@cw...> wrote: > 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. |