Example #1
0
 public function testCheckIfFileSizeWorksOnFile()
 {
     $this->assertGreaterThan(0, File::size(__DIR__ . '/dummy/dummy.jpg'));
 }
Example #2
0
 public function testManager23()
 {
     $configs = ['prefix' => '', 'exts' => ['jpg', 'jpeg', 'png', 'gif'], 'weight' => 3000000, 'path' => 'tests/cache/', 'size' => ['square' => ['resize' => 'max', 'crop' => true, 'width' => 200, 'height' => 200]]];
     $path = __DIR__ . '/dummy/dummy.jpg';
     $dummies = ['name' => $path, 'type' => mime_content_type($path), 'tmp_name' => $path, 'error' => 0, 'size' => File::size($path)];
     $m = new Manager($configs);
     $m->manage($dummies, function () {
         return mt_rand(1000, 100000) . '.jpg';
     });
     $this->assertTrue($m->success);
 }