-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update dependency plotly.js-dist to v2.30.1 * Update dependency axios to v1.6.8 * smtp settings fix * updating releasenotes --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
- Loading branch information
1 parent
2d08419
commit 888e604
Showing
4 changed files
with
69 additions
and
12 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -112,6 +112,62 @@ | |
); | ||
})->with(['GET', 'POST']); | ||
|
||
test('test with smtp settings missing', function ($method) { | ||
$settingsService = new SettingsService(); | ||
$settingsService->set("smtp_host", "bro"); | ||
$settingsService->set("smtp_username", "bro"); | ||
$settingsService->set("smtp_password", "bro"); | ||
$settingsService->set("smtp_secure", false); | ||
$settingsService->set("smtp_from_address", "[email protected]"); | ||
$settingsService->set("smtp_from_name", "name"); | ||
$this->twilioService->shouldReceive("client")->withArgs([])->andReturn($this->twilioClient); | ||
$this->twilioService->shouldReceive("settings")->andReturn($settingsService); | ||
$geocodingService = mock(GeocodingService::class)->makePartial(); | ||
app()->instance(SettingsService::class, instance: $settingsService); | ||
|
||
$geocodingService | ||
->shouldReceive("ping") | ||
->withArgs(["91409"]) | ||
->andReturn((object)['status' => 'OK']) | ||
->once(); | ||
app()->instance(GeocodingService::class, $geocodingService); | ||
|
||
$timezoneService = mock(TimeZoneService::class)->makePartial(); | ||
$timezoneService | ||
->shouldReceive("getTimeZoneForCoordinates") | ||
->withAnyArgs() | ||
->andReturn((object)['status' => 'OK']) | ||
->once(); | ||
app()->instance(TimeZoneService::class, $timezoneService); | ||
|
||
$this->twilioService->client()->shouldReceive('getAccountSid')->andReturn("123"); | ||
$incomingPhoneNumberContext = mock('\Twilio\Rest\Api\V2010\Account\InstanceContext'); | ||
$incomingPhoneNumberInstance= mock('\Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberInstance'); | ||
$incomingPhoneNumberInstance->voiceUrl = "http://localhost:3100/yap/index.php"; | ||
$incomingPhoneNumberContext->shouldReceive('read')->withNoArgs() | ||
->andReturn([$incomingPhoneNumberInstance])->once(); | ||
|
||
// mocking TwilioRestClient->incomingPhoneNumbers->read(); | ||
$this->twilioService->client()->incomingPhoneNumbers = $incomingPhoneNumberContext; | ||
|
||
app()->instance(TwilioService::class, $this->twilioService); | ||
|
||
$response = $this->call($method, '/upgrade-advisor.php'); | ||
$response | ||
->assertStatus(200) | ||
->assertHeader("Content-Type", "application/json") | ||
->assertJson( | ||
[ | ||
"status"=>true, | ||
"message"=>"Ready To Yap!", | ||
"warnings"=>sprintf(""), | ||
"version"=>$settingsService->version(), | ||
"db"=>100, | ||
"build"=>"local" | ||
] | ||
); | ||
})->with(['GET', 'POST']); | ||
|
||
//test('bad google maps api key', function () { | ||
// $settings = new SettingsService(); | ||
// $GLOBALS['google_maps_endpoint'] = 'https://maps.googleapis.com/maps/api/geocode/json?key=bad_key'; | ||
|