-
-
Notifications
You must be signed in to change notification settings - Fork 827
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13946 from agileware/CIVICRM-1163
Replaced get_headers functions call with Guzzle HTTP request.
- Loading branch information
Showing
4 changed files
with
74 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
/** | ||
* Class CRM_Utils_Check_Component_EnvTest | ||
* @package CiviCRM | ||
* @subpackage CRM_Utils_Type | ||
* @group headless | ||
*/ | ||
class CRM_Utils_Check_Component_EnvTest extends CiviUnitTestCase { | ||
|
||
public function setUp() { | ||
parent::setUp(); | ||
} | ||
|
||
/** | ||
* File check test should fail if reached maximum timeout. | ||
* @throws \GuzzleHttp\Exception\GuzzleException | ||
*/ | ||
public function testResourceUrlCheck() { | ||
$check = new \CRM_Utils_Check_Component_Env(); | ||
$failRequest = $check->fileExists('https://civicrm.org', 0.001); | ||
$successRequest = $check->fileExists('https://civicrm.org', 0); | ||
|
||
$this->assertEquals(FALSE, $failRequest, 'Request should fail for minimum timeout.'); | ||
$this->assertEquals(TRUE, $successRequest, 'Request should not fail for infinite timeout.'); | ||
|
||
} | ||
|
||
} |