/** * Test addNoteToIssue() * * @covers ::addNoteToIssue * @test * * @return void */ public function testAddNoteToIssue() { // Test values $getResponse = 'API Response'; // Create the used mock objects $client = $this->getMockBuilder('Redmine\\Client')->disableOriginalConstructor()->getMock(); $client->expects($this->once())->method('put')->with('/issues/5.xml', $this->logicalAnd($this->stringStartsWith('<?xml version="1.0"?>' . "\n" . '<issue>'), $this->stringEndsWith('</issue>' . "\n"), $this->stringContains('<id>5</id>'), $this->stringContains('<notes>Note content</notes>')))->willReturn($getResponse); // Create the object under test $api = new Issue($client); // Perform the tests $this->assertSame($getResponse, $api->addNoteToIssue(5, 'Note content')); }