Exemplo n.º 1
0
 public function testValid()
 {
     $command = new Command('testId', Command::GATEWAY_PAPER_XML);
     $filename = __DIR__ . '/test_' . date('YmdHis') . '.tmp';
     $command->saveInFile($filename);
     $this->assertGreaterThan(0, filesize($filename), 'The file of the commands can\'t be generated.');
     unlink($filename);
 }
Exemplo n.º 2
0
 function addFile($filename)
 {
     $this->nb_files++;
     $filename_package = $this->directory . ($this->save_src ? '/ftp' : '') . '/' . $this->getFilenameNewFile();
     $content = file_get_contents($filename);
     $hash = $this->transformContent($content);
     file_put_contents($filename_package, $content);
     $this->command->addFile(filesize($filename_package), $this->hash ? $hash : null, $this->getFilenameNewFile());
     $this->files_packages[] = $filename_package;
     return $this->getFilenameNewFile();
 }