本文整理匯總了PHP中MediaHelper::file方法的典型用法代碼示例。如果您正苦於以下問題:PHP MediaHelper::file方法的具體用法?PHP MediaHelper::file怎麽用?PHP MediaHelper::file使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MediaHelper
的用法示例。
在下文中一共展示了MediaHelper::file方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testFile
public function testFile()
{
$result = $this->Media->file('http://example.com/img/image-png');
$this->assertFalse($result);
$result = $this->Media->file('static/img/non-existent.jpg');
$this->assertFalse($result);
$result = $this->Media->file('img/image-png');
$this->assertEqual($result, $this->file0);
$result = $this->Media->file('s/static/img/image-png');
$this->assertEqual($result, $this->file1);
$result = $this->Media->file('s/static/img/dot.ted.name');
$this->assertEqual($result, $this->file2);
$result = $this->Media->file('img/image-png-x');
$this->assertEqual($result, $this->file3);
$result = $this->Media->file('s/transfer/img/image-png-x');
$this->assertEqual($result, $this->file4);
$result = $this->Media->file($this->Data->settings['filter'] . 's/transfer/img/image-png-x.png');
$this->assertEqual($result, $this->file4);
$result = $this->Media->file('blanko/img/image-blanko');
$this->assertEqual($result, $this->file5);
}