keepId() public method

If not called, a new ID is created.
public keepId ( $id = 'first' ) : Pdf
return Pdf the pdf instance for method chaining
コード例 #1
0
ファイル: PdfTest.php プロジェクト: mikehaertl/php-pdftk
 public function testCanKeepFinalId()
 {
     $document = $this->getDocument1();
     $file = $this->getOutFile();
     $pdf = new Pdf($document);
     $this->assertInstanceOf('mikehaertl\\pdftk\\Pdf', $pdf->keepId('final'));
     $this->assertTrue($pdf->saveAs($file));
     $this->assertFileExists($file);
     $tmpFile = (string) $pdf->getTmpFile();
     $this->assertEquals("pdftk A='{$document}' output '{$tmpFile}' keep_final_id", (string) $pdf->getCommand());
 }