Skip to content

Commit 2b2bafc

Browse files
committed
Fixed CLI tests
1 parent 70aad4c commit 2b2bafc

File tree

2 files changed

+26
-17
lines changed

2 files changed

+26
-17
lines changed

tests/SDKTest.php

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ class SDKTest extends TestCase
3232
'supportUpload' => true,
3333
],
3434

35-
// 'cli' => [
36-
// 'class' => 'Appwrite\SDK\Language\CLI',
37-
// 'build' => [
38-
// 'printf "\nCOPY ./files /usr/local/code/files" >> tests/sdks/cli/Dockerfile',
39-
// 'cat tests/sdks/cli/Dockerfile',
40-
// 'mkdir tests/sdks/cli/files',
41-
// 'cp tests/resources/file.png tests/sdks/cli/files/',
42-
// 'docker build -t cli:latest tests/sdks/cli'
43-
// ],
44-
// 'envs' => [
45-
// 'default' => 'php tests/languages/cli/test.php',
46-
// ],
47-
// 'supportUpload' => true,
48-
// ],
35+
'cli' => [
36+
'class' => 'Appwrite\SDK\Language\CLI',
37+
'build' => [
38+
'printf "\nCOPY ./files /usr/local/code/files" >> tests/sdks/cli/Dockerfile',
39+
'cat tests/sdks/cli/Dockerfile',
40+
'mkdir tests/sdks/cli/files',
41+
'cp tests/resources/file.png tests/sdks/cli/files/',
42+
'docker build -t cli:latest tests/sdks/cli'
43+
],
44+
'envs' => [
45+
'default' => 'php tests/languages/cli/test.php',
46+
],
47+
'supportUpload' => true,
48+
],
4949

5050
'dart' => [
5151
'class' => 'Appwrite\SDK\Language\Dart',
@@ -240,6 +240,11 @@ public function testHTTPSuccess()
240240
echo "Executing: {$command}\n";
241241

242242
$output = [];
243+
244+
ob_end_clean();
245+
var_dump('Build Executing: '.$command);
246+
ob_start();
247+
243248
exec($command, $output);
244249

245250
foreach($output as $i => $row) {
@@ -255,7 +260,11 @@ public function testHTTPSuccess()
255260
echo "Running tests for the {$key} environment...\n";
256261

257262
$output = [];
258-
263+
264+
ob_end_clean();
265+
var_dump('Env Executing: '.$command);
266+
ob_start();
267+
259268
exec($command, $output);
260269

261270
foreach($output as $i => $row) {

tests/languages/cli/test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
$baseCommand = "docker run -i --rm --volume cli:/usr/local/code/app/.preferences/";
4-
$envVars = "-e endpoint=https://appwrite.io/v1 -e X-Appwrite-Project=6013fbefdfa41 -e X-Appwrite-Key=35y3h5h345 -e X-Appwrite-Locale=en-US";
4+
$envVars = "";
55

66
// Initialise the CLI
7-
$command = "${baseCommand} ${envVars} cli init";
7+
$command = "${baseCommand} ${envVars} cli init --endpoint=https://appwrite.io/v1 --project=6013fbefdfa41 --key=35y3h5h345 --locale=en-US";
88
$output = [];
99
exec($command, $output);
1010

0 commit comments

Comments
 (0)