function TemplateProjectTestBase::makePackageManagerTestApiRequest
Gets a /package-manager-test-api response.
Parameters
string $url: The package manager test API URL to fetch.
array $query_data: The query data.
3 calls to TemplateProjectTestBase::makePackageManagerTestApiRequest()
- PackageInstallTest::testPackageInstall in core/
modules/ package_manager/ tests/ src/ Build/ PackageInstallTest.php - Tests installing packages in a stage directory.
- PackageInstallTest::testSubModules in core/
modules/ package_manager/ tests/ src/ Build/ PackageInstallTest.php - Tests installing a Drupal submodule.
- PackageUpdateTest::testPackageUpdate in core/
modules/ package_manager/ tests/ src/ Build/ PackageUpdateTest.php - Tests updating packages in a stage directory.
File
-
core/
modules/ package_manager/ tests/ src/ Build/ TemplateProjectTestBase.php, line 708
Class
- TemplateProjectTestBase
- Base class for tests which create a test site from a core project template.
Namespace
Drupal\Tests\package_manager\BuildCode
protected function makePackageManagerTestApiRequest(string $url, array $query_data) : void {
$url .= '?' . http_build_query($query_data);
$this->visit($url);
$session = $this->getMink()
->getSession();
// Ensure test failures provide helpful debug output when there's a fatal
// PHP error: don't use \Behat\Mink\WebAssert::statusCodeEquals().
$message = sprintf("Error response: %s\n\nHeaders: %s\n\nServer error log: %s", $session->getPage()
->getContent(), var_export($session->getResponseHeaders(), TRUE), $this->serverErrorLog);
$this->assertSame(200, $session->getStatusCode(), $message);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.