public function testVersionExceptionInConstructor() { $index = 'myIndex'; $type = 'myType'; $class = 'Elastification\\Client\\Request\\V1x\\CreateDocumentRequest'; /** @var CreateDocumentRequest $instance */ $instance = $this->requestRepositoryFactory->create($class, $index, $type, $this->serializer); $this->assertInstanceOf($class, $instance); $this->assertInstanceOf('Elastification\\Client\\Request\\RequestInterface', $instance); $this->assertSame($instance->getIndex(), $index); $this->assertSame($instance->getType(), $type); $this->assertSame($instance->getSerializer(), $this->serializer); }
/** * creates an request instance * * @param string $requestName * @param string $index * @param string $type * * @return RequestInterface * @author Daniel Wendlandt */ protected function createRequestInstance($requestName, $index, $type) { $class = $this->getClass($requestName); /** @var RequestInterface $request */ return $this->requestRepositoryFactory->create($class, $index, $type, $this->serializer); }