Skip to content

Commit 1c13b7f

Browse files
committed
Merge pull request #787
2 parents 0273c79 + e70c79d commit 1c13b7f

File tree

314 files changed

+1608
-918
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

314 files changed

+1608
-918
lines changed

tests/apm/bug0950-001.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
PHPC-950: Segfault killing cursor after subscriber HashTable is destroyed (no subscribers)
33
--SKIPIF--
44
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5-
<?php NEEDS('STANDALONE'); CLEANUP(STANDALONE); ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
67
--FILE--
78
<?php
89
require_once __DIR__ . "/../utils/basic.inc";
910

10-
$manager = new MongoDB\Driver\Manager(STANDALONE);
11+
$manager = new MongoDB\Driver\Manager(URI);
1112

1213
$bulk = new MongoDB\Driver\BulkWrite();
1314
$bulk->insert(['_id' => 1]);

tests/apm/bug0950-002.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
PHPC-950: Segfault killing cursor after subscriber HashTable is destroyed (one subscriber)
33
--SKIPIF--
44
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5-
<?php NEEDS('STANDALONE'); CLEANUP(STANDALONE); ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
67
--FILE--
78
<?php
89
require_once __DIR__ . "/../utils/basic.inc";
@@ -25,7 +26,7 @@ class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
2526
}
2627
}
2728

28-
$manager = new MongoDB\Driver\Manager(STANDALONE);
29+
$manager = new MongoDB\Driver\Manager(URI);
2930

3031
$bulk = new MongoDB\Driver\BulkWrite();
3132
$bulk->insert(['_id' => 1]);

tests/apm/monitoring-addSubscriber-001.phpt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
--TEST--
22
MongoDB\Driver\Monitoring\addSubscriber(): Adding one subscriber
33
--SKIPIF--
4-
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
57
--FILE--
68
<?php
79
require_once __DIR__ . "/../utils/basic.inc";
810

9-
$m = new MongoDB\Driver\Manager(STANDALONE);
11+
$m = new MongoDB\Driver\Manager(URI);
1012

1113
class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
1214
{
@@ -24,7 +26,6 @@ class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
2426
}
2527
}
2628

27-
CLEANUP( STANDALONE );
2829
$query = new MongoDB\Driver\Query( [] );
2930
$subscriber = new MySubscriber;
3031

tests/apm/monitoring-addSubscriber-002.phpt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
--TEST--
22
MongoDB\Driver\Monitoring\addSubscriber(): Adding two subscribers
33
--SKIPIF--
4-
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
57
--FILE--
68
<?php
79
require_once __DIR__ . "/../utils/basic.inc";
810

9-
$m = new MongoDB\Driver\Manager(STANDALONE);
11+
$m = new MongoDB\Driver\Manager(URI);
1012

1113
class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
1214
{
@@ -31,7 +33,6 @@ class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
3133
}
3234
}
3335

34-
CLEANUP( STANDALONE );
3536
$query = new MongoDB\Driver\Query( [] );
3637
$subscriber1 = new MySubscriber( "ONE" );
3738
$subscriber2 = new MySubscriber( "TWO" );

tests/apm/monitoring-addSubscriber-003.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
--TEST--
22
MongoDB\Driver\Monitoring\addSubscriber(): Adding one subscriber multiple times
33
--SKIPIF--
4-
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
57
--FILE--
68
<?php
79
require_once __DIR__ . "/../utils/basic.inc";
810

9-
$m = new MongoDB\Driver\Manager(STANDALONE);
11+
$m = new MongoDB\Driver\Manager(URI);
1012

1113
class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
1214
{

tests/apm/monitoring-addSubscriber-004.phpt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
--TEST--
22
MongoDB\Driver\Monitoring\addSubscriber(): Adding three subscribers
33
--SKIPIF--
4-
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
57
--FILE--
68
<?php
79
require_once __DIR__ . "/../utils/basic.inc";
810

9-
$m = new MongoDB\Driver\Manager(STANDALONE);
11+
$m = new MongoDB\Driver\Manager(URI);
1012

1113
class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
1214
{
@@ -31,7 +33,6 @@ class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
3133
}
3234
}
3335

34-
CLEANUP( STANDALONE );
3536
$query = new MongoDB\Driver\Query( [] );
3637
$subscriber1 = new MySubscriber( "ONE" );
3738
$subscriber2 = new MySubscriber( "TWO" );

tests/apm/monitoring-commandFailed-001.phpt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
--TEST--
22
MongoDB\Driver\Monitoring\CommandFailedEvent
33
--SKIPIF--
4-
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE); ?>
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
57
--FILE--
68
<?php
79
require_once __DIR__ . "/../utils/basic.inc";
810

