tests/Managers/DocumentManagerTest.php
/**
     * @dataProvider getBoolValues
     * @param bool $exists Indicates whether document existance is mocked in test
     */
@dataProvider getBoolValues
@param bool $exists Indicates whether document existance is mocked in test
@dataProvider getBoolValues @param bool $exists Indicates whether document existance is mocked in test
public function testExists(bool $exists)
    {
        $item = new stdClass();
        $this->documentAdapterMock
            ->method('getId')
            ->with($item)
            ->willReturn(123);
        $this->documentAdapterMock
            ->method('getIndexName')
            ->with($item)
            ->willReturn('users');
        $this->wrappedManagerMock
            ->expects($this->once())
            ->method('exists')
            ->with(
                'users',
                '_doc',
                123
            )
            ->willReturn($exists);
        $result = $this->documentManager->exists($item);
        $this->assertEquals($exists, $result);
    }
public function testExists ( bool $ exists ) { $ item = new stdClass ( ) ; $ this -> documentAdapterMock -> method ( 'getId' ) -> with ( $ item ) -> willReturn ( 123 ) ; $ this -> documentAdapterMock -> method ( 'getIndexName' ) -> with ( $ item ) -> willReturn ( 'users' ) ; $ this -> wrappedManagerMock -> expects ( $ this -> once ( ) ) -> method ( 'exists' ) -> with ( 'users' , '_doc' , 123 ) -> willReturn ( $ exists ) ; $ result = $ this -> documentManager -> exists ( $ item ) ; $ this -> assertEquals ( $ exists , $ result ) ; }
@dataProvider getBoolValues
 @param bool $exists Indicates whether document existance is mocked in test
@dataProvider getBoolValues @param bool $exists Indicates whether document existance is mocked in test