Skip to content

Commit 542d1d3

Browse files
authored
Cross-reference prose tests in session test descriptions (#1393)
* Remove redundant params in create_test_manager() calls * Use disableClientPersistence in session test requiring different clients
1 parent a237193 commit 542d1d3

File tree

6 files changed

+15
-7
lines changed

6 files changed

+15
-7
lines changed

tests/manager/manager-ctor-ssl-002.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ PHPC-1239: Passing SSL driverOptions overrides SSL options from URI
77
<?php
88
require_once __DIR__ . "/../utils/basic.inc";
99

10-
$manager = create_test_manager(URI, array(), array());
10+
$manager = create_test_manager(URI);
1111

1212
$manager->executeCommand(DATABASE_NAME, new MongoDB\Driver\Command(['ping' => 1]));
1313
?>

tests/manager/manager-startSession_error-002.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
--TEST--
22
MongoDB\Driver\Manager::startSession() snapshot and causalConsistency cannot both be true
33
--DESCRIPTION--
4-
Session spec prose test #1
5-
https://github.com/mongodb/specifications/blob/master/source/sessions/tests/README.rst#prose-tests
4+
Session spec prose test #1: Setting both snapshot and causalConsistency to true is not allowed
5+
https://github.com/mongodb/specifications/blob/master/source/sessions/tests/README.rst#setting-both-snapshot-and-causalconsistency-to-true-is-not-allowed
66
--SKIPIF--
77
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
88
<?php skip_if_not_libmongoc_crypto(); ?>

tests/session/session-001.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
--TEST--
22
MongoDB\Driver\Session spec test: Pool is LIFO
3+
--DESCRIPTION--
4+
Session spec prose test #2: Pool is LIFO
5+
https://github.com/mongodb/specifications/blob/master/source/sessions/tests/README.rst#pool-is-lifo
36
--SKIPIF--
47
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
58
<?php skip_if_not_libmongoc_crypto(); ?>

tests/session/session-002.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
--TEST--
22
MongoDB\Driver\Session spec test: $clusterTime in commands
3+
--DESCRIPTION--
4+
Session spec prose test #3: $clusterTime in commands
5+
https://github.com/mongodb/specifications/blob/master/source/sessions/tests/README.rst#clustertime-in-commands
36
--SKIPIF--
47
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
58
<?php skip_if_not_libmongoc_crypto(); ?>

tests/session/session-003.phpt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
--TEST--
22
MongoDB\Driver\Session spec test: session cannot be used for different clients
3+
--DESCRIPTION--
4+
Session spec prose test #5: Session argument is for the right client
5+
https://github.com/mongodb/specifications/blob/master/source/sessions/tests/README.rst#session-argument-is-for-the-right-client
36
--SKIPIF--
47
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
58
<?php skip_if_not_libmongoc_crypto(); ?>
@@ -8,9 +11,8 @@ MongoDB\Driver\Session spec test: session cannot be used for different clients
811
<?php
912
require_once __DIR__ . "/../utils/basic.inc";
1013

11-
// Vary heartbeatFrequencyMS to ensure each Manager gets a different client
12-
$manager = create_test_manager(URI, ['heartbeatFrequencyMS' => 60000]);
13-
$otherManager = create_test_manager(URI, ['heartbeatFrequencyMS' => 90000]);
14+
$manager = create_test_manager(URI, [], ['disableClientPersistence' => true]);
15+
$otherManager = create_test_manager(URI, [], ['disableClientPersistence' => true]);
1416

1517
// Create a session with the second Manager (associated with different client)
1618
$session = $otherManager->startSession();

tests/standalone/manager-as-singleton.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Database {
1717
private static $Instance;
1818

1919
public function __construct() {
20-
$Manager = create_test_manager(URI, array(), array());
20+
$Manager = create_test_manager(URI);
2121
$this->Database = $Manager;
2222
}
2323

0 commit comments

Comments
 (0)