public function testRefresh() { $index = 'myIndex'; $return = 'itsMe'; $type = null; $className = 'myClassName'; $request = $this->getMockBuilder('Elastification\\Client\\Request\\RequestInterface')->disableOriginalConstructor()->getMock(); $this->requestRepositoryFactory->expects($this->once())->method('create')->with($this->equalTo($className), $this->equalTo($index), $this->equalTo($type), $this->equalTo($this->serializer))->willReturn($request); $this->repositoryClassMap->expects($this->once())->method('getClassName')->with(IndexRepositoryInterface::INDEX_REFRESH)->willReturn($className); $this->client->expects($this->once())->method('send')->willReturn($return); $result = $this->indexRepository->refresh($index); $this->assertSame($return, $result); }