Skip to content

Commit

Permalink
Merge pull request #22 from tattersoftware/env-bug
Browse files Browse the repository at this point in the history
Bugfix Environment
  • Loading branch information
MGatner authored Sep 11, 2021
2 parents d82c1cb + 9a5a898 commit b5a0d37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Test/FirestoreTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ protected function clearFirestore()
$db = service('firebase')->firestore->database();

// Check for an emulated instance
if (defined('FIRESTORE_EMULATOR_HOST'))
if ($firestoreEmulatorHost = getenv('FIRESTORE_EMULATOR_HOST'))
{
$projectId = $this->getPrivateProperty($db, 'projectId');
$deleteUrl = 'http://' . FIRESTORE_EMULATOR_HOST . '/emulator/v1/projects/' . $projectId . '/databases/(default)/documents';
$deleteUrl = 'http://' . $firestoreEmulatorHost . '/emulator/v1/projects/' . $projectId . '/databases/(default)/documents';

single_service('curlrequest')->delete($deleteUrl);
return;
Expand Down

0 comments on commit b5a0d37

Please sign in to comment.