示例#1
0
function addFile(array $fileInfo = array(), $stringToRemove = '')
{
    if (!empty($fileInfo)) {
        $prefixSystem = Config::getValue('global', 'prefix_system');
        $suffixCache = Config::getValue('global', 'suffix_cache');
        $suffixCache = !empty($suffixCache) ? '?' . $suffixCache : '';
        $url = $prefixSystem . $fileInfo['params']['url'] . $suffixCache;
        $url = Strings::remove($url, $stringToRemove);
        return _getHtmlFileTag($fileInfo['type'], $url);
    }
    return null;
}
示例#2
0
 /**
  * @test
  */
 public function shouldReturnNullWhenTypeIsNullInHtmlFileTag()
 {
     //when
     $file = _getHtmlFileTag(null, null);
     //then
     $this->assertNull($file);
 }