Re: [Semanticscuttle-devel] Privatekey
Brought to you by:
cweiske
From: Christian W. <cw...@cw...> - 2011-05-07 07:34:48
|
Hello Mark, > > - 1) BookmarkTest::testPrivateBookmarks > > Undefined offset: 1 > > /home/cweiske/Dev/semanticscuttle/cwdev/tests/BookmarkTest.php:1387 > Updated - just changed it to look at the size of the array versus an > actual array element. You did it the wrong way: > $this->assertEquals(count($bookmarks['bookmarks']),1); In PHPUnit, you always specify the expected value first and the actual value second. All assertion methods allow another optional parameter, the additional error message to make errors clearer. So instead of > $this->assertEquals(234, $obj->some->property) you can write > $this->assertEquals(234, $obj->some->property, 'property should > always be 234 - it is specified that way') PHPUnit then will print out your error message plus the "normal" "failed to assert that 434 equals 234". I use this for complicated assertions that need an explanation. In your case, this is not needed. -- Regards/Mit freundlichen Grüßen Christian Weiske -=≡ Geeking around in the name of science since 1982 ≡=- |