PHP Class Mongolid\DataMapper\DataMapperTest

Inheritance: extends TestCas\TestCase
Datei anzeigen Open project: leroy-merlin-br/mongolid

Protected Properties

Property Type Description
$eventService Mockery\MockInterface | Mongolid\Event\EventTriggerService

Public Methods

Method Description
eventsToBailOperations ( )
getProjections ( ) Retrieves projections that should be replaced by mapper.
getWriteConcernVariations ( )
queryValueScenarios ( )
tearDown ( )
testDatabaseOperationsShouldBailOutIfTheEventHandlerReturnsFalse ( $operation, $dbOperation, $eventName )
testPrepareProjectionShouldConvertArray ( $data, $expectation )
testPrepareProjectionShouldThrownAnException ( )
testShouldBeAbleToConstructWithSchema ( )
testShouldDelete ( $entity, $writeConcern, $shouldFireEventAfter, $expected )
testShouldGetAll ( )
testShouldGetFirstProjectingFields ( )
testShouldGetFirstTroughACacheableCursor ( )
testShouldGetFirstTroughACacheableCursorProjectingFields ( )
testShouldGetFirstWithQuery ( )
testShouldGetNullIfFirstCantFindAnything ( )
testShouldGetRawCollection ( )
testShouldGetSchemaMapper ( )
testShouldGetWithWhereQuery ( )
testShouldInsert ( $entity, $writeConcern, $shouldFireEventAfter, $expected )
testShouldInsertWithoutFiringEvents ( $entity, $writeConcern, $shouldFireEventAfter, $expected )
testShouldParseObjectToDocumentAndPutResultingIdIntoTheGivenObject ( )
testShouldPrepareQueryValue ( $value, $expectation )
testShouldSave ( $entity, $writeConcern, $shouldFireEventAfter, $expected )
testShouldUpdate ( $entity, $writeConcern, $shouldFireEventAfter, $expected )
testUpdateShouldCallInsertWhenObjectHasNoId ( $entity, $writeConcern, $shouldFireEventAfter, $expected )

Protected Methods

Method Description
expectEventNotToBeFired ( $event, $entity )
expectEventToBeFired ( $event, $entity, boolean $halt, $return = true )
getEventService ( )

Method Details

eventsToBailOperations() public method

expectEventNotToBeFired() protected method

protected expectEventNotToBeFired ( $event, $entity )

expectEventToBeFired() protected method

protected expectEventToBeFired ( $event, $entity, boolean $halt, $return = true )
$halt boolean

getEventService() protected method

protected getEventService ( )

getProjections() public method

Retrieves projections that should be replaced by mapper.
public getProjections ( )

getWriteConcernVariations() public method

queryValueScenarios() public method

public queryValueScenarios ( )

tearDown() public method

public tearDown ( )

testDatabaseOperationsShouldBailOutIfTheEventHandlerReturnsFalse() public method

public testDatabaseOperationsShouldBailOutIfTheEventHandlerReturnsFalse ( $operation, $dbOperation, $eventName )

testPrepareProjectionShouldConvertArray() public method

public testPrepareProjectionShouldConvertArray ( $data, $expectation )

testPrepareProjectionShouldThrownAnException() public method

testShouldBeAbleToConstructWithSchema() public method

testShouldDelete() public method

public testShouldDelete ( $entity, $writeConcern, $shouldFireEventAfter, $expected )

testShouldGetAll() public method

public testShouldGetAll ( )

testShouldGetFirstProjectingFields() public method

testShouldGetFirstTroughACacheableCursor() public method

testShouldGetFirstTroughACacheableCursorProjectingFields() public method

testShouldGetFirstWithQuery() public method

testShouldGetNullIfFirstCantFindAnything() public method

testShouldGetRawCollection() public method

testShouldGetSchemaMapper() public method

testShouldGetWithWhereQuery() public method

testShouldInsert() public method

public testShouldInsert ( $entity, $writeConcern, $shouldFireEventAfter, $expected )

testShouldInsertWithoutFiringEvents() public method

public testShouldInsertWithoutFiringEvents ( $entity, $writeConcern, $shouldFireEventAfter, $expected )

testShouldParseObjectToDocumentAndPutResultingIdIntoTheGivenObject() public method

testShouldPrepareQueryValue() public method

public testShouldPrepareQueryValue ( $value, $expectation )

testShouldSave() public method

public testShouldSave ( $entity, $writeConcern, $shouldFireEventAfter, $expected )

testShouldUpdate() public method

public testShouldUpdate ( $entity, $writeConcern, $shouldFireEventAfter, $expected )

testUpdateShouldCallInsertWhenObjectHasNoId() public method

public testUpdateShouldCallInsertWhenObjectHasNoId ( $entity, $writeConcern, $shouldFireEventAfter, $expected )

Property Details

$eventService protected_oe property

protected MockInterface,Mockery|EventTriggerService,Mongolid\Event $eventService
return Mockery\MockInterface | Mongolid\Event\EventTriggerService