コード例 #1
0
ファイル: HttpClientTest.php プロジェクト: im286er/windwalker
 /**
  * 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'));
 }
コード例 #2
0
ファイル: BladeoptCommand.php プロジェクト: lyrasoft/unidev
 /**
  * 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;
 }