1
0
mirror of https://github.com/phpmyadmin/phpmyadmin.git synced 2026-10-31 10:54:46 +03:00
Files
phpmyadmin/test/classes/PMA_PDF_test.php
Hugues Peccatte 2fe6ff4655 Set namespace on Advisor, Config, Console and Util classes.
Set namespace on DbQbe.
Set namespace to 'DbSearch'.
Split Advisor.class.php file.
Change Advisor namespace.
Rename DbQbe class and file.
Set namespace on DisplayResults.
Set namespace on Error.
Use namespace for ErrorHandler.
Add class autoloader.
Change ErrorHandler filename.
Remove some require.
Update Config namespace path.
Update PMA_Util to PMA\libraries\Util.
Rename Font and File classes files.
Use namespace for Footer.
Set namespace in all libraries classes.
Namespace OutputBuffering.
Export SubPartition.
Rename Partition file.
Namespace PDF.
Namespace RecentFavoriteTable.
Replace PMA_Response by Response and PMA_Message by Message.
Update uses and calls.
Fix unit tests.
Fix SqlParser autoload.

Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
2015-08-29 16:27:21 +02:00

87 lines
1.8 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 'libraries/Util.php';
require_once 'libraries/PDF.php';
require_once 'libraries/php-gettext/gettext.inc';
require_once 'libraries/core.lib.php';
require_once 'libraries/Config.php';
/**
* tests for PDF class
*
* @package PhpMyAdmin-test
*/
class PMA_PDF_Test extends PHPUnit_Framework_TestCase
{
/**
* SetUp for test cases
*
* @return void
*/
public function setup()
{
$GLOBALS['PMA_Config'] = new PMA\libraries\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(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());
}
}