/** * Search for a file on the filesystem and create a new * wrapper instance to represent it * * @var string $filename The path + name of the file * @return Sherlock\Asset The asset object **/ public function find($filename) { $asset = new Asset($filename, $this); if (!$asset->exists()) { throw new Exceptions\MissingFile($filename); } else { return $asset; } }
public function testProcess() { $env = new Environment('tests/support/assets'); $env->register('test', 'Sherlock\\Test\\TestEngine'); $asset = new Asset('', $env); $asset->extension = 'test'; $asset->content = 'Hello World'; $asset->process(); $this->assertEquals('---TEST---Hello World---TEST---', $asset->content); }