PHP 클래스 PhpBrew\Testing\TemporaryFileFixture

파일 보기 프로젝트 열기: phpbrew/phpbrew 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( object $caller, string $sourcePath ) $caller must be a subclass of PHPUnit_Framework_TestCase.
getTemporaryDirectory ( ) Returns the path of the temporary directory.
setTemporaryDirectory ( $dir ) Sets the temprary directory where this object puts temprary files into.
withFile ( string $destFileName, callable $callback ) Calls the callback function after creating a temporary file, which is a copy of the source file. The copy is automatically removed, so you don't have to delete it.

메소드 상세

__construct() 공개 메소드

$caller must be a subclass of PHPUnit_Framework_TestCase.
public __construct ( object $caller, string $sourcePath )
$caller object the object which creates this object.
$sourcePath string the path of a source file.

getTemporaryDirectory() 공개 메소드

Returns the path of the temporary directory.

setTemporaryDirectory() 공개 메소드

Sets the temprary directory where this object puts temprary files into.
public setTemporaryDirectory ( $dir )

withFile() 공개 메소드

The 1st argument of the callback function is an object which creates this object. The 2nd argument of the callback function is a destination file path.
public withFile ( string $destFileName, callable $callback )
$destFileName string the filename of a copy of the source file.
$callback callable the function called after creating a destination file.