mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-30 11:25:52 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
39 lines
948 B
PHP
39 lines
948 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Pterodactyl\Tests\Support\Fakes;
|
|
|
|
use Aws\Result;
|
|
use Aws\S3\Exception\S3Exception;
|
|
use Aws\S3\S3Client;
|
|
|
|
class FakeS3Client extends S3Client
|
|
{
|
|
/** @var list<array<string, mixed>> */
|
|
public array $deleteObjectCalls = [];
|
|
|
|
public function __construct()
|
|
{
|
|
// AwsClient derives the service name from the concrete class name, so
|
|
// provide the real S3 identifiers explicitly instead of "fakes3".
|
|
parent::__construct([
|
|
'service' => 's3',
|
|
'exception_class' => S3Exception::class,
|
|
'version' => 'latest',
|
|
'region' => 'us-east-1',
|
|
'credentials' => ['key' => 'fake', 'secret' => 'fake'],
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* @param array<string, mixed> $args
|
|
*/
|
|
public function deleteObject(array $args = []): Result
|
|
{
|
|
$this->deleteObjectCalls[] = $args;
|
|
|
|
return new Result([]);
|
|
}
|
|
}
|