endpoint = new Query(); } public function testFormatIsInParamWhitelist(): void { $this->assertContains('format', $this->endpoint->getParamWhitelist()); } public function testMethodIsPost(): void { $this->assertSame('POST', $this->endpoint->getMethod()); } public function testUriIsSqlPlugin(): void { $this->assertSame('/_plugins/_sql', $this->endpoint->getURI()); } public function testFormatParamIsAllowedToSet(): void { try { $this->endpoint->setParams([ 'format' => 'json', ]); } catch (UnexpectedValueException $e) { $this->fail('The format param should be allowed to set but it was not. Format is may not whitelisted.'); } } public function testFormatParamIsJson(): void { $this->endpoint->setParams([ 'format' => 'json', ]); $params = $this->endpoint->getParams(); $this->assertSame('json', $params['format']); } }