Skip to content

Commit cc61664

Browse files
committed
Fix tests
1 parent 74de008 commit cc61664

14 files changed

+13
-212
lines changed

ext/imap/tests/CONFLICTS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
imap

ext/imap/tests/imap_body.phpt

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,11 @@ require_once(__DIR__.'/skipif.inc');
99
?>
1010
--FILE--
1111
<?php
12-
echo "Checking with no parameters\n";
13-
imap_body();
1412

15-
echo "Checking with incorrect parameter type\n";
16-
imap_body('');
17-
imap_body(false);
1813
require_once(__DIR__.'/imap_include.inc');
1914
$stream_id = imap_open($default_mailbox, $username, $password) or
2015
die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());
21-
imap_body($stream_id);
16+
2217
imap_body($stream_id,-1);
2318
imap_body($stream_id,1,-1);
2419

@@ -29,17 +24,6 @@ imap_close($stream_id);
2924

3025
?>
3126
--EXPECTF--
32-
Checking with no parameters
33-
34-
Warning: imap_body() expects at least 2 parameters, 0 given in %s on line %d
35-
Checking with incorrect parameter type
36-
37-
Warning: imap_body() expects at least 2 parameters, 1 given in %s on line %d
38-
39-
Warning: imap_body() expects at least 2 parameters, 1 given in %s on line %d
40-
41-
Warning: imap_body() expects at least 2 parameters, 1 given in %s on line %d
42-
4327
Warning: imap_body(): Bad message number in %s on line %d
4428

4529
Warning: imap_body(): Invalid value for the options parameter in %s on line %d

ext/imap/tests/imap_fetch_overview_variation3.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ imap_fetch_overview() returns an object
5858
Testing with option value:bool(true)
5959
imap_fetch_overview() returns an object
6060

61-
Testing with option value:float(1)
61+
Testing with option value:float(1.000000000000001)
6262
imap_fetch_overview() returns an object
6363

6464
Testing with option value:float(1)

ext/imap/tests/imap_fetchbody_variation6.phpt

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ require_once(__DIR__.'/imap_include.inc');
1919
$stream_id = setup_test_mailbox('', 3); // set up temp mailbox with simple msgs
2020
$section = 1;
2121

22-
$sequences = array (0, 4, // out of range
23-
'1,3', '1:3', // message sequences instead of numbers
24-
);
22+
$sequences = [0, /* out of range */ 4, 1];
2523

