Working on
#2870458: Convert web tests to browser tests for quickedit module →
I realized there's no direct replacement for WTB::drupalPost()
.
This got me searching through core for 'x-www-form-urlencoded' in order to see if I was missing something.
It turns out a number of tests make direct calls with curl, which is what WTB::drupalPost()
does.
For instance here's a WTB: Drupal\node\Tests\Views\NodeContextualLinksTest::renderContextualLinks()
.
And here's a BTB: Drupal\Tests\history\Functional\HistoryTest::getNodeReadTimestamps()
.
There are many outlier WTB tests awaiting conversion to BTB, and it seems that they're outliers because there's no direct conversion for drupalPost()
. And there are also many tests which are rolling their own curlExec()
in order to accomplish this goal.
Make sure all tests have a consistent way to use the Mink client's guzzle client. See HistoryTest::getHttpClient()
for an example of how this might work. http://cgit.drupalcode.org/drupal/tree/core/modules/history/tests/src/Fu...
Then tests can perform POST or other requests as needed using the client.
Add a change record about drupalPost()
, drupalPostAjaxForm()
, etc. conversions.
Follow-up to make existing tests consistent in their use of getHttpClient()
.
Fixed
8.5 ⚰️
Enhances developer experience.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.