function testGet() { $browser = new SimpleBrowser(); $browser->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); $this->assertTrue($browser->get('http://www.lastcraft.com/test/network_confirm.php')); $this->assertPattern('/target for the SimpleTest/', $browser->getContent()); $this->assertPattern('/Request method.*?<dd>GET<\\/dd>/', $browser->getContent()); $this->assertEqual($browser->getTitle(), 'Simple test target file'); $this->assertEqual($browser->getResponseCode(), 200); $this->assertEqual($browser->getMimeType(), 'text/html'); }
function testGet() { $browser = new SimpleBrowser(); $browser->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); $this->assertTrue($browser->get($this->samples() . 'file.html')); $this->assertPattern('/Link to SimpleTest/', $browser->getContent()); $this->assertEqual($browser->getTitle(), 'Link to SimpleTest'); $this->assertFalse($browser->getResponseCode()); $this->assertEqual($browser->getMimeType(), ''); }