mirror of
https://github.com/macintoshplus/mongo-php-driver.git
synced 2026-04-27 18:43:14 +02:00
fe9fb63267
Existing tests for single write methods were ported to executeBulkWrite() tests.
29 lines
905 B
PHP
29 lines
905 B
PHP
--TEST--
|
|
MongoDB\Driver\Manager: Invalid namespace
|
|
--SKIPIF--
|
|
<?php require __DIR__ . "/../utils/basic-skipif.inc"?>
|
|
--FILE--
|
|
<?php
|
|
require_once __DIR__ . "/../utils/basic.inc";
|
|
|
|
$manager = new MongoDB\Driver\Manager(STANDALONE);
|
|
$bulk = new MongoDB\Driver\BulkWrite;
|
|
$bulk->insert(array("my" => "value"));
|
|
|
|
echo throws(function() use($manager, $bulk) {
|
|
$manager->executeBulkWrite("database", $bulk);
|
|
}, "MongoDB\Driver\Exception\InvalidArgumentException"), "\n";
|
|
|
|
echo throws(function() use($manager) {
|
|
$manager->executeQuery("database", new MongoDB\Driver\Query(array("document "=> 1)));
|
|
}, "MongoDB\Driver\Exception\InvalidArgumentException"), "\n";
|
|
?>
|
|
===DONE===
|
|
<?php exit(0); ?>
|
|
--EXPECT--
|
|
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
|
|
Invalid namespace provided: database
|
|
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
|
|
Invalid namespace provided: database
|
|
===DONE===
|