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