Skip to content

Commit 16ee9be

Browse files
committed
Minor changes
1 parent 9c3afcf commit 16ee9be

File tree

2 files changed

+13
-28
lines changed

2 files changed

+13
-28
lines changed

src/resources/views/update/s3.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
@error('endpoint')
2424
<p class="help-block">{{$message}}</p>
2525
@enderror
26-
<p class="help-block">
26+
<p class="help-block">
2727
This must be the full URL including the bucket name, region etc.
2828
</p>
2929
</div>

tests/Http/Controllers/Api/UserDiskControllerTest.php

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
class UserDiskControllerTest extends ApiTestCase
1111
{
12-
private $mockS3 = null;
12+
private $mockS3;
13+
1314
public function setUp(): void
1415
{
1516
parent::setUp();
@@ -47,7 +48,6 @@ public function testStore()
4748
public function testStoreS3()
4849
{
4950
$this->beUser();
50-
5151
$this->mockS3->shouldReceive('canAccessDisk')->never();
5252
$this->postJson("/api/v1/user-disks", [
5353
'name' => 'my disk',
@@ -86,7 +86,6 @@ public function testStoreS3()
8686

8787
public function testDuplicateNames(){
8888
$this->beUser();
89-
9089
$this->mockS3->shouldReceive('canAccessDisk')->once()->andReturn([]);
9190
$this->postJson("/api/v1/user-disks", [
9291
'name' => 'my disk',
@@ -128,7 +127,6 @@ public function testDuplicateNames(){
128127
public function testStoreS3RegionEmpty()
129128
{
130129
$this->beUser();
131-
132130
$this->mockS3->shouldReceive('canAccessDisk')->once()->andReturn([]);
133131
$this->postJson("/api/v1/user-disks", [
134132
'name' => 'my disk',
@@ -148,7 +146,6 @@ public function testStoreS3RegionEmpty()
148146
public function testStoreS3PathStyle()
149147
{
150148
$this->beUser();
151-
152149
$this->mockS3->shouldReceive('canAccessDisk')->never();
153150
$this->postJson("/api/v1/user-disks", [
154151
'name' => 'my disk',
@@ -374,7 +371,6 @@ public function testDestroy()
374371
public function testStoreInvalidS3Config()
375372
{
376373
$this->beUser();
377-
378374
$this->mockS3->shouldReceive('canAccessDisk')->never();
379375
$this->postJson("/api/v1/user-disks", [
380376
'name' => 'my disk',
@@ -384,8 +380,7 @@ public function testStoreInvalidS3Config()
384380
'bucket' => 'ucket',
385381
'region' => '',
386382
'endpoint' => 'http://bucket.example.com',
387-
])
388-
->assertUnprocessable();
383+
])->assertUnprocessable();
389384

390385
$disk = UserDisk::where('user_id', $this->user()->id)->first();
391386
$this->assertEmpty($disk);
@@ -410,8 +405,7 @@ public function testUpdateInvalidS3Config()
410405
$this->mockS3->shouldReceive('canAccessDisk')->never();
411406
$this->putJson("/api/v1/user-disks/{$disk->id}", [
412407
'endpoint' => 'https://bucket.example.com',
413-
])
414-
->assertUnprocessable();
408+
])->assertUnprocessable();
415409

416410
$disk = $disk->fresh();
417411
$this->assertEquals('https://jkl.example.com', $disk->options['endpoint']);
@@ -420,7 +414,6 @@ public function testUpdateInvalidS3Config()
420414
public function testStoreIncorrectBucketName()
421415
{
422416
$this->beUser();
423-
424417
$this->mockS3->shouldReceive('canAccessDisk')->never();
425418
$this->postJson("/api/v1/user-disks", [
426419
'name' => 'my disk',
@@ -430,8 +423,7 @@ public function testStoreIncorrectBucketName()
430423
'bucket' => 'ucket',
431424
'region' => '',
432425
'endpoint' => 'http://bucket.example.com',
433-
])
434-
->assertUnprocessable();
426+
])->assertUnprocessable();
435427

436428
$this->mockS3->shouldReceive('canAccessDisk')->never();
437429
$this->postJson("/api/v1/user-disks", [
@@ -442,8 +434,7 @@ public function testStoreIncorrectBucketName()
442434
'bucket' => 'bucket',
443435
'region' => '',
444436
'endpoint' => 'http://ucket.example.com',
445-
])
446-
->assertUnprocessable();
437+
])->assertUnprocessable();
447438

448439
$this->mockS3->shouldReceive('canAccessDisk')->never();
449440
$this->postJson("/api/v1/user-disks", [
@@ -454,8 +445,7 @@ public function testStoreIncorrectBucketName()
454445
'bucket' => 'ucket',
455446
'region' => '',
456447
'endpoint' => 'http://example.com/bucket',
457-
])
458-
->assertUnprocessable();
448+
])->assertUnprocessable();
459449

460450
$this->mockS3->shouldReceive('canAccessDisk')->never();
461451
$this->postJson("/api/v1/user-disks", [
@@ -466,8 +456,7 @@ public function testStoreIncorrectBucketName()
466456
'bucket' => 'bucket',
467457
'region' => '',
468458
'endpoint' => 'http://example.com/ucket',
469-
])
470-
->assertUnprocessable();
459+
])->assertUnprocessable();
471460
}
472461

473462
public function testUpdateIncorrectBucketName()
@@ -496,8 +485,7 @@ public function testUpdateIncorrectBucketName()
496485
'bucket' => 'm',
497486
'region' => 'us-east-2',
498487
'endpoint' => 'https://onm.example.com',
499-
])
500-
->assertUnprocessable();
488+
])->assertUnprocessable();
501489

502490
$this->mockS3->shouldReceive('canAccessDisk')->never();
503491
$this->putJson("/api/v1/user-disks/{$disk->id}", [
@@ -508,8 +496,7 @@ public function testUpdateIncorrectBucketName()
508496
'bucket' => 'onm',
509497
'region' => 'us-east-2',
510498
'endpoint' => 'https://m.example.com',
511-
])
512-
->assertUnprocessable();
499+
])->assertUnprocessable();
513500

514501
$this->mockS3->shouldReceive('canAccessDisk')->never();
515502
$this->putJson("/api/v1/user-disks/{$disk->id}", [
@@ -520,8 +507,7 @@ public function testUpdateIncorrectBucketName()
520507
'bucket' => 'm',
521508
'region' => 'us-east-2',
522509
'endpoint' => 'https://example.com/onm',
523-
])
524-
->assertUnprocessable();
510+
])->assertUnprocessable();
525511

526512
$this->mockS3->shouldReceive('canAccessDisk')->never();
527513
$this->putJson("/api/v1/user-disks/{$disk->id}", [
@@ -532,7 +518,6 @@ public function testUpdateIncorrectBucketName()
532518
'bucket' => 'onm',
533519
'region' => 'us-east-2',
534520
'endpoint' => 'https://example.com/m',
535-
])
536-
->assertUnprocessable();
521+
])->assertUnprocessable();
537522
}
538523
}

0 commit comments

Comments
 (0)