2624
foreach($sequences as $msg_no) {
2725
echo "\n-- \$msg_no is $msg_no --\n";
@@ -52,12 +50,6 @@ Warning: imap_fetchbody(): Bad message number in %s on line %d
5250
bool(false)
5351

5452

55-
-- $msg_no is 1,3 --
56-
57-
Notice: A non well formed numeric value encountered in %s on line %d
58-
string(%d) "1: this is a test message, please ignore%a"
59-
60-
-- $msg_no is 1:3 --
61-
62-
Notice: A non well formed numeric value encountered in %s on line %d
63-
string(%d) "1: this is a test message, please ignore%a"
53+
-- $msg_no is 1 --
54+
string(42) "1: this is a test message, please ignore
55+
"

ext/imap/tests/imap_fetchheader_variation5.phpt

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ require_once(__DIR__.'/imap_include.inc');
1717

1818
$stream_id = setup_test_mailbox('', 3, $mailbox, 'notSimple'); // set up temp mailbox with 3 msgs
1919

20-
$sequences = array (0, 4, // out of range
21-
'1,3', '1:3', // message sequences instead of numbers
22-
);
20+
$sequences = [0, /* out of range */ 4, 1];
2321

2422
foreach($sequences as $msg_no) {
2523
echo "\n-- \$msg_no is $msg_no --\n";
@@ -53,24 +51,11 @@ Warning: imap_fetchheader(): Bad message number in %s on line %d
5351
bool(false)
5452

5553

56-
-- $msg_no is 1,3 --
57-
58-
Notice: A non well formed numeric value encountered in %s on line %d
59-
string(%d) "From: [email protected]
60-
Subject: Test msg 1
61-
To: %s
62-
MIME-Version: 1.0
63-
Content-Type: MULTIPART/mixed; BOUNDARY="%s"
64-
65-
"
66-
67-
-- $msg_no is 1:3 --
68-
69-
Notice: A non well formed numeric value encountered in %s on line %d
54+
-- $msg_no is 1 --
7055
string(%d) "From: [email protected]
7156
Subject: Test msg 1
72-
To: %s
57+
7358
MIME-Version: 1.0
74-
Content-Type: MULTIPART/mixed; BOUNDARY="%s"
59+
Content-Type: MULTIPART/mixed; BOUNDARY="%s=:%d"
7560

7661
"

ext/imap/tests/imap_fetchstructure_basic.phpt

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,10 @@ require_once(__DIR__.'/skipif.inc');
88
?>
99
--FILE--
1010
<?php
11-
echo "Checking with no parameters\n";
12-
imap_fetchstructure();
13-
14-
echo "Checking with incorrect parameter type\n";
15-
imap_fetchstructure('');
16-
imap_fetchstructure(false);
1711

1812
require_once(__DIR__.'/imap_include.inc');
1913
$stream_id = setup_test_mailbox('', 1);
2014

21-
imap_fetchstructure($stream_id);
2215
imap_fetchstructure($stream_id,0);
2316

2417
$z = imap_fetchstructure($stream_id,1);
@@ -44,18 +37,8 @@ imap_close($stream_id);
4437
require_once('clean.inc');
4538
?>
4639
--EXPECTF--
47-
Checking with no parameters
48-
49-
Warning: imap_fetchstructure() expects at least 2 parameters, 0 given in %s on line %d
50-
Checking with incorrect parameter type
51-
52-
Warning: imap_fetchstructure() expects at least 2 parameters, 1 given in %s on line %d
53-
54-
Warning: imap_fetchstructure() expects at least 2 parameters, 1 given in %s on line %d
5540
Create a temporary mailbox and add 1 msgs
56-
.. mailbox '{%s}%s' created
57-
58-
Warning: imap_fetchstructure() expects at least 2 parameters, 1 given in %s on line %d
41+
.. mailbox '{127.0.0.1:143/norsh}INBOX.phpttest' created
5942
bool(true)
6043
bool(true)
6144
bool(true)

ext/imap/tests/imap_gc_error.phpt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ require_once(__DIR__.'/skipif.inc');
99
?>
1010
--FILE--
1111
<?php
12-
echo "Checking with no parameters\n";
13-
imap_gc();
14-
15-
echo "Checking with incorrect parameter type\n";
16-
imap_gc('', false);
17-
imap_gc(false, false);
1812

1913
require_once(__DIR__.'/imap_include.inc');
2014
$stream_id = imap_open($default_mailbox, $username, $password) or
@@ -23,13 +17,4 @@ imap_gc($stream_id, -1);
2317

2418
?>
2519
--EXPECTF--
26-
Checking with no parameters
27-
28-
Warning: imap_gc() Expects exactly 2 parameters, 0 given in %s on line %d
29-
Checking with incorrect parameter type
30-
31-
Warning: imap_gc(): Argument #1 must be of type resource, string given in %s on line %d
32-
33-
Warning: imap_gc(): Argument #1 must be of type resource, bool given in %s on line %d
34-
3520
Warning: imap_gc(): Invalid value for the flags parameter in %s on line %d

ext/imap/tests/imap_getsubscribed_basic.phpt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,11 @@ require_once(__DIR__.'/skipif.inc');
88
?>
99
--FILE--
1010
<?php
11-
echo "Checking with no parameters\n";
12-
imap_getsubscribed();
13-
14-
echo "Checking with incorrect parameter type\n";
15-
imap_getsubscribed('');
16-
imap_getsubscribed(false);
1711

1812
require_once(__DIR__.'/imap_include.inc');
1913
$stream_id = imap_open($default_mailbox, $username, $password) or
2014
die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());
2115

22-
imap_getsubscribed($stream_id);
23-
imap_getsubscribed($stream_id,$default_mailbox);
2416
var_dump(imap_getsubscribed($stream_id,$default_mailbox,'ezDvfXvbvcxSerz'));
2517

2618

@@ -43,18 +35,6 @@ imap_close($stream_id);
4335
require_once('clean.inc');
4436
?>
4537
--EXPECTF--
46-
Checking with no parameters
47-
48-
Warning: imap_getsubscribed() expects exactly 3 parameters, 0 given in %s on line %d
49-
Checking with incorrect parameter type
50-
51-
Warning: imap_getsubscribed() expects exactly 3 parameters, 1 given in %s on line %d
52-
53-
Warning: imap_getsubscribed() expects exactly 3 parameters, 1 given in %s on line %d
54-
55-
Warning: imap_getsubscribed() expects exactly 3 parameters, 1 given in %s on line %d
56-
57-
Warning: imap_getsubscribed() expects exactly 3 parameters, 2 given in %s on line %d
5838
bool(false)
5939
Checking OK
6040
bool(true)

ext/imap/tests/imap_list_basic.phpt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,11 @@ require_once(__DIR__.'/skipif.inc');
88
?>
99
--FILE--
1010
<?php
11-
echo "Checking with no parameters\n";
12-
imap_list();
13-
14-
echo "Checking with incorrect parameter type\n";
15-
imap_list('');
16-
imap_list(false);
1711

1812
require_once(__DIR__.'/imap_include.inc');
1913
$stream_id = imap_open($default_mailbox, $username, $password) or
2014
die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());
2115

22-
imap_list($stream_id);
23-
imap_list($stream_id,$default_mailbox);
2416
imap_list($stream_id,$default_mailbox,'ezerz');
2517

2618

@@ -31,17 +23,5 @@ var_dump($z[0]);
3123
imap_close($stream_id);
3224
?>
3325
--EXPECTF--
34-
Checking with no parameters
35-
36-
Warning: imap_list() expects exactly 3 parameters, 0 given in %s on line %d
37-
Checking with incorrect parameter type
38-
39-
Warning: imap_list() expects exactly 3 parameters, 1 given in %s on line %d
40-
41-
Warning: imap_list() expects exactly 3 parameters, 1 given in %s on line %d
42-
43-
Warning: imap_list() expects exactly 3 parameters, 1 given in %s on line %d
44-
45-
Warning: imap_list() expects exactly 3 parameters, 2 given in %s on line %d
4626
bool(true)
4727
string(%s) "{%s}%s"

