public function testSegments() { $this->createSampleData(); $result = $this->catRepository->segments(); $data = $result->getData()->getGatewayValue(); $this->assertGreaterThanOrEqual(1, $data); $this->assertSame(ES_INDEX, $data[0]['index']); }
public function testSegments() { $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(null), $this->equalTo(null), $this->equalTo($this->serializer))->willReturn($request); $this->repositoryClassMap->expects($this->once())->method('getClassName')->with(CatRepositoryInterface::CAT_SEGMENTS)->willReturn($className); $this->client->expects($this->once())->method('send')->willReturn($return); $result = $this->indexRepository->segments(); $this->assertSame($return, $result); }