/** * */ public function testMakeType() { $index = 'test'; $typeName = 'user:tw'; $type = $this->factory->makeType($index, $typeName); static::assertInstanceOf(Type::class, $type); static::assertEquals($index, $type->index); static::assertEquals($typeName, $type->type); }
protected function setUp() { $this->factory = new Factory(); $index = 'farm'; $typeName = 'user:tw'; /* @var Client $esClient */ $this->esClient = $esClient = Mockery::mock(Client::class); $this->type = $this->factory->makeType($index, $typeName); $this->userPersist = new GatewayUserPersist($esClient, $this->type); $this->userRepo = new ESGatewayUserRepo($this->userPersist, $this->factory); static::assertInstanceOf(ESGatewayUserRepo::class, $this->userRepo); }
/** * @param array $options * * @return ESGatewayUserRepo */ public static function buildUserRepo(array $options) { self::validateOptions($options); $factory = new Factory(); $client = $factory->makeClient($options['host'], $options['port']); $type = $factory->makeType($options['index'], $options['type']); $persist = new GatewayUserPersist($client, $type); $repo = new ESGatewayUserRepo($persist, $factory); return $repo; }
protected function setUp() { $this->factory = new Factory(); /** @var Client $client */ $this->client = $client = Mockery::mock(Client::class); $index = 'test'; $typeName = 'user:tw'; $this->type = $this->factory->makeType($index, $typeName); $this->persist = new GatewayUserPersist($client, $this->type); }