public function LingotekApiUnitTest::testCancelDocument in Lingotek Translation 3.7.x
Same name and namespace in other branches
- 8.2 tests/src/Unit/Remote/LingotekApiUnitTest.php \Drupal\Tests\lingotek\Unit\Remote\LingotekApiUnitTest::testCancelDocument()
- 4.0.x tests/src/Unit/Remote/LingotekApiUnitTest.php \Drupal\Tests\lingotek\Unit\Remote\LingotekApiUnitTest::testCancelDocument()
- 3.0.x tests/src/Unit/Remote/LingotekApiUnitTest.php \Drupal\Tests\lingotek\Unit\Remote\LingotekApiUnitTest::testCancelDocument()
- 3.1.x tests/src/Unit/Remote/LingotekApiUnitTest.php \Drupal\Tests\lingotek\Unit\Remote\LingotekApiUnitTest::testCancelDocument()
- 3.2.x tests/src/Unit/Remote/LingotekApiUnitTest.php \Drupal\Tests\lingotek\Unit\Remote\LingotekApiUnitTest::testCancelDocument()
- 3.3.x tests/src/Unit/Remote/LingotekApiUnitTest.php \Drupal\Tests\lingotek\Unit\Remote\LingotekApiUnitTest::testCancelDocument()
- 3.4.x tests/src/Unit/Remote/LingotekApiUnitTest.php \Drupal\Tests\lingotek\Unit\Remote\LingotekApiUnitTest::testCancelDocument()
- 3.5.x tests/src/Unit/Remote/LingotekApiUnitTest.php \Drupal\Tests\lingotek\Unit\Remote\LingotekApiUnitTest::testCancelDocument()
- 3.6.x tests/src/Unit/Remote/LingotekApiUnitTest.php \Drupal\Tests\lingotek\Unit\Remote\LingotekApiUnitTest::testCancelDocument()
- 3.8.x tests/src/Unit/Remote/LingotekApiUnitTest.php \Drupal\Tests\lingotek\Unit\Remote\LingotekApiUnitTest::testCancelDocument()
@covers ::cancelDocument
File
- tests/
src/ Unit/ Remote/ LingotekApiUnitTest.php, line 106
Class
- LingotekApiUnitTest
- @coversDefaultClass \Drupal\lingotek\Remote\LingotekApi @group lingotek @preserveGlobalState disabled
Namespace
Drupal\Tests\lingotek\Unit\RemoteCode
public function testCancelDocument() {
$response = $this
->getMockBuilder(ResponseInterface::class)
->disableOriginalConstructor()
->getMock();
$response
->expects($this
->any())
->method('getStatusCode')
->willReturn(Response::HTTP_NO_CONTENT);
$this->client
->expects($this
->at(0))
->method('post')
->with('/api/document/fancy-document-id/cancel', [
'id' => 'fancy-document-id',
'cancelled_reason' => 'CANCELLED_BY_AUTHOR',
])
->will($this
->returnValue($response));
$response = $this->lingotek_api
->cancelDocument('fancy-document-id');
$this
->assertEquals($response
->getStatusCode(), Response::HTTP_NO_CONTENT);
}