Skip to content

Commit 11545de

Browse files
committed
Tests
1 parent 4f69267 commit 11545de

13 files changed

+69
-281
lines changed

ext/calendar/tests/bug80185.phpt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,5 @@ try {
1818
?>
1919
--EXPECTF--
2020
int(2170713600)
21-
22-
Deprecated: Implicit conversion to int from non-compatible float 106751993607888.640625 in %s on line %d
2321
int(9223372036854720000)
24-
25-
Deprecated: Implicit conversion to int from non-compatible float 106751993607889.640625 in %s on line %d
2622
jday must be between 2440588 and 106751993607888

ext/gd/tests/bug43073.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $y = 0;
3737
$cos_t = cos(deg2rad($delta_t));
3838
$sin_t = sin(deg2rad($delta_t));
3939
for ($angle = 0.0, $i = 0; $angle < 360.0; $angle += $delta_t, $i++) {
40-
$bbox = imagettftext($g, 24, (int)$angle, 400+$x, 400+$y, $black, $font, 'ABCDEF');
40+
$bbox = imagettftext($g, 24, (int)$angle, (int)(400+$x), (int)(400+$y), $black, $font, 'ABCDEF');
4141
imagepolygon($g, $bbox, $red);
4242
printf("%2d: ", $i);
4343
for ($j = 0; $j < 8; $j++) {

ext/gd/tests/bug53504.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ foreach ($tests as $testnum => $test) {
7777
// draw baseline:
7878
$width = sqrt(pow($bboxDrawn[2] - $bboxDrawn[0], 2) + pow($bboxDrawn[3] - $bboxDrawn[1], 2));
7979
imageline($g, $test['x'], $test['y'],
80-
$test['x'] + $width * (int)cos(deg2rad($test['angle'])),
81-
$test['y'] - $width * (int)sin(deg2rad($test['angle'])), $blue);
80+
$test['x'] + (int)($width * cos(deg2rad($test['angle']))),
81+
$test['y'] - (int)($width * sin(deg2rad($test['angle']))), $blue);
8282
}
8383

8484
imagepng($g, "$cwd/bug53504.png");

ext/mbstring/tests/mb_substitute_character_variation_weak_types.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ ValueError: mb_substitute_character(): Argument #1 ($substitute_character) must
130130
ValueError: mb_substitute_character(): Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint
131131
--float .5--
132132

133-
Deprecated: Implicit conversion from non-compatible float 0.5 to int in in %s on line %d
133+
Deprecated: Implicit conversion from non-compatible float 0.5 to int in %s on line %d
134134
bool(true)
135135
--empty array--
136136
TypeError: mb_substitute_character(): Argument #1 ($substitute_character) must be of type string|int|null, array given

ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ memory_limit=83886080
227227
$current_targets = mt_rand(-100000, 100000) / 10;
228228
do {
229229
$trend = (mt_rand(0, 3) > 1) ? (mt_rand(-10000, 10000) / 100) : 'NULL';
230-
} while (isset($values[$trend]));
230+
} while (isset($values[(int)$trend]));
231231

232232
$sql = sprintf('INSERT INTO test(targetport, current_targets, maxreports, trend) VALUES (%d, %f, %s, %s)',
233233
$i,

ext/standard/tests/file/disk_free_space_basic.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ rmdir($file_path."/disk_free_space");
5353
float(%f)
5454
float(%f)
5555
*** Testing with newly created directory ***
56-
56+
5757
Free Space before writing to a file
5858
float(%f)
5959

ext/standard/tests/math/decbin_variation1.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
1010
<?php
1111
echo "*** Testing decbin() : usage variations ***\n";
1212

13-
$inputs = array(
13+
$inputs = [
1414
// int data
1515
/*1*/ 0,
1616
1,
@@ -31,7 +31,7 @@ $inputs = array(
3131
// empty data
3232
/*12*/ "",
3333
'',
34-
);
34+
];
3535

3636
// loop through each element of $inputs to check the behaviour of decbin()
3737
foreach ($inputs as $i => $input) {
@@ -82,7 +82,7 @@ string(1) "1"
8282
string(1) "0"
8383

8484
-- Iteration 12 --
85-
string(1) "0"
85+
decbin(): Argument #1 ($num) must be of type int, string given
8686

8787
-- Iteration 13 --
88-
string(1) "0"
88+
decbin(): Argument #1 ($num) must be of type int, string given

ext/standard/tests/math/decbin_variation1_64bit.phpt

Lines changed: 17 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -10,61 +10,31 @@ if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
1010
<?php
1111
echo "*** Testing decbin() : usage variations ***\n";
1212

13-
// heredoc string
14-
$heredoc = <<<EOT
15-
abc
16-
xyz
17-
EOT;
18-
19-
// get a class
20-
class classA
21-
{
22-
}
23-
24-
// get a resource variable
25-
$fp = fopen(__FILE__, "r");
26-
27-
$inputs = array(
13+
$inputs = [
2814
// int data
2915
/*1*/ 0,
3016
1,
3117
12345,
3218
-2345,
33-
18446744073709551615, // largest decimal
34-
18446744073709551616,
19+
4294967295, // largest decimal
20+
4294967296,
3521

3622
// float data
37-
/*7*/ 10.5,
38-
-10.5,
39-
12.3456789000e10,
40-
12.3456789000E-10,
41-
.5,
23+
/* 7*/ 12.3456789000e10,
4224

4325
// boolean data
44-
/*14*/ true,
26+
/* 8*/ true,
4527
false,
4628
TRUE,
4729
FALSE,
4830

4931
// empty data
50-
/*18*/ "",
32+
/*12*/ "",
5133
'',
52-
array(),
53-
54-
// string data
55-
/*21*/ "abcxyz",
56-
'abcxyz',
57-
$heredoc,
58-
59-
// object data
60-
/*24*/ new classA(),
61-
62-
// resource variable
63-
/*27*/ $fp
64-
);
34+
];
6535

6636
// loop through each element of $inputs to check the behaviour of decbin()
67-
foreach($inputs as $i => $input) {
37+
foreach ($inputs as $i => $input) {
6838
$iterator = $i + 1;
6939
echo "\n-- Iteration $iterator --\n";
7040
try {
@@ -73,9 +43,9 @@ foreach($inputs as $i => $input) {
7343
echo $exception->getMessage() . "\n";
7444
}
7545
}
76-
fclose($fp);
46+
7747
?>
78-
--EXPECTF--
48+
--EXPECT--
7949
*** Testing decbin() : usage variations ***
8050

8151
-- Iteration 1 --
@@ -91,66 +61,28 @@ string(14) "11000000111001"
9161
string(64) "1111111111111111111111111111111111111111111111111111011011010111"
9262

9363
-- Iteration 5 --
94-
decbin(): Argument #1 ($num) must be of type int, float given
64+
string(32) "11111111111111111111111111111111"
9565

9666
-- Iteration 6 --
97-
decbin(): Argument #1 ($num) must be of type int, float given
67+
string(33) "100000000000000000000000000000000"
9868

9969
-- Iteration 7 --
100-
101-
Deprecated: Implicit conversion from non-compatible float 10.5 to int in %s on line %d
102-
string(4) "1010"
70+
string(37) "1110010111110100110010001101000001000"
10371

10472
-- Iteration 8 --
105-
106-
Deprecated: Implicit conversion from non-compatible float -10.5 to int in %s on line %d
107-
string(64) "1111111111111111111111111111111111111111111111111111111111110110"
73+
string(1) "1"
10874

10975
-- Iteration 9 --
110-
string(37) "1110010111110100110010001101000001000"
76+
string(1) "0"
11177

11278
-- Iteration 10 --
113-
114-
Deprecated: Implicit conversion from non-compatible float 1.23456789E-9 to int in %s on line %d
115-
string(1) "0"
79+
string(1) "1"
11680

11781
-- Iteration 11 --
118-
119-
Deprecated: Implicit conversion from non-compatible float 0.5 to int in %s on line %d
12082
string(1) "0"
12183

12284
-- Iteration 12 --
123-
string(1) "1"
124-
125-
-- Iteration 13 --
126-
string(1) "0"
127-
128-
-- Iteration 14 --
129-
string(1) "1"
130-
131-
-- Iteration 15 --
132-
string(1) "0"
133-
134-
-- Iteration 16 --
135-
decbin(): Argument #1 ($num) must be of type int, string given
136-
137-
-- Iteration 17 --
13885
decbin(): Argument #1 ($num) must be of type int, string given
13986

140-
-- Iteration 18 --
141-
decbin(): Argument #1 ($num) must be of type int, array given
142-
143-
-- Iteration 19 --
144-
decbin(): Argument #1 ($num) must be of type int, string given
145-
146-
-- Iteration 20 --
147-
decbin(): Argument #1 ($num) must be of type int, string given
148-
149-
-- Iteration 21 --
87+
-- Iteration 13 --
15088
decbin(): Argument #1 ($num) must be of type int, string given
151-
152-
-- Iteration 22 --
153-
decbin(): Argument #1 ($num) must be of type int, classA given
154-
155-
-- Iteration 23 --
156-
decbin(): Argument #1 ($num) must be of type int, resource given

ext/standard/tests/math/dechex_variation1.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
1010
<?php
1111
echo "*** Testing dechex() : usage variations ***\n";
1212

13-
$inputs = array(
13+
$inputs = [
1414
// int data
1515
/*1*/ 0,
1616
1,
@@ -31,7 +31,7 @@ $inputs = array(
3131
// empty data
3232
/*12*/ "",
3333
'',
34-
);
34+
];
3535

3636
// loop through each element of $inputs to check the behaviour of dechex()
3737
foreach ($inputs as $i => $input) {
@@ -82,7 +82,7 @@ string(1) "1"
8282
string(1) "0"
8383

8484
-- Iteration 12 --
85-
string(1) "0"
85+
dechex(): Argument #1 ($num) must be of type int, string given
8686

8787
-- Iteration 13 --
88-
string(1) "0"
88+
dechex(): Argument #1 ($num) must be of type int, string given

0 commit comments

Comments
 (0)