/** * @file * @brief concerne print_ledger_misc.classTest */ class Print_Ledger_MiscTest extends TestCase { /** * @var */ protected $object; private $from,$to; /** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp():void { include 'global.php'; // Exercice 2018 $this->from=92; $this->to=103; } /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ protected function tearDown():void { } function test_export() { global $g_connection; $p_from=$this->from; $p_to=$this->to; // Check Misc $ledger_misc=new Acc_Ledger($g_connection, 4); $ledger=\Print_Ledger::factory($g_connection, "D", $ledger_misc, $p_from, $p_to, "all"); $this->assertTrue($ledger instanceof Print_Ledger_Detail , "Misc. Detail returns Print_Ledger_Detail"); $ledger->setDossierInfo($ledger_misc->jrn_def_name); $ledger->AliasNbPages(); $ledger->AddPage(); $ledger->SetAuthor('NOALYSS'); $ledger->setTitle(_("Journal Opérations diverses "), true); $ledger->export(); $ledger->Output(__DIR__."/file/print_ledger_detail_misc.pdf", "F"); print __DIR__."/file/print_ledger_detail_misc.pdf". PHP_EOL; $ledger=\Print_Ledger::factory($g_connection, "L", $ledger_misc, $p_from, $p_to, "all"); $this->assertTrue($ledger instanceof Print_Ledger_Misc , "Misc. Listing returns Print_Ledger_Misc"); $ledger->setDossierInfo($ledger_misc->jrn_def_name); $ledger->AliasNbPages(); $ledger->AddPage(); $ledger->SetAuthor('NOALYSS'); $ledger->setTitle(_("Journal Opérations diverses"), true); $ledger->export(); $ledger->Output(__DIR__."/file/print_ledger_misc.pdf", "F"); print __DIR__."/file/print_ledger_misc.pdf". PHP_EOL; } }