Skip to content

Commit

Permalink
Fix display of items with uppercase chars in list
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasbestle committed Jul 26, 2019
1 parent c41b609 commit 8938e58
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Shareable/ItemCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ public function __construct(App $app, string $path)
// sort by item name
ksort($data);

parent::__construct($data);
$this->data = $data;
}
}
4 changes: 3 additions & 1 deletion tests/Shareable/ItemCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ class ItemCollectionTest extends TestCase
public function testConstruct()
{
$collection = new ItemCollection($this->app, $this->itemsPath);
$this->assertEquals(9, $collection->count());
$this->assertEquals(10, $collection->count());
$this->assertEquals([
'UpPeRcAsE',
'expired',
'expired-with-dir',
'no-activity',
Expand All @@ -26,5 +27,6 @@ public function testConstruct()
'valid-with-dir'
], $collection->keys());
$this->assertInstanceOf(Item::class, $collection->get('valid'));
$this->assertInstanceOf(Item::class, $collection->get('UpPeRcAsE'));
}
}
2 changes: 2 additions & 0 deletions tests/Shareable/ItemsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public function testCleanUp()
$this->assertFileExists($this->itemsPath . '/not-started.json');
$this->assertFileExists($this->itemsPath . '/only-expiry.json');
$this->assertFileExists($this->itemsPath . '/only-timeout.json');
$this->assertFileExists($this->itemsPath . '/UpPeRcAsE.json');
$this->assertFileExists($this->itemsPath . '/valid.json');
$this->assertFileExists($this->itemsPath . '/valid-with-dir.json');
$this->assertFileExists($this->filesPath . '/.i-am-invisible');
Expand Down Expand Up @@ -110,6 +111,7 @@ public function testCleanUp()
$this->assertFileExists($this->itemsPath . '/not-started.json');
$this->assertFileNotExists($this->itemsPath . '/only-expiry.json');
$this->assertFileNotExists($this->itemsPath . '/only-timeout.json');
$this->assertFileExists($this->itemsPath . '/UpPeRcAsE.json');
$this->assertFileExists($this->itemsPath . '/valid.json');
$this->assertFileExists($this->itemsPath . '/valid-with-dir.json');
$this->assertFileExists($this->filesPath . '/.i-am-invisible');
Expand Down
9 changes: 9 additions & 0 deletions tests/fixtures/items/UpPeRcAsE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"activity": 9999999999,
"created": 1234567890,
"downloads": 543,
"expires": 9999999999,
"filename": "valid.txt",
"timeout": 2678400,
"user": "admin"
}

0 comments on commit 8938e58

Please sign in to comment.