instance = new CreatePointInTime(); } public function testGetURIWhenIndexAndIdAreDefined(): void { // Arrange $expected = '/index/_search/point_in_time'; $this->instance->setIndex('index'); $this->instance->setId(10); // Act $result = $this->instance->getURI(); // Assert $this->assertEquals($expected, $result); } public function testGetURIWhenIndexIsDefinedAndIdIsNotDefined(): void { // Arrange $expected = '/index/_search/point_in_time'; $this->instance->setIndex('index'); // Act $result = $this->instance->getURI(); // Assert $this->assertEquals($expected, $result); } public function testGetURIWhenIndexIsNotDefined(): void { // Arrange $expected = RuntimeException::class; $expectedMessage = 'index is required for creating point-in-time'; // 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); } }