Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#40 web_tester: allow passing Expectation to assertText

closed-works-for-me
Perrick Penet
None
5
2010-07-27
2009-12-14
daniel hahler
No

This patch makes WebTestCase::assertText accept an expectation object.

This is convenient for:
$this->assertText( new PatternExpectation('~\d+ foos~') );

Otherwise you'd have to use something like:
$this->assertTrue( preg_match('~\d+ foos~', $this->getBrowser()->getContentAsText()) );

Discussion

  • Perrick Penet
    Perrick Penet
    2010-07-27

    • assigned_to: nobody --> pp11
    • status: open --> closed-works-for-me
     
  • Perrick Penet
    Perrick Penet
    2010-07-27

    Wouldn't you use "$this->assertPattern" instead ?? It's even shorter ;-)

    Yours,
    Perrick