blessing-skin-server/tests/Concerns/FakePackageManager.php
2019-04-05 17:23:27 +08:00

34 lines
615 B
PHP

<?php
namespace Tests\Concerns;
class FakePackageManager extends \App\Services\PackageManager
{
private $throw;
public function __construct(\GuzzleHttp\Client $guzzle = null, bool $throw = false)
{
$this->guzzle = $guzzle;
$this->throw = $throw;
}
public function download($url, $path, $shasum = null)
{
if ($this->throw) {
throw new \Exception('');
} else {
return $this;
}
}
public function extract($destination)
{
return true;
}
public function progress()
{
return '0';
}
}