- 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
For a Commerce payment implementation I have a hard time to do a Post request in my automated test.
The test extends CommerceBrowserTestBase which extends BrowserTestBase.
The BrowserTestBase has a post method submitForm()
, but in this case there is no form.
The post request must be done on a Drupal route.
Now I try to bypass the BrowserTestBase and use Mink directly. This does not work.
$notify_url = $this->getUrl() . '/payment/notify/mollie_test_gateway';
$postdata = ['json' => ['id' => 'test_id']];
$session = $this->getSession();
$session->setCookie('SIMPLETEST_USER_AGENT', drupal_generate_test_ua($this->databasePrefix));
$response = $session->getDriver()->getClient()->request('POST', $notify_url, $postdata);
The $response object contains the 'site install' page.
The method that is behind te route is therefore not called.
Does someone know why and can give me a hint how to do this?
Fixed
8.3 ⚰️
simpletest.module
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.