BucketFunctionalTest
extends FunctionalTestCase
in package
Functional tests for the Bucket class.
Table of Contents
- $bucket : Bucket
- $chunksCollection : Collection
- $filesCollection : Collection
- $manager : Manager
- $configuredFailPoints : array<string|int, mixed>
- assertMatchesDocument() : void
- Asserts that a document has expected values for some fields.
- assertSameDocument() : void
- Asserts that a document has expected values for all fields.
- assertSameDocuments() : void
- configureFailPoint() : void
- Configure a fail point for the test.
- createTestClient() : Client
- createTestManager() : Manager
- dataDescription() : string
- Compatibility method as PHPUnit 9 no longer includes this method.
- getUri() : string
- Return the connection URI.
- provideInputDataAndExpectedChunks() : mixed
- provideInvalidArrayValues() : mixed
- provideInvalidConstructorOptions() : mixed
- provideInvalidDocumentValues() : mixed
- provideInvalidGridFSStreamValues() : mixed
- provideInvalidStreamValues() : mixed
- provideNonexistentFilenameAndRevision() : mixed
- setUp() : void
- tearDown() : void
- testConstructorOptionTypeChecks() : void
- testConstructorShouldRequireChunkSizeBytesOptionToBePositive() : void
- testDanglingOpenWritableStream() : void
- testDelete() : void
- testDeleteShouldRequireFileToExist() : void
- testDeleteStillRemovesChunksIfFileDoesNotExist() : void
- testDownloadingFileWithMissingChunk() : void
- testDownloadingFileWithUnexpectedChunkIndex() : void
- testDownloadingFileWithUnexpectedChunkSize() : void
- testDownloadToStream() : void
- testDownloadToStreamByName() : void
- testDownloadToStreamByNameFails() : void
- testDownloadToStreamByNameShouldRequireDestinationStream() : void
- testDownloadToStreamByNameShouldRequireFilenameAndRevisionToExist() : void
- testDownloadToStreamFails() : void
- testDownloadToStreamShouldRequireDestinationStream() : void
- testDownloadToStreamShouldRequireFileToExist() : void
- testDrop() : void
- testExistingIndexIsReused() : void
- testFind() : void
- testFindOne() : void
- testFindUsesTypeMap() : void
- testGetBucketNameWithCustomValue() : void
- testGetBucketNameWithDefaultValue() : void
- testGetChunksCollection() : void
- testGetChunkSizeBytesWithCustomValue() : void
- testGetChunkSizeBytesWithDefaultValue() : void
- testGetDatabaseName() : void
- testGetFileDocumentForStreamShouldRequireGridFSStreamResource() : void
- testGetFileDocumentForStreamUsesTypeMap() : void
- testGetFileDocumentForStreamWithReadableStream() : void
- testGetFileDocumentForStreamWithWritableStream() : void
- testGetFileIdForStreamShouldRequireGridFSStreamResource() : void
- testGetFileIdForStreamUsesTypeMap() : void
- testGetFileIdForStreamWithReadableStream() : void
- testGetFileIdForStreamWithWritableStream() : void
- testGetFilesCollection() : void
- testOpenDownloadStream() : void
- testOpenDownloadStreamAndMultipleReadOperations() : void
- testOpenDownloadStreamByName() : void
- testOpenDownloadStreamByNameShouldRequireFilenameAndRevisionToExist() : void
- testOpenDownloadStreamByNameShouldRequireFilenameToExist() : void
- testOpenDownloadStreamShouldRequireFileToExist() : void
- testOpenUploadStream() : void
- testOpenUploadStreamAndMultipleWriteOperations() : void
- testRename() : void
- testRenameShouldNotRequireFileToBeModified() : void
- testRenameShouldRequireFileToExist() : void
- testUploadFromStream() : void
- testUploadFromStreamFails() : void
- testUploadFromStreamShouldRequireSourceStream() : void
- testUploadingAnEmptyFile() : void
- testUploadingFirstFileCreatesIndexes() : void
- testValidConstructorOptions() : void
- assertCollectionCount() : void
- assertCollectionDoesNotExist() : void
- Asserts that a collection with the given name does not exist on the server.
- assertCollectionExists() : void
- Asserts that a collection with the given name exists on the server.
- assertCommandSucceeded() : void
- assertDeprecated() : void
- assertSameObjectId() : void
- assertStreamContents() : void
- Asserts that a variable is a stream containing the expected data.
- createCollection() : void
- Creates the test collection with the specified options.
- createStream() : resource
- Creates an in-memory stream with the given data.
- dropCollection() : void
- Drops the test collection with the specified options.
- getCollectionName() : string
- Return the test collection name.
- getDatabaseName() : string
- Return the test database name.
- getFeatureCompatibilityVersion() : mixed
- getInvalidArrayValues() : array<string|int, mixed>
- Return a list of invalid array values.
- getInvalidBooleanValues() : array<string|int, mixed>
- Return a list of invalid boolean values.
- getInvalidDocumentValues() : array<string|int, mixed>
- Return a list of invalid document values.
- getInvalidIntegerValues() : array<string|int, mixed>
- Return a list of invalid integer values.
- getInvalidReadConcernValues() : array<string|int, mixed>
- Return a list of invalid ReadPreference values.
- getInvalidReadPreferenceValues() : array<string|int, mixed>
- Return a list of invalid ReadPreference values.
- getInvalidSessionValues() : array<string|int, mixed>
- Return a list of invalid Session values.
- getInvalidStringValues() : array<string|int, mixed>
- Return a list of invalid string values.
- getInvalidWriteConcernValues() : array<string|int, mixed>
- Return a list of invalid WriteConcern values.
- getNamespace() : string
- Return the test namespace.
- getPrimaryServer() : mixed
- getServerStorageEngine() : mixed
- getServerVersion() : mixed
- isLoadBalanced() : mixed
- isMongos() : mixed
- isReplicaSet() : mixed
- isServerless() : bool
- Return whether serverless (i.e. proxy as mongos) is being utilized.
- isShardedCluster() : mixed
- isShardedClusterUsingReplicasets() : mixed
- skipIfCausalConsistencyIsNotSupported() : void
- skipIfChangeStreamIsNotSupported() : void
- skipIfClientSideEncryptionIsNotSupported() : void
- skipIfGeoHaystackIndexIsNotSupported() : void
- skipIfTransactionsAreNotSupported() : void
- wrapValuesForDataProvider() : array<string|int, mixed>
- Wrap a list of values for use as a single-argument data provider.
- appendAuthenticationOptions() : array<string|int, mixed>
- appendServerApiOption() : array<string|int, mixed>
- assertIndexExists() : void
- Asserts that an index with the given name exists for the collection.
- assertIndexNotExists() : void
- Asserts that an index with the given name does not exist for the collection.
- disableFailPoints() : void
- Disables any fail points that were configured earlier in the test.
- getInvalidStreamValues() : array<string|int, mixed>
- Return a list of invalid stream values.
- getModuleInfo() : string|null
- isFailCommandEnabled() : bool
- Checks if the failCommand command is enabled by checking the enableTestCommands parameter
- isFailCommandSupported() : bool
- Checks if the failCommand command is supported on this server version
- normalizeBSON() : BSONDocument|BSONArray
- Normalizes a BSON document or array for use with assertEquals().
Properties
$bucket
protected
Bucket
$bucket
$chunksCollection
protected
Collection
$chunksCollection
$filesCollection
protected
Collection
$filesCollection
$manager
protected
Manager
$manager
$configuredFailPoints
private
array<string|int, mixed>
$configuredFailPoints
= []
Methods
assertMatchesDocument()
Asserts that a document has expected values for some fields.
public
assertMatchesDocument(array<string|int, mixed>|object $expectedDocument, array<string|int, mixed>|object $actualDocument) : void
Only fields in the expected document will be checked. The actual document may contain additional fields.
Parameters
- $expectedDocument : array<string|int, mixed>|object
- $actualDocument : array<string|int, mixed>|object
Return values
void —assertSameDocument()
Asserts that a document has expected values for all fields.
public
assertSameDocument(array<string|int, mixed>|object $expectedDocument, array<string|int, mixed>|object $actualDocument) : void
The actual document will be compared directly with the expected document and may not contain extra fields.
Parameters
- $expectedDocument : array<string|int, mixed>|object
- $actualDocument : array<string|int, mixed>|object
Return values
void —assertSameDocuments()
public
assertSameDocuments(array<string|int, mixed> $expectedDocuments, mixed $actualDocuments) : void
Parameters
- $expectedDocuments : array<string|int, mixed>
- $actualDocuments : mixed
Return values
void —configureFailPoint()
Configure a fail point for the test.
public
configureFailPoint(array<string|int, mixed>|stdClass $command[, Server|null $server = null ]) : void
The fail point will automatically be disabled during tearDown() to avoid affecting a subsequent test.
Parameters
- $command : array<string|int, mixed>|stdClass
-
configureFailPoint command document
- $server : Server|null = null
Tags
Return values
void —createTestClient()
public
static createTestClient([string|null $uri = null ][, array<string|int, mixed> $options = [] ][, array<string|int, mixed> $driverOptions = [] ]) : Client
Parameters
- $uri : string|null = null
- $options : array<string|int, mixed> = []
- $driverOptions : array<string|int, mixed> = []
Return values
Client —createTestManager()
public
static createTestManager([string|null $uri = null ][, array<string|int, mixed> $options = [] ][, array<string|int, mixed> $driverOptions = [] ]) : Manager
Parameters
- $uri : string|null = null
- $options : array<string|int, mixed> = []
- $driverOptions : array<string|int, mixed> = []
Return values
Manager —dataDescription()
Compatibility method as PHPUnit 9 no longer includes this method.
public
dataDescription() : string
Return values
string —getUri()
Return the connection URI.
public
static getUri() : string
Return values
string —provideInputDataAndExpectedChunks()
public
provideInputDataAndExpectedChunks() : mixed
Return values
mixed —provideInvalidArrayValues()
public
provideInvalidArrayValues() : mixed
Return values
mixed —provideInvalidConstructorOptions()
public
provideInvalidConstructorOptions() : mixed
Return values
mixed —provideInvalidDocumentValues()
public
provideInvalidDocumentValues() : mixed
Return values
mixed —provideInvalidGridFSStreamValues()
public
provideInvalidGridFSStreamValues() : mixed
Return values
mixed —provideInvalidStreamValues()
public
provideInvalidStreamValues() : mixed
Return values
mixed —provideNonexistentFilenameAndRevision()
public
provideNonexistentFilenameAndRevision() : mixed
Return values
mixed —setUp()
public
setUp() : void
Return values
void —tearDown()
public
tearDown() : void
Return values
void —testConstructorOptionTypeChecks()
public
testConstructorOptionTypeChecks(array<string|int, mixed> $options) : void
Parameters
- $options : array<string|int, mixed>
Tags
Return values
void —testConstructorShouldRequireChunkSizeBytesOptionToBePositive()
public
testConstructorShouldRequireChunkSizeBytesOptionToBePositive() : void
Return values
void —testDanglingOpenWritableStream()
public
testDanglingOpenWritableStream() : void
Return values
void —testDelete()
public
testDelete(mixed $input, mixed $expectedChunks) : void
Parameters
- $input : mixed
- $expectedChunks : mixed
Tags
Return values
void —testDeleteShouldRequireFileToExist()
public
testDeleteShouldRequireFileToExist() : void
Return values
void —testDeleteStillRemovesChunksIfFileDoesNotExist()
public
testDeleteStillRemovesChunksIfFileDoesNotExist(mixed $input, mixed $expectedChunks) : void
Parameters
- $input : mixed
- $expectedChunks : mixed
Tags
Return values
void —testDownloadingFileWithMissingChunk()
public
testDownloadingFileWithMissingChunk() : void
Return values
void —testDownloadingFileWithUnexpectedChunkIndex()
public
testDownloadingFileWithUnexpectedChunkIndex() : void
Return values
void —testDownloadingFileWithUnexpectedChunkSize()
public
testDownloadingFileWithUnexpectedChunkSize() : void
Return values
void —testDownloadToStream()
public
testDownloadToStream(mixed $input) : void
Parameters
- $input : mixed
Tags
Return values
void —testDownloadToStreamByName()
public
testDownloadToStreamByName() : void
Return values
void —testDownloadToStreamByNameFails()
public
testDownloadToStreamByNameFails() : void
Return values
void —testDownloadToStreamByNameShouldRequireDestinationStream()
public
testDownloadToStreamByNameShouldRequireDestinationStream(mixed $destination) : void
Parameters
- $destination : mixed
Tags
Return values
void —testDownloadToStreamByNameShouldRequireFilenameAndRevisionToExist()
public
testDownloadToStreamByNameShouldRequireFilenameAndRevisionToExist(mixed $filename, mixed $revision) : void
Parameters
- $filename : mixed
- $revision : mixed
Tags
Return values
void —testDownloadToStreamFails()
public
testDownloadToStreamFails() : void
Return values
void —testDownloadToStreamShouldRequireDestinationStream()
public
testDownloadToStreamShouldRequireDestinationStream(mixed $destination) : void
Parameters
- $destination : mixed
Tags
Return values
void —testDownloadToStreamShouldRequireFileToExist()
public
testDownloadToStreamShouldRequireFileToExist() : void
Return values
void —testDrop()
public
testDrop() : void
Return values
void —testExistingIndexIsReused()
public
testExistingIndexIsReused() : void
Return values
void —testFind()
public
testFind() : void
Return values
void —testFindOne()
public
testFindOne() : void
Return values
void —testFindUsesTypeMap()
public
testFindUsesTypeMap() : void
Return values
void —testGetBucketNameWithCustomValue()
public
testGetBucketNameWithCustomValue() : void
Return values
void —testGetBucketNameWithDefaultValue()
public
testGetBucketNameWithDefaultValue() : void
Return values
void —testGetChunksCollection()
public
testGetChunksCollection() : void
Return values
void —testGetChunkSizeBytesWithCustomValue()
public
testGetChunkSizeBytesWithCustomValue() : void
Return values
void —testGetChunkSizeBytesWithDefaultValue()
public
testGetChunkSizeBytesWithDefaultValue() : void
Return values
void —testGetDatabaseName()
public
testGetDatabaseName() : void
Return values
void —testGetFileDocumentForStreamShouldRequireGridFSStreamResource()
public
testGetFileDocumentForStreamShouldRequireGridFSStreamResource(mixed $stream) : void
Parameters
- $stream : mixed
Tags
Return values
void —testGetFileDocumentForStreamUsesTypeMap()
public
testGetFileDocumentForStreamUsesTypeMap() : void
Return values
void —testGetFileDocumentForStreamWithReadableStream()
public
testGetFileDocumentForStreamWithReadableStream() : void
Return values
void —testGetFileDocumentForStreamWithWritableStream()
public
testGetFileDocumentForStreamWithWritableStream() : void
Return values
void —testGetFileIdForStreamShouldRequireGridFSStreamResource()
public
testGetFileIdForStreamShouldRequireGridFSStreamResource(mixed $stream) : void
Parameters
- $stream : mixed
Tags
Return values
void —testGetFileIdForStreamUsesTypeMap()
public
testGetFileIdForStreamUsesTypeMap() : void
Return values
void —testGetFileIdForStreamWithReadableStream()
public
testGetFileIdForStreamWithReadableStream() : void
Return values
void —testGetFileIdForStreamWithWritableStream()
public
testGetFileIdForStreamWithWritableStream() : void
Return values
void —testGetFilesCollection()
public
testGetFilesCollection() : void
Return values
void —testOpenDownloadStream()
public
testOpenDownloadStream(mixed $input) : void
Parameters
- $input : mixed
Tags
Return values
void —testOpenDownloadStreamAndMultipleReadOperations()
public
testOpenDownloadStreamAndMultipleReadOperations(mixed $input) : void
Parameters
- $input : mixed
Tags
Return values
void —testOpenDownloadStreamByName()
public
testOpenDownloadStreamByName() : void
Return values
void —testOpenDownloadStreamByNameShouldRequireFilenameAndRevisionToExist()
public
testOpenDownloadStreamByNameShouldRequireFilenameAndRevisionToExist(mixed $filename, mixed $revision) : void
Parameters
- $filename : mixed
- $revision : mixed
Tags
Return values
void —testOpenDownloadStreamByNameShouldRequireFilenameToExist()
public
testOpenDownloadStreamByNameShouldRequireFilenameToExist() : void
Return values
void —testOpenDownloadStreamShouldRequireFileToExist()
public
testOpenDownloadStreamShouldRequireFileToExist() : void
Return values
void —testOpenUploadStream()
public
testOpenUploadStream() : void
Return values
void —testOpenUploadStreamAndMultipleWriteOperations()
public
testOpenUploadStreamAndMultipleWriteOperations(mixed $input) : void
Parameters
- $input : mixed
Tags
Return values
void —testRename()
public
testRename() : void
Return values
void —testRenameShouldNotRequireFileToBeModified()
public
testRenameShouldNotRequireFileToBeModified() : void
Return values
void —testRenameShouldRequireFileToExist()
public
testRenameShouldRequireFileToExist() : void
Return values
void —testUploadFromStream()
public
testUploadFromStream() : void
Return values
void —testUploadFromStreamFails()
public
testUploadFromStreamFails() : void
Return values
void —testUploadFromStreamShouldRequireSourceStream()
public
testUploadFromStreamShouldRequireSourceStream(mixed $source) : void
Parameters
- $source : mixed
Tags
Return values
void —testUploadingAnEmptyFile()
public
testUploadingAnEmptyFile() : void
Return values
void —testUploadingFirstFileCreatesIndexes()
public
testUploadingFirstFileCreatesIndexes() : void
Return values
void —testValidConstructorOptions()
public
testValidConstructorOptions() : void
Tags
Return values
void —assertCollectionCount()
protected
assertCollectionCount(mixed $namespace, mixed $count) : void
Parameters
- $namespace : mixed
- $count : mixed
Return values
void —assertCollectionDoesNotExist()
Asserts that a collection with the given name does not exist on the server.
protected
assertCollectionDoesNotExist(string $collectionName[, string|null $databaseName = null ]) : void
$databaseName defaults to TestCase::getDatabaseName() if unspecified.
Parameters
- $collectionName : string
- $databaseName : string|null = null
Return values
void —assertCollectionExists()
Asserts that a collection with the given name exists on the server.
protected
assertCollectionExists(string $collectionName[, string|null $databaseName = null ][, callable|null $callback = null ]) : void
$databaseName defaults to TestCase::getDatabaseName() if unspecified. An optional $callback may be provided, which should take a CollectionInfo argument as its first and only parameter. If a CollectionInfo matching the given name is found, it will be passed to the callback, which may perform additional assertions.
Parameters
- $collectionName : string
- $databaseName : string|null = null
- $callback : callable|null = null
Return values
void —assertCommandSucceeded()
protected
assertCommandSucceeded(mixed $document) : void
Parameters
- $document : mixed
Return values
void —assertDeprecated()
protected
assertDeprecated(callable $execution) : void
Parameters
- $execution : callable
Return values
void —assertSameObjectId()
protected
assertSameObjectId(mixed $expectedObjectId, mixed $actualObjectId) : void
Parameters
- $expectedObjectId : mixed
- $actualObjectId : mixed
Return values
void —assertStreamContents()
Asserts that a variable is a stream containing the expected data.
protected
assertStreamContents(string $expectedContents, resource $stream) : void
Note: this will seek to the beginning of the stream before reading.
Parameters
- $expectedContents : string
- $stream : resource
Return values
void —createCollection()
Creates the test collection with the specified options.
protected
createCollection([array<string|int, mixed> $options = [] ]) : void
If the "writeConcern" option is not specified but is supported by the server, a majority write concern will be used. This is helpful for tests using transactions or secondary reads.
Parameters
- $options : array<string|int, mixed> = []
Return values
void —createStream()
Creates an in-memory stream with the given data.
protected
createStream([string $data = '' ]) : resource
Parameters
- $data : string = ''
Return values
resource —dropCollection()
Drops the test collection with the specified options.
protected
dropCollection([array<string|int, mixed> $options = [] ]) : void
If the "writeConcern" option is not specified but is supported by the server, a majority write concern will be used. This is helpful for tests using transactions or secondary reads.
Parameters
- $options : array<string|int, mixed> = []
Return values
void —getCollectionName()
Return the test collection name.
protected
getCollectionName() : string
Return values
string —getDatabaseName()
Return the test database name.
protected
getDatabaseName() : string
Return values
string —getFeatureCompatibilityVersion()
protected
getFeatureCompatibilityVersion([ReadPreference|null $readPreference = null ]) : mixed
Parameters
- $readPreference : ReadPreference|null = null
Return values
mixed —getInvalidArrayValues()
Return a list of invalid array values.
protected
getInvalidArrayValues([bool $includeNull = false ]) : array<string|int, mixed>
Parameters
- $includeNull : bool = false
Return values
array<string|int, mixed> —getInvalidBooleanValues()
Return a list of invalid boolean values.
protected
getInvalidBooleanValues([bool $includeNull = false ]) : array<string|int, mixed>
Parameters
- $includeNull : bool = false
Return values
array<string|int, mixed> —getInvalidDocumentValues()
Return a list of invalid document values.
protected
getInvalidDocumentValues([bool $includeNull = false ]) : array<string|int, mixed>
Parameters
- $includeNull : bool = false
Return values
array<string|int, mixed> —getInvalidIntegerValues()
Return a list of invalid integer values.
protected
getInvalidIntegerValues([bool $includeNull = false ]) : array<string|int, mixed>
Parameters
- $includeNull : bool = false
Return values
array<string|int, mixed> —getInvalidReadConcernValues()
Return a list of invalid ReadPreference values.
protected
getInvalidReadConcernValues([bool $includeNull = false ]) : array<string|int, mixed>
Parameters
- $includeNull : bool = false
Return values
array<string|int, mixed> —getInvalidReadPreferenceValues()
Return a list of invalid ReadPreference values.
protected
getInvalidReadPreferenceValues([bool $includeNull = false ]) : array<string|int, mixed>
Parameters
- $includeNull : bool = false
Return values
array<string|int, mixed> —getInvalidSessionValues()
Return a list of invalid Session values.
protected
getInvalidSessionValues([bool $includeNull = false ]) : array<string|int, mixed>
Parameters
- $includeNull : bool = false
Return values
array<string|int, mixed> —getInvalidStringValues()
Return a list of invalid string values.
protected
getInvalidStringValues([bool $includeNull = false ]) : array<string|int, mixed>
Parameters
- $includeNull : bool = false
Return values
array<string|int, mixed> —getInvalidWriteConcernValues()
Return a list of invalid WriteConcern values.
protected
getInvalidWriteConcernValues([bool $includeNull = false ]) : array<string|int, mixed>
Parameters
- $includeNull : bool = false
Return values
array<string|int, mixed> —getNamespace()
Return the test namespace.
protected
getNamespace() : string
Return values
string —getPrimaryServer()
protected
getPrimaryServer() : mixed
Return values
mixed —getServerStorageEngine()
protected
getServerStorageEngine([ReadPreference|null $readPreference = null ]) : mixed
Parameters
- $readPreference : ReadPreference|null = null
Return values
mixed —getServerVersion()
protected
getServerVersion([ReadPreference|null $readPreference = null ]) : mixed
Parameters
- $readPreference : ReadPreference|null = null
Return values
mixed —isLoadBalanced()
protected
isLoadBalanced() : mixed
Return values
mixed —isMongos()
protected
isMongos() : mixed
Return values
mixed —isReplicaSet()
protected
isReplicaSet() : mixed
Return values
mixed —isServerless()
Return whether serverless (i.e. proxy as mongos) is being utilized.
protected
static isServerless() : bool
Return values
bool —isShardedCluster()
protected
isShardedCluster() : mixed
Return values
mixed —isShardedClusterUsingReplicasets()
protected
isShardedClusterUsingReplicasets() : mixed
Return values
mixed —skipIfCausalConsistencyIsNotSupported()
protected
skipIfCausalConsistencyIsNotSupported() : void
Return values
void —skipIfChangeStreamIsNotSupported()
protected
skipIfChangeStreamIsNotSupported() : void
Return values
void —skipIfClientSideEncryptionIsNotSupported()
protected
skipIfClientSideEncryptionIsNotSupported() : void
Return values
void —skipIfGeoHaystackIndexIsNotSupported()
protected
skipIfGeoHaystackIndexIsNotSupported() : void
Return values
void —skipIfTransactionsAreNotSupported()
protected
skipIfTransactionsAreNotSupported() : void
Return values
void —wrapValuesForDataProvider()
Wrap a list of values for use as a single-argument data provider.
protected
wrapValuesForDataProvider(array<string|int, mixed> $values) : array<string|int, mixed>
Parameters
- $values : array<string|int, mixed>
-
List of values
Return values
array<string|int, mixed> —appendAuthenticationOptions()
private
static appendAuthenticationOptions(array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
- $options : array<string|int, mixed>
Return values
array<string|int, mixed> —appendServerApiOption()
private
static appendServerApiOption(array<string|int, mixed> $driverOptions) : array<string|int, mixed>
Parameters
- $driverOptions : array<string|int, mixed>
Return values
array<string|int, mixed> —assertIndexExists()
Asserts that an index with the given name exists for the collection.
private
assertIndexExists(string $collectionName, string $indexName[, callable $callback = null ]) : void
An optional $callback may be provided, which should take an IndexInfo argument as its first and only parameter. If an IndexInfo matching the given name is found, it will be passed to the callback, which may perform additional assertions.
Parameters
- $collectionName : string
- $indexName : string
- $callback : callable = null
Return values
void —assertIndexNotExists()
Asserts that an index with the given name does not exist for the collection.
private
assertIndexNotExists(string $collectionName, string $indexName) : void
Parameters
- $collectionName : string
- $indexName : string
Return values
void —disableFailPoints()
Disables any fail points that were configured earlier in the test.
private
disableFailPoints() : void
This tracks fail points set via configureFailPoint() and should be called during tearDown().
Return values
void —getInvalidStreamValues()
Return a list of invalid stream values.
private
getInvalidStreamValues() : array<string|int, mixed>
Return values
array<string|int, mixed> —getModuleInfo()
private
getModuleInfo(string $row) : string|null
Parameters
- $row : string
Return values
string|null —isFailCommandEnabled()
Checks if the failCommand command is enabled by checking the enableTestCommands parameter
private
isFailCommandEnabled() : bool
Return values
bool —isFailCommandSupported()
Checks if the failCommand command is supported on this server version
private
isFailCommandSupported() : bool
Return values
bool —normalizeBSON()
Normalizes a BSON document or array for use with assertEquals().
private
normalizeBSON(array<string|int, mixed>|object $bson) : BSONDocument|BSONArray
The argument will be converted to a BSONArray or BSONDocument based on its type and keys. Document fields will be sorted alphabetically. Each value within the array or document will then be normalized recursively.
Parameters
- $bson : array<string|int, mixed>|object