/** * Builds the URL under which the file is accessible. * * This is for example important for S3 and Dropbox but also the Local adapter * if you symlink a folder to your webroot and allow direct access to a file. * * @param \Cake\Datasource\EntityInterface $entity * @param array $options * @return string */ public function url(EntityInterface $entity, array $options = []) { $bucket = $this->_getBucket($entity->adapter); $pathPrefix = $this->ensureSlash($this->_buildCloudUrl($bucket), 'after'); $path = parent::path($entity); $path = str_replace('\\', '/', $path); return $pathPrefix . $path . $this->filename($entity, $options); }
/** * testStripDashes * * @return void */ public function testStripDashes() { $builder = new BasePathBuilder(); $result = $builder->stripDashes('with-dashes-!'); $this->assertEquals($result, 'withdashes!'); }