public function LingotekNodeNotificationCallbackTest::testNotificationCallbackWithNoArguments in Lingotek Translation 3.6.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekNodeNotificationCallbackTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNotificationCallbackTest::testNotificationCallbackWithNoArguments()
- 4.0.x tests/src/Functional/LingotekNodeNotificationCallbackTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNotificationCallbackTest::testNotificationCallbackWithNoArguments()
- 3.0.x tests/src/Functional/LingotekNodeNotificationCallbackTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNotificationCallbackTest::testNotificationCallbackWithNoArguments()
- 3.1.x tests/src/Functional/LingotekNodeNotificationCallbackTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNotificationCallbackTest::testNotificationCallbackWithNoArguments()
- 3.2.x tests/src/Functional/LingotekNodeNotificationCallbackTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNotificationCallbackTest::testNotificationCallbackWithNoArguments()
- 3.3.x tests/src/Functional/LingotekNodeNotificationCallbackTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNotificationCallbackTest::testNotificationCallbackWithNoArguments()
- 3.4.x tests/src/Functional/LingotekNodeNotificationCallbackTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNotificationCallbackTest::testNotificationCallbackWithNoArguments()
- 3.5.x tests/src/Functional/LingotekNodeNotificationCallbackTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNotificationCallbackTest::testNotificationCallbackWithNoArguments()
- 3.7.x tests/src/Functional/LingotekNodeNotificationCallbackTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNotificationCallbackTest::testNotificationCallbackWithNoArguments()
- 3.8.x tests/src/Functional/LingotekNodeNotificationCallbackTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNotificationCallbackTest::testNotificationCallbackWithNoArguments()
Tests notification callbacks without any arguments, like in a browser.
File
- tests/
src/ Functional/ LingotekNodeNotificationCallbackTest.php, line 66
Class
- LingotekNodeNotificationCallbackTest
- Tests translating a node using the notification callback.
Namespace
Drupal\Tests\lingotek\FunctionalCode
public function testNotificationCallbackWithNoArguments() {
$assert_session = $this
->assertSession();
// Simulate the notification of an empty request.
$url = Url::fromRoute('lingotek.notify', [], [])
->setAbsolute()
->toString();
$request = $this->client
->post($url, [
'cookies' => $this->cookies,
'headers' => [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'http_errors' => FALSE,
]);
$this
->assertEquals($request
->getStatusCode(), Response::HTTP_ACCEPTED);
$this
->assertEquals('It works, but nothing to look here.', (string) $request
->getBody());
$this
->drupalGet('lingotek/notify');
$assert_session
->statusCodeEquals(Response::HTTP_ACCEPTED);
$assert_session
->responseContains('It works, but nothing to look here.');
}