From 6919b412670187fcc92beb9be4e97d47ec33f841 Mon Sep 17 00:00:00 2001 From: Hannes Magnusson Date: Tue, 16 Dec 2014 16:42:38 -0800 Subject: [PATCH] PHON-22: New test to verify standard authentication Note that there is a bug in Mongo Orchestration preventing this test from working properly as the user cannot be created (no "localhost exception") --- tests/connect/standalone-auth-0001.phpt | 46 +++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 tests/connect/standalone-auth-0001.phpt diff --git a/tests/connect/standalone-auth-0001.phpt b/tests/connect/standalone-auth-0001.phpt new file mode 100644 index 00000000..9acded1f --- /dev/null +++ b/tests/connect/standalone-auth-0001.phpt @@ -0,0 +1,46 @@ +--TEST-- +MongoDB\Write\Batch: #001 Variety Batch +--SKIPIF-- + + +--FILE-- +insert(array("my" => "value")); +$batch->insert(array("my" => "value", "foo" => "bar")); +$batch->insert(array("my" => "value", "foo" => "bar")); + +$batch->delete(array("my" => "value", "foo" => "bar"), array("limit" => 1)); + +$batch->update(array("foo" => "bar"), array('$set' => array("foo" => "baz")), array("limit" => 1, "upsert" => 0)); + +$retval = $mc->executeWriteBatch(NS, $batch); + +printf("Inserted: %d\n", getInsertCount($retval)); +printf("Deleted: %d\n", getDeletedCount($retval)); +printf("Updated: %d\n", getModifiedCount($retval)); +printf("Upserted: %d\n", getUpsertedCount($retval)); +foreach(getWriteErrors($retval) as $error) { + printf("WriteErrors: %", $error); +} +?> +===DONE=== + +--EXPECT-- +Inserted: 3 +Deleted: 1 +Updated: 1 +Upserted: 0 +===DONE===