/** * testDownload * * @return void */ public function testDownload() { $url = 'http://example.com'; $dest = '/path/to/file'; $this->instance->download($url, $dest); $this->assertEquals('GET', $this->transport->request->getMethod()); $this->assertEquals('http://example.com', $this->transport->request->getRequestTarget()); $this->assertEquals('/path/to/file', $this->transport->getOption('target_file')); }
/** * doExecute * * @return bool */ protected function doExecute() { $dest = WINDWALKER_ROOT . '/.idea/blade.xml'; if (!is_dir(dirname($dest))) { Folder::create(dirname($dest)); } $http = new HttpClient(); $http->download($this->file, $dest); $this->out('Downloaded <info>blade.xml</info> to <info>.idea</info> folder'); return true; }