Operation
in package
Spec test operation.
Table of Contents
- OBJECT_CLIENT = 'client'
- OBJECT_COLLECTION = 'collection'
- OBJECT_DATABASE = 'database'
- OBJECT_GRIDFS_BUCKET = 'gridfsbucket'
- OBJECT_SELECT_COLLECTION = 'selectCollection'
- OBJECT_SELECT_DATABASE = 'selectDatabase'
- OBJECT_SESSION0 = 'session0'
- OBJECT_SESSION1 = 'session1'
- OBJECT_TEST_RUNNER = 'testRunner'
- $errorExpectation : ErrorExpectation|null
- $resultExpectation : ResultExpectation|null
- $arguments : array<string|int, mixed>
- $collectionName : string|null
- $collectionOptions : array<string|int, mixed>
- $databaseName : string|null
- $databaseOptions : array<string|int, mixed>
- $name : string
- $object : string
- assert() : void
- Execute the operation and assert its outcome.
- fromChangeStreams() : mixed
- fromClientSideEncryption() : mixed
- fromCommandMonitoring() : mixed
- fromCrud() : mixed
- fromReadWriteConcern() : mixed
- fromRetryableReads() : mixed
- fromRetryableWrites() : mixed
- fromTransactions() : mixed
- __construct() : mixed
- execute() : mixed
- Executes the operation with a given context.
- executeForClient() : mixed
- Executes the client operation and return its result.
- executeForCollection() : mixed
- Executes the collection operation and return its result.
- executeForDatabase() : mixed
- Executes the database operation and return its result.
- executeForGridFSBucket() : mixed
- Executes the GridFS bucket operation and return its result.
- executeForSession() : mixed
- Executes the session operation and return its result.
- executeForTestRunner() : mixed
- fromConvenientTransactions() : Operation
- This method is exclusively used to prepare nested operations for the withTransaction session operation
- getIndexNames() : array<string|int, mixed>
- getResultAssertionType() : mixed
- getResultAssertionTypeForClient() : mixed
- getResultAssertionTypeForCollection() : mixed
- getResultAssertionTypeForDatabase() : mixed
- prepareBulkWriteRequest() : array<string|int, mixed>
- Prepares a request element for a bulkWrite operation.
Constants
OBJECT_CLIENT
public
mixed
OBJECT_CLIENT
= 'client'
OBJECT_COLLECTION
public
mixed
OBJECT_COLLECTION
= 'collection'
OBJECT_DATABASE
public
mixed
OBJECT_DATABASE
= 'database'
OBJECT_GRIDFS_BUCKET
public
mixed
OBJECT_GRIDFS_BUCKET
= 'gridfsbucket'
OBJECT_SELECT_COLLECTION
public
mixed
OBJECT_SELECT_COLLECTION
= 'selectCollection'
OBJECT_SELECT_DATABASE
public
mixed
OBJECT_SELECT_DATABASE
= 'selectDatabase'
OBJECT_SESSION0
public
mixed
OBJECT_SESSION0
= 'session0'
OBJECT_SESSION1
public
mixed
OBJECT_SESSION1
= 'session1'
OBJECT_TEST_RUNNER
public
mixed
OBJECT_TEST_RUNNER
= 'testRunner'
Properties
$errorExpectation
public
ErrorExpectation|null
$errorExpectation
$resultExpectation
public
ResultExpectation|null
$resultExpectation
$arguments
private
array<string|int, mixed>
$arguments
= []
$collectionName
private
string|null
$collectionName
$collectionOptions
private
array<string|int, mixed>
$collectionOptions
= []
$databaseName
private
string|null
$databaseName
$databaseOptions
private
array<string|int, mixed>
$databaseOptions
= []
$name
private
string
$name
$object
private
string
$object
= self::OBJECT_COLLECTION
Methods
assert()
Execute the operation and assert its outcome.
public
assert(FunctionalTestCase $test, Context $context[, bool $bubbleExceptions = false ]) : void
Parameters
- $test : FunctionalTestCase
-
Test instance
- $context : Context
-
Execution context
- $bubbleExceptions : bool = false
-
If true, any exception that was caught is rethrown
Return values
void —fromChangeStreams()
public
static fromChangeStreams(stdClass $operation) : mixed
Parameters
- $operation : stdClass
Return values
mixed —fromClientSideEncryption()
public
static fromClientSideEncryption(stdClass $operation) : mixed
Parameters
- $operation : stdClass
Return values
mixed —fromCommandMonitoring()
public
static fromCommandMonitoring(stdClass $operation) : mixed
Parameters
- $operation : stdClass
Return values
mixed —fromCrud()
public
static fromCrud(stdClass $operation) : mixed
Parameters
- $operation : stdClass
Return values
mixed —fromReadWriteConcern()
public
static fromReadWriteConcern(stdClass $operation) : mixed
Parameters
- $operation : stdClass
Return values
mixed —fromRetryableReads()
public
static fromRetryableReads(stdClass $operation) : mixed
Parameters
- $operation : stdClass
Return values
mixed —fromRetryableWrites()
public
static fromRetryableWrites(stdClass $operation, stdClass $outcome) : mixed
Parameters
- $operation : stdClass
- $outcome : stdClass
Return values
mixed —fromTransactions()
public
static fromTransactions(stdClass $operation) : mixed
Parameters
- $operation : stdClass
Return values
mixed —__construct()
private
__construct(stdClass $operation) : mixed
Parameters
- $operation : stdClass
Return values
mixed —execute()
Executes the operation with a given context.
private
execute(FunctionalTestCase $test, Context $context) : mixed
Parameters
- $test : FunctionalTestCase
- $context : Context
-
Execution context
Tags
Return values
mixed —executeForClient()
Executes the client operation and return its result.
private
executeForClient(Client $client, Context $context) : mixed
Parameters
Tags
Return values
mixed —executeForCollection()
Executes the collection operation and return its result.
private
executeForCollection(Collection $collection, Context $context) : mixed
Parameters
- $collection : Collection
- $context : Context
-
Execution context
Tags
Return values
mixed —executeForDatabase()
Executes the database operation and return its result.
private
executeForDatabase(Database $database, Context $context) : mixed
Parameters
Tags
Return values
mixed —executeForGridFSBucket()
Executes the GridFS bucket operation and return its result.
private
executeForGridFSBucket(Bucket $bucket, Context $context) : mixed
Parameters
Tags
Return values
mixed —executeForSession()
Executes the session operation and return its result.
private
executeForSession(Session $session, FunctionalTestCase $test, Context $context) : mixed
Parameters
- $session : Session
- $test : FunctionalTestCase
- $context : Context
-
Execution context
Tags
Return values
mixed —executeForTestRunner()
private
executeForTestRunner(FunctionalTestCase $test, Context $context) : mixed
Parameters
- $test : FunctionalTestCase
- $context : Context
Return values
mixed —fromConvenientTransactions()
This method is exclusively used to prepare nested operations for the withTransaction session operation
private
static fromConvenientTransactions(stdClass $operation) : Operation
Parameters
- $operation : stdClass
Return values
Operation —getIndexNames()
private
getIndexNames(Context $context, string $databaseName, string $collectionName) : array<string|int, mixed>
Parameters
- $context : Context
- $databaseName : string
- $collectionName : string
Return values
array<string|int, mixed> —getResultAssertionType()
private
getResultAssertionType() : mixed
Tags
Return values
mixed —getResultAssertionTypeForClient()
private
getResultAssertionTypeForClient() : mixed
Tags
Return values
mixed —getResultAssertionTypeForCollection()
private
getResultAssertionTypeForCollection() : mixed
Tags
Return values
mixed —getResultAssertionTypeForDatabase()
private
getResultAssertionTypeForDatabase() : mixed
Tags
Return values
mixed —prepareBulkWriteRequest()
Prepares a request element for a bulkWrite operation.
private
prepareBulkWriteRequest(stdClass $request) : array<string|int, mixed>
Parameters
- $request : stdClass