public function testGetSizeFormatted() { $file2 = File::createFromListingEntry($this->filesystem, ['path' => 'fixtures/images/2-top-right.jpg', 'size' => 123]); $this->assertSame('123 B', $file2->getSizeFormatted(true)); $file = new File($this->filesystem, 'fixtures/images/2-top-right.jpg'); $this->assertSame('6.86 KiB', $file->getSizeFormatted(false)); $file2 = File::createFromListingEntry($this->filesystem, ['path' => 'fixtures/images/2-top-right.jpg', 'size' => 12345678]); $this->assertSame('11.77 MiB', $file2->getSizeFormatted(true)); }
public function testGetSizeFormatted() { $file = new File($this->filesystem, 'fixtures/images/2-top-right.jpg'); $this->assertSame('6.86 KiB', $file->getSizeFormatted()); $this->assertSame('7.0 KB', $file->getSizeFormatted(true)); }