Exemple #1
0
 public function __construct($file)
 {
     if (!file_exists($file)) {
         throw new FileNotFoundException("File {$file} does not exist");
     }
     parent::__construct(filesize($file));
 }
Exemple #2
0
 public function test_Nomnom_file_to_KiB()
 {
     $file = FIXTURES . DS . 'book.txt';
     $kib = Nomnom::file($file)->to(Nomnom::KiB);
     $this->assertEquals(360, floor($kib));
 }