ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
FontTest.php
Go to the documentation of this file.
1 <?php
2 
3 
4 require_once 'testDataFileIterator.php';
5 
7 {
8 
9  public function setUp()
10  {
11  if (!defined('PHPEXCEL_ROOT')) {
12  define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
13  }
14  require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
15  }
16 
17  public function testGetAutoSizeMethod()
18  {
20 
21  $result = call_user_func(array('PHPExcel_Shared_Font','getAutoSizeMethod'));
22  $this->assertEquals($expectedResult, $result);
23  }
24 
25  public function testSetAutoSizeMethod()
26  {
27  $autosizeMethodValues = array(
30  );
31 
32  foreach($autosizeMethodValues as $autosizeMethodValue) {
33  $result = call_user_func(array('PHPExcel_Shared_Font','setAutoSizeMethod'),$autosizeMethodValue);
34  $this->assertTrue($result);
35  }
36  }
37 
39  {
40  $unsupportedAutosizeMethod = 'guess';
41 
42  $result = call_user_func(array('PHPExcel_Shared_Font','setAutoSizeMethod'),$unsupportedAutosizeMethod);
43  $this->assertFalse($result);
44  }
45 
49  public function testFontSizeToPixels()
50  {
51  $args = func_get_args();
52  $expectedResult = array_pop($args);
53  $result = call_user_func_array(array('PHPExcel_Shared_Font','fontSizeToPixels'),$args);
54  $this->assertEquals($expectedResult, $result);
55  }
56 
57  public function providerFontSizeToPixels()
58  {
59  return new testDataFileIterator('rawTestData/Shared/FontSizeToPixels.data');
60  }
61 
65  public function testInchSizeToPixels()
66  {
67  $args = func_get_args();
68  $expectedResult = array_pop($args);
69  $result = call_user_func_array(array('PHPExcel_Shared_Font','inchSizeToPixels'),$args);
70  $this->assertEquals($expectedResult, $result);
71  }
72 
73  public function providerInchSizeToPixels()
74  {
75  return new testDataFileIterator('rawTestData/Shared/InchSizeToPixels.data');
76  }
77 
81  public function testCentimeterSizeToPixels()
82  {
83  $args = func_get_args();
84  $expectedResult = array_pop($args);
85  $result = call_user_func_array(array('PHPExcel_Shared_Font','centimeterSizeToPixels'),$args);
86  $this->assertEquals($expectedResult, $result);
87  }
88 
90  {
91  return new testDataFileIterator('rawTestData/Shared/CentimeterSizeToPixels.data');
92  }
93 
94 }
const AUTOSIZE_METHOD_APPROX
Definition: Font.php:39
$result
providerCentimeterSizeToPixels()
Definition: FontTest.php:89
testFontSizeToPixels()
providerFontSizeToPixels
Definition: FontTest.php:49
providerInchSizeToPixels()
Definition: FontTest.php:73
const AUTOSIZE_METHOD_EXACT
Definition: Font.php:40
Create styles array
The data for the language used.
testGetAutoSizeMethod()
Definition: FontTest.php:17
providerFontSizeToPixels()
Definition: FontTest.php:57
testSetAutoSizeMethodWithInvalidValue()
Definition: FontTest.php:38
setUp()
Definition: FontTest.php:9
testInchSizeToPixels()
providerInchSizeToPixels
Definition: FontTest.php:65
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
testCentimeterSizeToPixels()
providerCentimeterSizeToPixels
Definition: FontTest.php:81
testSetAutoSizeMethod()
Definition: FontTest.php:25