Skip to content

Commit

Permalink
Merge pull request #23 from utopia-php/feat-di
Browse files Browse the repository at this point in the history
chore: updating versions
  • Loading branch information
christyjacob4 authored Sep 5, 2024
2 parents eb9b7ea + 5150b61 commit 673abe2
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 42 deletions.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
"require": {
"php": ">=8.0",
"adhocore/jwt": "^1.1",
"utopia-php/framework": "0.*.*",
"utopia-php/cache": "^0.10.0"
"utopia-php/framework": "1.0.*",
"utopia-php/system": "0.8.*",
"utopia-php/cache": "0.10.*"
},
"require-dev": {
"phpunit/phpunit": "^9.4",
Expand Down
212 changes: 185 additions & 27 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.9'

services:
tests:
build:
Expand All @@ -11,4 +9,4 @@ services:
environment:
- PRIVATE_KEY
- APP_IDENTIFIER
- INSTALLATION_ID
- INSTALLATION_ID
8 changes: 4 additions & 4 deletions tests/Detector/DetectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Utopia\Tests;

use PHPUnit\Framework\TestCase;
use Utopia\Http\Http;
use Utopia\Cache\Adapter\None;
use Utopia\Cache\Cache;
use Utopia\Detector\Adapter\Bun;
Expand All @@ -18,6 +17,7 @@
use Utopia\Detector\Adapter\Ruby;
use Utopia\Detector\Adapter\Swift;
use Utopia\Detector\Detector;
use Utopia\System\System;
use Utopia\VCS\Adapter\Git\GitHub;

class DetectorTest extends TestCase
Expand Down Expand Up @@ -53,9 +53,9 @@ public function detect($files, $languages): ?string
public function setUp(): void
{
$this->github = new GitHub(new Cache(new None()));
$privateKey = Http::getEnv('PRIVATE_KEY') ?? '';
$githubAppId = Http::getEnv('APP_IDENTIFIER') ?? '';
$installationId = Http::getEnv('INSTALLATION_ID') ?? '';
$privateKey = System::getEnv('PRIVATE_KEY') ?? '';
$githubAppId = System::getEnv('APP_IDENTIFIER') ?? '';
$installationId = System::getEnv('INSTALLATION_ID') ?? '';
$this->github->initializeVariables($installationId, $privateKey, $githubAppId);
}

Expand Down
8 changes: 4 additions & 4 deletions tests/VCS/Adapter/GitHubTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Utopia\Tests\VCS\Adapter;

use Utopia\Http\Http;
use Utopia\Cache\Adapter\None;
use Utopia\Cache\Cache;
use Utopia\System\System;
use Utopia\Tests\Base;
use Utopia\VCS\Adapter\Git;
use Utopia\VCS\Adapter\Git\GitHub;
Expand All @@ -19,9 +19,9 @@ protected function createVCSAdapter(): Git
public function setUp(): void
{
$this->vcsAdapter = new GitHub(new Cache(new None()));
$privateKey = Http::getEnv('PRIVATE_KEY') ?? '';
$githubAppId = Http::getEnv('APP_IDENTIFIER') ?? '';
$installationId = Http::getEnv('INSTALLATION_ID') ?? '';
$privateKey = System::getEnv('PRIVATE_KEY') ?? '';
$githubAppId = System::getEnv('APP_IDENTIFIER') ?? '';
$installationId = System::getEnv('INSTALLATION_ID') ?? '';
$this->vcsAdapter->initializeVariables($installationId, $privateKey, $githubAppId);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/VCS/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Exception;
use PHPUnit\Framework\TestCase;
use Utopia\Http\Http;
use Utopia\System\System;
use Utopia\VCS\Adapter\Git;
use Utopia\VCS\Adapter\Git\GitHub;

Expand Down Expand Up @@ -44,7 +44,7 @@ public function testGetPullRequestFromBranch(): void

public function testGetOwnerName(): void
{
$installationId = Http::getEnv('INSTALLATION_ID') ?? '';
$installationId = System::getEnv('INSTALLATION_ID') ?? '';
$owner = $this->vcsAdapter->getOwnerName($installationId);
$this->assertEquals('test-kh', $owner);
}
Expand Down

0 comments on commit 673abe2

Please sign in to comment.