9-
$m = new MongoDB\Driver\Manager(STANDALONE);
11+
$m = new MongoDB\Driver\Manager(URI);
1012

1113
class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
1214
{
@@ -39,7 +41,7 @@ $subscriber = new MySubscriber;
3941

4042
MongoDB\Driver\Monitoring\addSubscriber( $subscriber );
4143

42-
CLEANUP( STANDALONE );
44+
drop_collection(URI, DATABASE_NAME, COLLECTION_NAME);
4345
?>
4446
--EXPECT--
4547
started: drop

tests/apm/monitoring-commandFailed-002.phpt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
--TEST--
22
MongoDB\Driver\Monitoring\CommandFailedEvent: requestId and operationId match
33
--SKIPIF--
4-
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
57
--FILE--
68
<?php
79
require_once __DIR__ . "/../utils/basic.inc";
810

9-
$m = new MongoDB\Driver\Manager(STANDALONE);
11+
$m = new MongoDB\Driver\Manager(URI);
1012

1113
class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
1214
{
@@ -34,7 +36,7 @@ $subscriber = new MySubscriber;
3436

3537
MongoDB\Driver\Monitoring\addSubscriber( $subscriber );
3638

37-
CLEANUP( STANDALONE );
39+
drop_collection(URI, DATABASE_NAME, COLLECTION_NAME);
3840
?>
3941
--EXPECT--
4042
started: drop

tests/apm/monitoring-commandStarted-001.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
--TEST--
22
MongoDB\Driver\Monitoring\CommandStartedEvent
33
--SKIPIF--
4-
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
57
--FILE--
68
<?php
79
require_once __DIR__ . "/../utils/basic.inc";
810

9-
$m = new MongoDB\Driver\Manager(STANDALONE);
11+
$m = new MongoDB\Driver\Manager(URI);
1012

1113
class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
1214
{

tests/apm/monitoring-commandSucceeded-001.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
--TEST--
22
MongoDB\Driver\Monitoring\CommandSucceededEvent
33
--SKIPIF--
4-
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
57
--FILE--
68
<?php
79
require_once __DIR__ . "/../utils/basic.inc";
810

9-
$m = new MongoDB\Driver\Manager(STANDALONE);
11+
$m = new MongoDB\Driver\Manager(URI);
1012

1113
class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
1214
{

tests/apm/monitoring-commandSucceeded-002.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
--TEST--
22
MongoDB\Driver\Monitoring\CommandSucceededEvent: requestId and operationId match
33
--SKIPIF--
4-
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
57
--FILE--
68
<?php
79
require_once __DIR__ . "/../utils/basic.inc";
810

9-
$m = new MongoDB\Driver\Manager(STANDALONE);
11+
$m = new MongoDB\Driver\Manager(URI);
1012

1113
class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
1214
{

tests/apm/monitoring-removeSubscriber-001.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
--TEST--
22
MongoDB\Driver\Monitoring\removeSubscriber(): Removing the only subscriber
33
--SKIPIF--
4-
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
57
--FILE--
68
<?php
79
require_once __DIR__ . "/../utils/basic.inc";
810

9-
$m = new MongoDB\Driver\Manager(STANDALONE);
11+
$m = new MongoDB\Driver\Manager(URI);
1012

1113
class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
1214
{

tests/apm/monitoring-removeSubscriber-002.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
--TEST--
22
MongoDB\Driver\Monitoring\removeSubscriber(): Removing one of multiple subscribers
33
--SKIPIF--
4-
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
57
--FILE--
68
<?php
79
require_once __DIR__ . "/../utils/basic.inc";
810

9-
$m = new MongoDB\Driver\Manager(STANDALONE);
11+
$m = new MongoDB\Driver\Manager(URI);
1012

1113
class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
1214
{

tests/apm/overview.phpt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
PHPC-349: APM Specification
33
--SKIPIF--
44
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5-
<?php NEEDS('STANDALONE'); NEEDS_ATLEAST_MONGODB_VERSION(STANDALONE, "3.2"); CLEANUP(STANDALONE); ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
7+
<?php skip_if_server_version('<', '3.2'); ?>
68
--FILE--
79
<?php
810
require_once __DIR__ . "/../utils/basic.inc";
911

10-
$m = new MongoDB\Driver\Manager(STANDALONE);
12+
$m = new MongoDB\Driver\Manager(URI);
1113

1214
class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
1315
{
@@ -31,7 +33,7 @@ class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
3133
}
3234

3335
MongoDB\Driver\Monitoring\addSubscriber( new MySubscriber() );
34-
CLEANUP(STANDALONE);
36+
drop_collection(URI, DATABASE_NAME, COLLECTION_NAME);
3537

3638
$d = 12345678;
3739

tests/bson/bson-generate-document-id.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
_id should only be generated for top-level document, not embedded docs
33
--SKIPIF--
44
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5-
<?php NEEDS('STANDALONE'); CLEANUP(STANDALONE); ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
67
--FILE--
78
<?php
89
require_once __DIR__ . "/../utils/basic.inc";
910

10-
$manager = new MongoDB\Driver\Manager(STANDALONE);
11+
$manager = new MongoDB\Driver\Manager(URI);
1112

1213
$user = array(
1314
"username" => "bob",

tests/bson/bson-utcdatetime-001.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ MongoDB\BSON\UTCDateTime #001
44
date.timezone=America/Los_Angeles
55
--SKIPIF--
66
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
7-
<?php NEEDS('STANDALONE'); CLEANUP(STANDALONE); ?>
7+
<?php skip_if_not_live(); ?>
8+
<?php skip_if_not_clean(); ?>
89
--FILE--
910
<?php
1011

1112
require_once __DIR__ . "/../utils/basic.inc";
1213

13-
$manager = new MongoDB\Driver\Manager(STANDALONE);
14+
$manager = new MongoDB\Driver\Manager(URI);
1415

1516
$utcdatetime = new MongoDB\BSON\UTCDateTime("1416445411987");
1617

tests/bson/typemap-001.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
MongoDB\Driver\Cursor::setTypeMap(): Setting typemaps
33
--SKIPIF--
44
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5-
<?php NEEDS('STANDALONE'); CLEANUP(STANDALONE); ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
67
--FILE--
78
<?php
89

@@ -16,7 +17,7 @@ class MyArrayObject extends ArrayObject implements MongoDB\BSON\Unserializable
1617
}
1718
}
1819

19-
$manager = new MongoDB\Driver\Manager(STANDALONE);
20+
$manager = new MongoDB\Driver\Manager(URI);
2021

2122
$bulk = new MongoDB\Driver\BulkWrite();
2223
$bulk->insert(array('_id' => 1, 'bson_array' => array(1, 2, 3), 'bson_object' => array("string" => "keys", "for" => "ever")));

tests/bson/typemap-002.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
MongoDB\Driver\Cursor::setTypeMap(): Setting using type "object"
33
--SKIPIF--
44
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5-
<?php NEEDS('STANDALONE'); CLEANUP(STANDALONE); ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
67
--FILE--
78
<?php
89

910
require_once __DIR__ . "/../utils/basic.inc";
1011

11-
$manager = new MongoDB\Driver\Manager(STANDALONE);
12+
$manager = new MongoDB\Driver\Manager(URI);
1213

1314
$bulk = new MongoDB\Driver\BulkWrite();
1415
$bulk->insert(array('_id' => 1, 'bson_array' => array(1, 2, 3), 'bson_object' => array("string" => "keys", "for" => "ever")));

tests/bson/typemap-003.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
MongoDB\Driver\Cursor::setTypeMap(): Setting and replacing typemaps
33
--SKIPIF--
44
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5-
<?php NEEDS('STANDALONE'); CLEANUP(STANDALONE); ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
67
--FILE--
78
<?php
89

@@ -20,7 +21,7 @@ class MyProperties extends MyArrayObject
2021
{
2122
}
2223

23-
$manager = new MongoDB\Driver\Manager(STANDALONE);
24+
$manager = new MongoDB\Driver\Manager(URI);
2425

2526
$document1 = [
2627
'_id' => 1,

tests/bson/typemap-004.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
MongoDB\Driver\Cursor::setTypeMap(): Setting fieldPath typemaps for compound types with string keys
33
--SKIPIF--
44
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5-
<?php NEEDS('STANDALONE'); CLEANUP(STANDALONE); ?>
5+
<?php skip_if_not_live(); ?>
6+
<?php skip_if_not_clean(); ?>
67
--FILE--
78
<?php
89

@@ -16,7 +17,7 @@ class MyArrayObject extends ArrayObject implements MongoDB\BSON\Unserializable
1617
}
1718
}
1819

19-
$manager = new MongoDB\Driver\Manager(STANDALONE);
20+
$manager = new MongoDB\Driver\Manager(URI);
2021

2122
$document = [
2223
'_id' => 1,

0 commit comments

Comments
 (0)