standard header and bootstrap light continued - 2 (#688)
[openemr.git] / vendor / dompdf / dompdf / tests / Dompdf / Tests / OptionsTest.php
blobb7c36fd71d6ec57bd1198ceed6c2961967ddab28
1 <?php
2 namespace Dompdf\Tests;
4 use Dompdf\Options;
5 use PHPUnit_Framework_TestCase;
7 class OptionsTest extends PHPUnit_Framework_TestCase
9 public function testConstructor()
11 $root = realpath(__DIR__ . "/../../..");
12 $option = new Options();
13 $this->assertEquals(sys_get_temp_dir(), $option->getTempDir());
14 $this->assertEquals($root . '/lib/fonts', $option->getFontDir());
15 $this->assertEquals($root . '/lib/fonts', $option->getFontCache());
16 $this->assertEquals($root, $option->getChroot());
17 $this->assertEquals($root . '/lib/fonts/log.htm', $option->getLogOutputFile());
18 $this->assertEquals('screen', $option->getDefaultMediaType());
19 $this->assertEquals('letter', $option->getDefaultPaperSize());
20 $this->assertEquals('serif', $option->getDefaultFont());
21 $this->assertEquals(96, $option->getDpi());
22 $this->assertEquals(1.1, $option->getFontHeightRatio());
23 $this->assertFalse($option->getIsPhpEnabled());
24 $this->assertFalse($option->getIsRemoteEnabled());
25 $this->assertTrue($option->getIsJavascriptEnabled());
26 $this->assertFalse($option->getIsHtml5ParserEnabled());
27 $this->assertFalse($option->getIsFontSubsettingEnabled());
28 $this->assertFalse($option->getDebugPng());
29 $this->assertFalse($option->getDebugKeepTemp());
30 $this->assertFalse($option->getDebugCss());
31 $this->assertFalse($option->getDebugLayout());
32 $this->assertTrue($option->getDebugLayoutLines());
33 $this->assertTrue($option->getDebugLayoutBlocks());
34 $this->assertTrue($option->getDebugLayoutInline());
35 $this->assertTrue($option->getDebugLayoutPaddingBox());
36 $this->assertEquals('user', $option->getAdminUsername());
37 $this->assertEquals('password', $option->getAdminPassword());
39 $option = new Options(array('tempDir' => 'test1'));
40 $this->assertEquals('test1', $option->getTempDir());
43 public function testSetters()
45 $option = new Options();
46 $option->set(array(
47 'tempDir' => 'test1',
48 'fontDir' => 'test2',
49 'fontCache' => 'test3',
50 'chroot' => 'test4',
51 'logOutputFile' => 'test5',
52 'defaultMediaType' => 'test6',
53 'defaultPaperSize' => 'test7',
54 'defaultFont' => 'test8',
55 'dpi' => 300,
56 'fontHeightRatio' => 1.2,
57 'isPhpEnabled' => true,
58 'isRemoteEnabled' => true,
59 'isJavascriptEnabled' => false,
60 'isHtml5ParserEnabled' => true,
61 'isFontSubsettingEnabled' => true,
62 'debugPng' => true,
63 'debugKeepTemp' => true,
64 'debugCss' => true,
65 'debugLayout' => true,
66 'debugLayoutLines' => false,
67 'debugLayoutBlocks' => false,
68 'debugLayoutInline' => false,
69 'debugLayoutPaddingBox' => false,
70 'adminUsername' => 'test9',
71 'adminPassword' => 'test10',
72 ));
73 $this->assertEquals('test1', $option->getTempDir());
74 $this->assertEquals('test2', $option->getFontDir());
75 $this->assertEquals('test3', $option->getFontCache());
76 $this->assertEquals('test4', $option->getChroot());
77 $this->assertEquals('test5', $option->getLogOutputFile());
78 $this->assertEquals('test6', $option->getDefaultMediaType());
79 $this->assertEquals('test7', $option->getDefaultPaperSize());
80 $this->assertEquals('test8', $option->getDefaultFont());
81 $this->assertEquals(300, $option->getDpi());
82 $this->assertEquals(1.2, $option->getFontHeightRatio());
83 $this->assertTrue($option->getIsPhpEnabled());
84 $this->assertTrue($option->getIsRemoteEnabled());
85 $this->assertFalse($option->getIsJavascriptEnabled());
86 $this->assertTrue($option->getIsHtml5ParserEnabled());
87 $this->assertTrue($option->getIsFontSubsettingEnabled());
88 $this->assertTrue($option->getDebugPng());
89 $this->assertTrue($option->getDebugKeepTemp());
90 $this->assertTrue($option->getDebugCss());
91 $this->assertTrue($option->getDebugLayout());
92 $this->assertFalse($option->getDebugLayoutLines());
93 $this->assertFalse($option->getDebugLayoutBlocks());
94 $this->assertFalse($option->getDebugLayoutInline());
95 $this->assertFalse($option->getDebugLayoutPaddingBox());
96 $this->assertEquals('test9', $option->getAdminUsername());
97 $this->assertEquals('test10', $option->getAdminPassword());