public static createFromFile ( string $filePathAndFilename ) : |
||
$filePathAndFilename | string | |
return |
public static function createFromFile($filePathAndFilename)
{
$asset = self::getInstance();
$asset->setExternal(false);
$asset->setPath($filePathAndFilename);
return $asset->finalize();
}
/** * @test */ public function buildMethodsReturnExpectedValues() { $file = $this->getAbsoluteAssetFixturePath(); $asset = Asset::createFromFile($file); $constraint = new \PHPUnit_Framework_Constraint_IsType('string'); $this->assertThat($asset->render(), $constraint); $this->assertNotEmpty($asset->render()); $this->assertThat($asset->build(), $constraint); $this->assertNotEmpty($asset->build()); $this->assertSame($asset, $asset->finalize()); }