Skip to content

Commit 3de8d2a

Browse files
committed
add tests
1 parent 06c11dd commit 3de8d2a

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

.devcontainer/devcontainer.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "PHP",
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/php:1-8.2-bullseye",
6+
"image": "mcr.microsoft.com/devcontainers/php:1-8.2-bookworm",
77
// Features to add to the dev container. More info: https://containers.dev/features.
88
// "features": {},
99
// Configure tool-specific properties.
@@ -16,9 +16,13 @@
1616
},
1717
// Use 'forwardPorts' to make a list of ports inside the container available locally.
1818
"forwardPorts": [
19-
8080,
20-
9000
21-
]
19+
8000
20+
],
21+
"runArgs": [
22+
"--add-host=host.docker.internal:host-gateway",
23+
"--network=host"
24+
],
25+
"features": {}
2226
// Use 'postCreateCommand' to run commands after the container is created.
2327
//"postCreateCommand": "sh .devcontainer/docker-php-source-xdebug.sh"
2428
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"require": {
2020
"php": "^8.1",
2121
"ext-fileinfo": "*",
22+
"guzzlehttp/guzzle": "^7.2",
2223
"illuminate/contracts": "^10.0",
2324
"illuminate/filesystem": "^10.0",
2425
"illuminate/http": "^10.0",
@@ -61,7 +62,7 @@
6162
"@composer run build",
6263
"@php vendor/bin/testbench serve"
6364
],
64-
"analyse": "vendor/bin/phpstan analyse",
65+
"analyse": "vendor/bin/phpstan analyse --memory-limit=1G",
6566
"test": "vendor/bin/pest",
6667
"test-coverage": "vendor/bin/pest --coverage",
6768
"format": "vendor/bin/pint"

ray.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
return [
4+
'host' => 'host.docker.internal',
5+
];

src/SupabaseAdapter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ class SupabaseAdapter implements FilesystemAdapter
4040
public function __construct(array $config)
4141
{
4242
$this->config = new Config($config);
43-
$this->endpoint = $this->config->get('endpoint').'/storage/v1';
44-
$this->bucket = $this->config->get('bucket');
45-
$this->key = $this->config->get('key');
43+
$endpoint = $this->config->get('endpoint') ?? throw new \LogicException('You need to specified endpoint');
44+
$this->endpoint = $endpoint.'/storage/v1';
45+
$this->bucket = $this->config->get('bucket') ?? throw new \LogicException('You need to specify bucket');
46+
$this->key = $this->config->get('key') ?? throw new \LogicException('You need to specify key');
4647

4748
$this->httpClient = Http::baseUrl($this->endpoint)->withHeaders([
4849
'Authorization' => "Bearer {$this->key}",
@@ -288,7 +289,6 @@ public function copy(string $source, string $destination, Config $config): void
288289
if (! $res->successful() || $res->json('Key') === null) {
289290
throw UnableToCopyFile::fromLocationTo($source, $destination);
290291
}
291-
292292
}
293293

294294
/**

workbench/app/Providers/WorkbenchServiceProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ public function register(): void
2121
public function boot(): void
2222
{
2323
Route::view('/', 'welcome');
24-
Route::get('/test', fn () => 'ok');
2524
}
2625
}

0 commit comments

Comments
 (0)