/** * Tests for toArray(). */ public function testSpanNotQueryToArray() { $mock = $this->getMock('ONGR\\ElasticsearchDSL\\Query\\Span\\SpanQueryInterface'); $mock->expects($this->exactly(2))->method('toArray')->willReturn(['span_term' => ['key' => 'value']]); $query = new SpanNotQuery($mock, $mock); $result = ['span_not' => ['include' => ['span_term' => ['key' => 'value']], 'exclude' => ['span_term' => ['key' => 'value']]]]; $this->assertEquals($result, $query->toArray()); }
/** * Tests toArray method. */ public function testSpanNotQueryToArray() { /** @var SpanQueryInterface $mock */ $mock = $this->mock; $query = new SpanNotQuery($mock, $mock); $result = ['include' => ['span_or' => ['key' => 'value']], 'exclude' => ['span_or' => ['key' => 'value']]]; $this->assertEquals($result, $query->toArray()); }