function testDownloadURL() { if (TimberImageTest::is_connected()) { $url = 'http://i1.nyt.com/images/misc/nytlogo379x64.gif'; $result = TimberURLHelper::download_url($url); $this->assertStringStartsWith('/tmp/nytlogo379x64', $result); $this->assertStringEndsWith('.tmp', $result); } }
function testDownloadURL() { if (!TimberImageTest::is_connected()) { $this->markTestSkipped('Cannot test external images when not connected to internet'); return; } $url = 'http://i1.nyt.com/images/misc/nytlogo379x64.gif'; $result = TimberURLHelper::download_url($url); $this->assertContains('/nytlogo379x64', $result); $this->assertStringEndsWith('.tmp', $result); }
/** * @deprecated */ static function download_url($url, $timeout = 300) { return TimberURLHelper::download_url($url, $timeout); }