phpmyadmin/test/classes/PDFTest.php
Maurício Meneghini Fauth 13c0f7bc3c Move classes to PhpMyAdmin namespace
- Move Advisor to PhpMyAdmin namespace
- Move Bookmark to PhpMyAdmin namespace
- Move Charsets to PhpMyAdmin namespace
- Move Config class to PhpMyAdmin namespace
- Move Console class to PhpMyAdmin namespace
- Move Core to PhpMyAdmin namespace
- Move DatabaseInterface to PhpMyAdmin namespace
- Move DbList to PhpMyAdmin namespace
- Move DbQbe to PhpMyAdmin namespace
- Move DbSearch to PhpMyAdmin namespace
- Move DisplayResults to PhpMyAdmin namespace
- Move Encoding to PhpMyAdmin namespace
- Move Error to PhpMyAdmin namespace
- Move ErrorHandler to PhpMyAdmin namespace
- Move File to PhpMyAdmin namespace
- Move Font to PhpMyAdmin namespace
- Move Footer to PhpMyAdmin namespace
- Move Header to PhpMyAdmin namespace
- Move Index to PhpMyAdmin namespace
- Move IndexColumn to PhpMyAdmin namespace
- Move LanguageManager to PhpMyAdmin namespace
- Move Language to PhpMyAdmin namespace
- Move Linter to PhpMyAdmin namespace
- Move ListAbstract to PhpMyAdmin namespace
- Move ListDatabase to PhpMyAdmin namespace

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
2017-06-28 21:17:18 -03:00

83 lines
1.6 KiB
PHP

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* tests for PDF class
*
* @package PhpMyAdmin-test
*/
/*
* Include to test.
*/
use PMA\libraries\PDF;
require_once 'test/PMATestCase.php';
/**
* tests for PDF class
*
* @package PhpMyAdmin-test
*/
class PDFTest extends PMATestCase
{
/**
* SetUp for test cases
*
* @return void
*/
public function setup()
{
$GLOBALS['PMA_Config'] = new PhpMyAdmin\Config();
$GLOBALS['PMA_Config']->enableBc();
}
/**
* Test for PDF::getPDFData
*
* @group large
* @return void
*/
public function testBasic()
{
$arr = new PDF();
$this->assertContains('PDF', $arr->getPDFData());
}
/**
* Test for PDF::getPDFData
*
* @group large
* @return void
*/
public function testAlias()
{
$arr = new PDF();
$arr->setAlias('{00}', '32');
$this->assertContains('PDF', $arr->getPDFData());
}
/**
* Test for PDF::getPDFData
*
* @group large
* @return void
*/
public function testDocument()
{
$pdf = new PDF();
$pdf->SetTitle('Title');
$pdf->Open();
$pdf->SetAutoPageBreak('auto');
$pdf->Addpage();
$pdf->SetFont(PDF::PMA_PDF_FONT, 'B', 14);
$pdf->Cell(0, 6, 'Cell', 'B', 1, 'C');
$pdf->Ln();
$pdf->Addpage();
$pdf->Bookmark('Bookmark');
$pdf->SetMargins(0, 0);
$pdf->SetDrawColor(200, 200, 200);
$pdf->line(0, 0, 100, 100);
$this->assertContains('PDF', $pdf->getPDFData());
}
}