I'm checking for the existence of certain keys in a dictionary. It is aleady guarenteed that if the key exists its value is non-false; and that the dictionairy will return false if the key doesn't exist.
I've currently coded these assertions as
Code: Select all
$this->assertTrue($this->pb->getQuery("Key Name"));Code: Select all
assertNotEqual(false,$this->pb->getQuery("Key Name"));I could write it as
Code: Select all
$this->assertTrue(in_array("Key Name",$this->pb->getKeys()))I guess the other option would be to use assertEquals with the actual returned value. However the returned values are slightly brittled and will likely have a fair bit of tweaking at the whitespace level that would be hard to properly right a regexp for.
Any other thoughts?