Пример #1
0
 /**
  * Check to see if the file is valid
  *
  * @param string $path
  * @return bool
  */
 public function check($path)
 {
     $extension = File::extension($path);
     if (!in_array($extension, $this->extensions)) {
         throw new InvalidFileTypeException(sprintf('%s is an invalid file type for the %s class', $extension, get_class($this)));
     }
     return true;
 }
Пример #2
0
 /** @test */
 public function should_get_extension_from_path()
 {
     $this->assertEquals('json', File::extension('data.json'));
 }