Skip to content

Commit

Permalink
Remove Deubbing and Try and fix Error shown in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
seamuslee001 committed Jun 7, 2019
1 parent 05d06ce commit f8310d5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CRM/Utils/System/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ public function sendResponse(\Psr\Http\Message\ResponseInterface $response) {
else {
header('X-PHP-Response-Code: ' . $response->getStatusCode(), TRUE, $statusCode->getStatusCode());
}
CRM_Utils_System::setHeader('Content-Type', $response->getHeaderLine('Content-Type'));
CRM_Utils_System::setHttpHeader('Content-Type', $response->getHeaderLine('Content-Type'));
echo $response->getBody();
CRM_Utils_System::civiExit();
}
Expand Down
3 changes: 1 addition & 2 deletions CRM/Utils/System/WordPress.php
Original file line number Diff line number Diff line change
Expand Up @@ -877,8 +877,7 @@ public function sendResponse(\Psr\Http\Message\ResponseInterface $response) {
else {
header('X-PHP-Response-Code: ' . $response->getStatusCode(), TRUE, $statusCode->getStatusCode());
}
CRM_Utils_System::setHeader('Content-Type', $response->getHeaderLine('Content-Type'));
CRM_Core_Error::debug($response->getBody());
CRM_Utils_System::setHttpHeader('Content-Type', $response->getHeaderLine('Content-Type'));
echo $response->getBody();
CRM_Utils_System::civiExit();
}
Expand Down
2 changes: 0 additions & 2 deletions tests/phpunit/E2E/Core/AssetBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ public function testGetUrl_uncached($asset, $params, $expectedMimeType, $expecte
public function testInvalid() {
\Civi::service('asset_builder')->setCacheEnabled(FALSE);
$url = \Civi::service('asset_builder')->getUrl('invalid.json');
print_r($url);
try {
$guzzleClient = new \GuzzleHttp\Client();
$guzzleResponse = $guzzleClient->request('GET', $url, array('timeout' => 1));
Expand All @@ -171,7 +170,6 @@ public function testInvalid() {
catch (\GuzzleHttp\Exception\ClientException $e) {
$this->assertNotEmpty(preg_match(';404;', $e->getMessage()),
'Expect to find HTTP 404. Found: ' . json_encode(preg_match(';^HTTP;', $e->getMessage())));
var_dump($e->getResponse()->getBody());
$this->assertEquals('Unrecognized asset name: invalid.json', $e->getResponse()->getBody());
}
}
Expand Down

0 comments on commit f8310d5

Please sign in to comment.