instance = new RefreshSearchAnalyzers(); } public function testGetURIWhenIndexAndIdAreDefined(): void { // Arrange $expected = '/_plugins/_refresh_search_analyzers/index'; $this->instance->setIndex('index'); $this->instance->setId(10); // Act $result = $this->instance->getURI(); // Assert $this->assertEquals($expected, $result); } public function testGetURIWhenIndexIsDefinedAndIdIsNotDefined(): void { // Arrange $expected = '/_plugins/_refresh_search_analyzers/index'; $this->instance->setIndex('index'); // Act $result = $this->instance->getURI(); // Assert $this->assertEquals($expected, $result); } public function testGetURIWhenIndexIsNotDefined(): void { // Arrange $expected = RuntimeException::class; $expectedMessage = 'Missing index parameter for the endpoint indices.refresh_search_analyzers'; // Assert $this->expectException($expected); $this->expectExceptionMessage($expectedMessage); // Act $this->instance->getURI(); } public function testGetMethodWhenIdIsDefined(): void { // Arrange $expected = 'POST'; $this->instance->setId(10); // Act $result = $this->instance->getMethod(); // Assert $this->assertEquals($expected, $result); } public function testGetMethodWhenIdIsNotDefined(): void { // Arrange $expected = 'POST'; // Act $result = $this->instance->getMethod(); // Assert $this->assertEquals($expected, $result); } }