Example #1
0
 public function test_image_thumb_url()
 {
     Filesystem::shouldReceive('extractName')->once()->with('foo/bar.jpg')->andReturn('bar.jpg');
     Filesystem::shouldReceive('extension')->once()->with('foo/bar.jpg')->andReturn('jpg');
     URL::shouldReceive('asset')->once()->with('foo/bar.jpg')->andReturn('http://www.example.com/foo/bar.jpg');
     $item = new Item('foo/bar.jpg');
     $this->assertEquals('http://www.example.com/foo/bar.jpg', $item->thumb);
 }
Example #2
0
 /**
  * Setup of the resource
  *
  * @param string $path
  * @param bool $folder
  */
 public function __construct($path, $folder = false, $back = false)
 {
     $this->path = $path;
     $this->name = $folder && $back ? '..' : FsFacade::extractName($path);
     $this->extension = FsFacade::extension($path);
     $this->folder = $folder;
     $this->back = $folder && $back;
     $this->thumb = $this->thumbUrl();
 }
Example #3
0
 /**
  * Create a folder on the server
  *
  * @param string $path
  * @param string $folder
  * @return boolean
  */
 public function folderCreate($path, $folder)
 {
     return FsFacade::folderCreate($path, $folder);
 }