ext/imap/tests/imap_lsub_basic.phpt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,11 @@ require_once(__DIR__.'/skipif.inc');
88
?>
99
--FILE--
1010
<?php
11-
echo "Checking with no parameters\n";
12-
imap_lsub();
13-
14-
echo "Checking with incorrect parameter type\n";
15-
imap_lsub('');
16-
imap_lsub(false);
1711

1812
require_once(__DIR__.'/imap_include.inc');
1913
$stream_id = imap_open($default_mailbox, $username, $password) or
2014
die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());
2115

22-
imap_lsub($stream_id);
23-
imap_lsub($stream_id,$default_mailbox);
2416
var_dump(imap_lsub($stream_id,$default_mailbox,'ezDvfXvbvcxSerz'));
2517

2618

@@ -43,18 +35,6 @@ imap_close($stream_id);
4335
require_once('clean.inc');
4436
?>
4537
--EXPECTF--
46-
Checking with no parameters
47-
48-
Warning: imap_lsub() expects exactly 3 parameters, 0 given in %s on line %d
49-
Checking with incorrect parameter type
50-
51-
Warning: imap_lsub() expects exactly 3 parameters, 1 given in %s on line %d
52-
53-
Warning: imap_lsub() expects exactly 3 parameters, 1 given in %s on line %d
54-
55-
Warning: imap_lsub() expects exactly 3 parameters, 1 given in %s on line %d
56-
57-
Warning: imap_lsub() expects exactly 3 parameters, 2 given in %s on line %d
5838
bool(false)
5939
Checking OK
6040
bool(true)

ext/imap/tests/imap_open_error.phpt

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ require_once(__DIR__.'/skipif.inc');
99
?>
1010
--FILE--
1111
<?php
12-
echo "Checking with no parameters\n";
13-
imap_open();
14-
imap_open(false);
15-
imap_open(false, false);
16-
imap_open('');
17-
imap_open('', '');
1812

1913
echo "Checking with incorrect parameters\n" ;
2014
imap_open('', '', '');
@@ -25,17 +19,6 @@ imap_open($default_mailbox, $username, $password, NIL, -1);
2519

2620
?>
2721
--EXPECTF--
28-
Checking with no parameters
29-
30-
Warning: imap_open() expects at least 3 parameters, 0 given in %s on line %d
31-
32-
Warning: imap_open() expects at least 3 parameters, 1 given in %s on line %d
33-
34-
Warning: imap_open() expects at least 3 parameters, 2 given in %s on line %d
35-
36-
Warning: imap_open() expects at least 3 parameters, 1 given in %s on line %d
37-
38-
Warning: imap_open() expects at least 3 parameters, 2 given in %s on line %d
3922
Checking with incorrect parameters
4023

4124
Warning: imap_open(): Couldn't open stream in %s on line %d

ext/imap/tests/imap_renamemailbox_basic.phpt

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ require_once(__DIR__.'/skipif.inc');
88
?>
99
--FILE--
1010
<?php
11-
echo "Checking with no parameters\n";
12-
imap_renamemailbox();
13-
14-
echo "Checking with incorrect parameter type\n";
15-
imap_renamemailbox('');
16-
imap_renamemailbox(false);
17-
1811

1912
require_once(__DIR__.'/imap_include.inc');
2013

@@ -26,9 +19,6 @@ if (!is_resource($stream_id)) {
2619

2720
$newbox = $default_mailbox . "." . $mailbox_prefix;
2821

29-
imap_renamemailbox($stream_id, $newbox.'not');
30-
imap_renamemailbox($stream_id, $newbox);
31-
3222
//commented because of bug #49901
3323
//$ancError = error_reporting(0);
3424
//$z = imap_renamemailbox($stream_id, $newbox.'not2', $newbox.'2');
@@ -47,20 +37,8 @@ imap_close($stream_id);
4737
require_once('clean.inc');
4838
?>
4939
--EXPECTF--
50-
Checking with no parameters
51-
52-
Warning: imap_renamemailbox() expects exactly 3 parameters, 0 given in %s on line %d
53-
Checking with incorrect parameter type
54-
55-
Warning: imap_renamemailbox() expects exactly 3 parameters, 1 given in %s on line %d
56-
57-
Warning: imap_renamemailbox() expects exactly 3 parameters, 1 given in %s on line %d
5840
Create a temporary mailbox and add 1 msgs
5941
.. mailbox '{%s}%s' created
60-
61-
Warning: imap_renamemailbox() expects exactly 3 parameters, 2 given in %s on line %d
62-
63-
Warning: imap_renamemailbox() expects exactly 3 parameters, 2 given in %s on line %d
6442
Checking OK
6543
bool(true)
6644
bool(true)

0 commit comments

Comments
 (0)