summaryrefslogtreecommitdiff
path: root/ext/imap/tests/imap_renamemailbox_basic.phpt
blob: c6b1812d165b5f35d7f4bb60826adffc43ad599e (plain)
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
--TEST--
imap_renamemailbox() function : basic functionality
--CREDITS--
Olivier Doucet
--SKIPIF--
<?php
require_once(__DIR__.'/skipif.inc');
?>
--FILE--
<?php

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

$stream_id = setup_test_mailbox('', 1);

if (!is_resource($stream_id)) {
    exit("TEST FAILED: Unable to create test mailbox\n");
}

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

//commented because of bug #49901
//$ancError = error_reporting(0);
//$z = imap_renamemailbox($stream_id, $newbox.'not2', $newbox.'2');
//var_dump($z);
//error_reporting($ancError);
echo "Checking OK\n";


var_dump(imap_createmailbox($stream_id, $newbox.'.test'));
var_dump(imap_renamemailbox($stream_id, $newbox.'.test', $newbox.'.testd'));

imap_close($stream_id);
?>
--CLEAN--
<?php
require_once('clean.inc');
?>
--EXPECTF--
Create a temporary mailbox and add 1 msgs
.. mailbox '{%s}%s' created
Checking OK
bool(true)
bool(true)