forked from gtkforphp/cairo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtransformDistance.phpt
More file actions
67 lines (61 loc) · 1.59 KB
/
Copy pathtransformDistance.phpt
File metadata and controls
67 lines (61 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
--TEST--
CairoMatrix->transformDistance method
--SKIPIF--
<?php
if(!extension_loaded('cairo')) die('skip - Cairo extension not available');
?>
--FILE--
<?php
$matrix = new CairoMatrix();
var_dump($matrix);
var_dump($matrix->transformDistance(1.0, 1.0));
/* Wrong number args */
try {
$matrix->transformDistance();
trigger_error('We should bomb here');
} catch (CairoException $e) {
echo $e->getMessage(), PHP_EOL;
}
/* Wrong number args 2 */
try {
$matrix->transformDistance(1);
trigger_error('We should bomb here');
} catch (CairoException $e) {
echo $e->getMessage(), PHP_EOL;
}
/* Wrong number args 3 */
try {
$matrix->transformDistance(1, 1, 1);
trigger_error('We should bomb here');
} catch (CairoException $e) {
echo $e->getMessage(), PHP_EOL;
}
/* Wrong arg type 1 */
try {
$matrix->transformDistance(array(), 1);
trigger_error('We should bomb here');
} catch (CairoException $e) {
echo $e->getMessage(), PHP_EOL;
}
/* Wrong arg type 2 */
try {
$matrix->transformDistance(1, array());
trigger_error('We should bomb here');
} catch (CairoException $e) {
echo $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
object(CairoMatrix)#%d (0) {
}
array(2) {
["x"]=>
float(%f)
["y"]=>
float(%f)
}
CairoMatrix::transformDistance() expects exactly 2 parameters, 0 given
CairoMatrix::transformDistance() expects exactly 2 parameters, 1 given
CairoMatrix::transformDistance() expects exactly 2 parameters, 3 given
CairoMatrix::transformDistance() expects parameter 1 to be double, array given
CairoMatrix::transformDistance() expects parameter 2 to be double, array given