File: bug00683.phpt

package info (click to toggle)
php-mongo 1.5.7-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 11,040 kB
  • ctags: 2,802
  • sloc: ansic: 17,632; xml: 2,195; php: 1,630; pascal: 330; makefile: 52; sh: 39
file content (50 lines) | stat: -rw-r--r-- 1,960 bytes parent folder | download
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
--TEST--
Test for PHP-683: Add support for the connectTimeoutMS connection parameter.
--SKIPIF--
<?php if (version_compare(phpversion(), "5.3.0", "lt")) exit("skip setCallback and closures are 5.3+"); ?>
<?php require_once "tests/utils/standalone.inc" ?>
--FILE--
<?php
require_once "tests/utils/server.inc";

$dsn = MongoShellServer::getStandaloneInfo();

printLogs(MongoLog::ALL, MongoLog::ALL, "/(Found option.*imeout*)|Replacing/");

echo "timeout only\n";
$m = new MongoClient($dsn, array("connect" => false, "timeout" => 1));

echo "timeout and connectTimeoutMS\n";
$m = new MongoClient($dsn, array("connect" => false, "timeout" => 2, "connectTimeoutMS" => 3));

echo "connectTimeoutMS only\n";
$m = new MongoClient($dsn, array("connect" => false, "connectTimeoutMS" => 4));

echo "connectTimeoutMS and timeout\n";
$m = new MongoClient($dsn, array("connect" => false, "connectTimeoutMS" => 5, "timeout" => 6));

echo "connecttimeoutms lowercased\n";
$m = new MongoClient($dsn, array("connect" => false, "connecttimeoutms" => 7));

?>
--EXPECTF--
timeout only
- Found option 'timeout' ('connectTimeoutMS'): 1

%s: MongoClient::__construct(): The 'timeout' option is deprecated. Please use 'connectTimeoutMS' instead in %s on line %d
timeout and connectTimeoutMS
- Found option 'timeout' ('connectTimeoutMS'): 2

%s: MongoClient::__construct(): The 'timeout' option is deprecated. Please use 'connectTimeoutMS' instead in %s on line %d
- Found option 'connectTimeoutMS': 3
- Replacing previously set value for 'connectTimeoutMS' (2)
connectTimeoutMS only
- Found option 'connectTimeoutMS': 4
connectTimeoutMS and timeout
- Found option 'connectTimeoutMS': 5
- Found option 'timeout' ('connectTimeoutMS'): 6
- Replacing previously set value for 'connectTimeoutMS' (5)

%s: MongoClient::__construct(): The 'timeout' option is deprecated. Please use 'connectTimeoutMS' instead in %s on line %d
connecttimeoutms lowercased
- Found option 'connectTimeoutMS': 7