Пример #1
0
 public function testCreateTmpFile()
 {
     $file = FileUtils::createTempFile('mock/file.png');
     $this->assertFileExists($file);
 }
Пример #2
0
 /**
  * Creates the temporary file.
  *
  * @throws BuildException if something goes wrong with the build
  */
 public function main()
 {
     if ($this->property === '') {
         throw new BuildException('no property specified');
     }
     if ($this->destDir === null) {
         $this->destDir = $this->getProject()->resolveFile('.');
     }
     $fu = new FileUtils();
     $tmpFile = $fu->createTempFile($this->prefix, $this->suffix, $this->destDir, $this->deleteOnExit, $this->createFile);
     $this->getProject()->setNewProperty($this->property, $tmpFile->toString());
 }