markTestSkipped('"allow_url_fopen" is set to off.'); } } /** * @expectedException \PHPUnit_Framework_Error_Warning */ public function testInvalidUrl() { $fetcher = new FileGetContentsFetcher(); $fetcher->fetch('http://notexisting.example.com'); } /** * @expectedException \PHPUnit_Framework_Error_Warning */ public function testEmptyUrl() { $fetcher = new FileGetContentsFetcher(); $fetcher->fetch(''); } public function testValidUrl() { $fetcher = new FileGetContentsFetcher(); $content = $fetcher->fetch('http://httpbin.org/html'); $this->assertContains('Herman Melville', $content); } }