->setMethods( [ 'makeSearchFieldMapping' ] )->getMock();
$mockFieldBuilder = function ( $name, $type ) {
$mockField =
->setMethods( [ 'makeSearchFieldMapping' ] )->getMock();
$mockFieldBuilder = function ( $name, $type ) {
$mockField =
$fields = $mockEngine->getSearchIndexFields();
$this->assertArrayHasKey( 'language', $fields );
$this->assertArrayHasKey( 'category', $fields );
$fields = $mockEngine->getSearchIndexFields();
$this->assertArrayHasKey( 'language', $fields );
$this->assertArrayHasKey( 'category', $fields );
$mapping = $fields['testField']->getMapping( $mockEngine );
$this->assertArrayHasKey( 'testData', $mapping );
$mapping = $fields['testField']->getMapping( $mockEngine );
$this->assertArrayHasKey( 'testData', $mapping );
$setAugmentor->expects( $this->once() )
->method( 'augmentAll' )
->willReturnCallback( function ( SearchResultSet $resultSet ) {
$setAugmentor->expects( $this->once() )
->method( 'augmentAll' )
->willReturnCallback( function ( SearchResultSet $resultSet ) {
$rowAugmentor->expects( $this->exactly( 2 ) )
->method( 'augment' )
->willReturnCallback( function ( SearchResult $result ) {
$rowAugmentor->expects( $this->exactly( 2 ) )
->method( 'augment' )
->willReturnCallback( function ( SearchResult $result ) {