TYPO3 CMS  TYPO3_6-2
GraphicalFunctionsTest.php
Go to the documentation of this file.
1 <?php
3 
23 
27  protected $fixture = NULL;
28 
34  public function setUp() {
35  $this->fixture = new \TYPO3\CMS\Core\Imaging\GraphicalFunctions();
36  }
37 
43  public function getScaleForImageDataProvider() {
44  return array(
45  'Get image scale for a width of 150px' => array(
46  array(
47  170,
48  136,
49  ),
50  '150',
51  '',
52  array(),
53  array(
54  'crs' => FALSE,
55  'origW' => 150,
56  'origH' => 0,
57  'max' => 0,
58  0 => 150,
59  1 => (float) 120
60  ),
61  ),
62  'Get image scale with a maximum width of 100px' => array(
63  array(
64  170,
65  136,
66  ),
67  '',
68  '',
69  array(
70  'maxW' => 100
71  ),
72  array(
73  'crs' => FALSE,
74  'origW' => 100,
75  'origH' => 0,
76  'max' => 1,
77  0 => 100,
78  1 => (float) 80
79  ),
80  ),
81  'Get image scale with a minimum width of 200px' => array(
82  array(
83  170,
84  136,
85  ),
86  '',
87  '',
88  array(
89  'minW' => 200
90  ),
91  array(
92  'crs' => FALSE,
93  'origW' => 0,
94  'origH' => 0,
95  'max' => 0,
96  0 => 200,
97  1 => (float) 136
98  ),
99  ),
100  );
101  }
102 
107  public function getScaleForImage($info, $width, $height, $options, $expected) {
108  $result = $this->fixture->getImageScale($info, $width, $height, $options);
109  $this->assertEquals($result, $expected);
110  }
111 }
getScaleForImage($info, $width, $height, $options, $expected)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren&#39;t numeric.