yxorP Documentation

CachingIteratorTest extends TestCase
in package

Table of Contents

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
dataDescription()  : string
Compatibility method as PHPUnit 9 no longer includes this method.
getUri()  : string
Return the connection URI.
provideInvalidArrayValues()  : mixed
provideInvalidDocumentValues()  : mixed
testConstructorRewinds()  : void
testCount()  : void
testCountAfterPartialIteration()  : void
testCountWithEmptySet()  : void
testIteration()  : void
testIterationWithEmptySet()  : void
testPartialIterationDoesNotExhaust()  : void
testRewindAfterPartialIteration()  : void
testTraversingGeneratorConsumesIt()  : void
testWithWrongIterator()  : void
This protects against iterators that return valid keys on invalid positions, which was the case in ext-mongodb until PHPC-1748 was fixed.
assertDeprecated()  : void
getCollectionName()  : string
Return the test collection name.
getDatabaseName()  : string
Return the test database name.
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.
wrapValuesForDataProvider()  : array<string|int, mixed>
Wrap a list of values for use as a single-argument data provider.
getTraversable()  : mixed
normalizeBSON()  : BSONDocument|BSONArray
Normalizes a BSON document or array for use with assertEquals().

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

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

provideInvalidArrayValues()

public provideInvalidArrayValues() : mixed
Return values
mixed

provideInvalidDocumentValues()

public provideInvalidDocumentValues() : mixed
Return values
mixed

testConstructorRewinds()

public testConstructorRewinds() : void
Return values
void

testCountAfterPartialIteration()

public testCountAfterPartialIteration() : void
Return values
void

testCountWithEmptySet()

public testCountWithEmptySet() : void
Return values
void

testIterationWithEmptySet()

public testIterationWithEmptySet() : void
Return values
void

testPartialIterationDoesNotExhaust()

public testPartialIterationDoesNotExhaust() : void
Return values
void

testRewindAfterPartialIteration()

public testRewindAfterPartialIteration() : void
Return values
void

testTraversingGeneratorConsumesIt()

public testTraversingGeneratorConsumesIt() : void
Return values
void

testWithWrongIterator()

This protects against iterators that return valid keys on invalid positions, which was the case in ext-mongodb until PHPC-1748 was fixed.

public testWithWrongIterator() : void
Return values
void

assertDeprecated()

protected assertDeprecated(callable $execution) : void
Parameters
$execution : callable
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

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

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>

getTraversable()

private getTraversable(mixed $items) : mixed
Parameters
$items : mixed
Return values
mixed

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
Tags
throws
InvalidArgumentException

if $bson is not an array or object

Return values
BSONDocument|BSONArray

Search results