コード例 #1
0
 /**
  * Test getCurrentUser()
  *
  * @covers ::getCurrentUser
  * @test
  *
  * @return void
  */
 public function testGetCurrentUserReturnsClientGetResponse()
 {
     // Test values
     $getResponse = 'API Response';
     // Create the used mock objects
     $client = $this->getMockBuilder('Redmine\\Client')->disableOriginalConstructor()->getMock();
     $client->expects($this->once())->method('get')->with('/users/current.json')->willReturn($getResponse);
     // Create the object under test
     $api = new User($client);
     // Perform the tests
     $this->assertSame($getResponse, $api->getCurrentUser());
 }