|
From: Marcus B. <ma...@la...> - 2003-12-12 21:10:44
|
Hi...
Jason Sweat wrote:
> $this->AssertError(new
> WantedPatternExpectation('/No.*plant.*'.TEST_PLANT_BAD.'.*/i'));
>
> produces:
>
> Fail: testbadgetlovparms->Expected [Object] in PHP error [No Cost Card List of
> Value Keys for plant 'FOOBAR'] severity [E_USER_NOTICE] in
> [/home/sweatje/public_html/pftanal/models/PlantConfig.php] line [263]
>
> Can Assertions be modified to accept Expectations?
There is a SimpleTest::assertExpectation() which is used internally. It
doesn't read the error queue though, but it does make it easier to use
expectations in both the mocks and the test framework.
> or is there a simpler way
> to look for patterns in errors?
>
> I have temporarily added the following assertion:
That is the way to do it. Having commented that patterns were a better
way of checking errors, I should have added that method, shouldn't I? ;)
> But this seems like something I would want all the time in a variety of test
> cases. Any guidance on a permanent fix?
>
I'll add it to my TODO and it will roll out on the next release.
> Thanks,
>
> Jason
yours, Marcus
--
Marcus Baker, ma...@la..., no...@ap...
|