Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Commit b77ca72

Browse files
authored
Merge pull request #24 from biigle/laravel-9
Upgrade to Laravel 9
2 parents 1b16202 + fee66e2 commit b77ca72

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/Support/Import/ArchiveManager.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,11 @@ public function delete($token)
150150
*/
151151
public function prune()
152152
{
153-
$files = $this->disk->listContents();
153+
$files = $this->disk->listContents('/');
154154
$limit = Carbon::now()->subWeek()->getTimestamp();
155-
foreach ($files as $metadata) {
156-
if ($metadata['timestamp'] < $limit) {
157-
$this->disk->delete($metadata['path']);
155+
foreach ($files as $file) {
156+
if ($file->lastModified() < $limit) {
157+
$this->disk->delete($file->path());
158158
}
159159
}
160160
}

tests/Support/Export/PublicLabelTreeExportTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public function testGetContent()
2626
'description' => $tree->description,
2727
'uuid' => $tree->uuid,
2828
'version' => null,
29-
'created_at' => (string) $tree->created_at,
30-
'updated_at' => (string) $tree->updated_at,
29+
'created_at' => $tree->created_at->toJson(),
30+
'updated_at' => $tree->updated_at->toJson(),
3131
];
3232

3333
$this->assertEquals($expect, $export->getContent());
@@ -51,8 +51,8 @@ public function testGetContentVersion()
5151
'name' => $version->name,
5252
'doi' => $version->doi,
5353
],
54-
'created_at' => (string) $tree->created_at,
55-
'updated_at' => (string) $tree->updated_at,
54+
'created_at' => $tree->created_at->toJson(),
55+
'updated_at' => $tree->updated_at->toJson(),
5656
];
5757

5858
$this->assertEquals($expect, $export->getContent());

tests/Support/Import/ArchiveManagerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function testStoreUserExportNotAllowed()
5353
$this->assertFalse(true);
5454
} catch (Exception $e) {
5555
$this->assertStringContainsString('User imports are not allowed', $e->getMessage());
56-
$this->assertEmpty(Storage::disk('test')->listContents());
56+
$this->assertEmpty(Storage::disk('test')->listContents('/')->toArray());
5757
}
5858
}
5959

@@ -83,7 +83,7 @@ public function testStoreLabelTreeExportNotAllowed()
8383
$this->assertFalse(true);
8484
} catch (Exception $e) {
8585
$this->assertStringContainsString('Label tree imports are not allowed', $e->getMessage());
86-
$this->assertEmpty(Storage::disk('test')->listContents());
86+
$this->assertEmpty(Storage::disk('test')->listContents('/')->toArray());
8787
}
8888
}
8989

@@ -113,7 +113,7 @@ public function testStoreVolumeExportNotAllowed()
113113
$this->assertFalse(true);
114114
} catch (Exception $e) {
115115
$this->assertStringContainsString('Volume imports are not allowed', $e->getMessage());
116-
$this->assertEmpty(Storage::disk('test')->listContents());
116+
$this->assertEmpty(Storage::disk('test')->listContents('/')->toArray());
117117
}
118118
}
119119

@@ -175,7 +175,7 @@ public function testPrune()
175175

176176
$manager = new ArchiveManager;
177177
$token = $manager->store($file);
178-
$path = Storage::disk('test')->getAdapter()->applyPathPrefix($token);
178+
$path = storage_path("framework/testing/disks/test/{$token}");
179179

180180
$manager->prune();
181181
$this->assertTrue($manager->has($token));

0 commit comments

Comments
 (0)