public function LingotekApiUnitTest::testDeleteDocument in Lingotek Translation 8
Same name and namespace in other branches
- 8.2 tests/src/Unit/Remote/LingotekApiUnitTest.php \Drupal\Tests\lingotek\Unit\Remote\LingotekApiUnitTest::testDeleteDocument()
 
@covers ::deleteDocument
File
- tests/
src/ Unit/ Remote/ LingotekApiUnitTest.php, line 118  
Class
- LingotekApiUnitTest
 - @coversDefaultClass \Drupal\lingotek\Remote\LingotekApi @group lingotek @preserveGlobalState disabled
 
Namespace
Drupal\Tests\lingotek\Unit\RemoteCode
public function testDeleteDocument() {
  $response = $this
    ->getMockBuilder('\\Psr\\Http\\Message\\ResponseInterface')
    ->disableOriginalConstructor()
    ->getMock();
  $response
    ->expects($this
    ->any())
    ->method('getStatusCode')
    ->willReturn(Response::HTTP_ACCEPTED);
  $this->client
    ->expects($this
    ->at(0))
    ->method('delete')
    ->with('/api/document/fancy-document-id')
    ->will($this
    ->returnValue($response));
  $response = $this->lingotek_api
    ->deleteDocument('fancy-document-id');
  $this
    ->assertEquals($response
    ->getStatusCode(), Response::HTTP_ACCEPTED);
}