Skip to content

Commit 0c193eb

Browse files
committed
Added some test cases
1 parent d0fdba4 commit 0c193eb

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
MongoDB\Driver\Manager: Connecting with unsupported compressor
3+
--SKIPIF--
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php NEEDS('STANDALONE'); ?>
6+
--FILE--
7+
<?php
8+
require_once __DIR__ . "/../utils/basic.inc";
9+
10+
ini_set('mongodb.debug', 'stdout');
11+
$manager = new MongoDB\Driver\Manager(STANDALONE, [ 'compressors' => 'zli'] );
12+
ini_set('mongodb.debug', null);
13+
?>
14+
===DONE===
15+
<?php exit(0); ?>
16+
--EXPECTF--
17+
%AWARNING > Unsupported compressor: 'zli'%A
18+
===DONE===
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
MongoDB\Driver\Manager: Connecting with invalid compressor values
3+
--SKIPIF--
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php NEEDS('STANDALONE'); ?>
6+
--FILE--
7+
<?php
8+
require_once __DIR__ . "/../utils/basic.inc";
9+
10+
echo throws(function() {
11+
$manager = new MongoDB\Driver\Manager(STANDALONE, [ 'compressors' => "foo\xFEbar"] );
12+
}, 'MongoDB\Driver\Exception\UnexpectedValueException'), "\n";
13+
?>
14+
===DONE===
15+
<?php exit(0); ?>
16+
--EXPECTF--
17+
OK: Got MongoDB\Driver\Exception\UnexpectedValueException
18+
Detected invalid UTF-8 for fieldname "compressors": %s
19+
===DONE===

0 commit comments

Comments
 (0)