forked from ProcessMaker/processmaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildSdkTest.php
More file actions
39 lines (33 loc) · 1013 Bytes
/
BuildSdkTest.php
File metadata and controls
39 lines (33 loc) · 1013 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
namespace Tests\Sdk;
use Tests\TestCase;
use ProcessMaker\BuildSdk;
class BuildSdkTest extends TestCase
{
public function setUpSuppressOutput() : void
{
$this->setOutputCallback(function() {});
}
private function jsonFile() {
return base_path('storage/api-docs/api-docs.json');
}
public function testWithUnsupportedLanguage()
{
$builder = new BuildSdk($this->jsonFile(), '/tmp/output');
try {
$builder->setLang('foo');
$this->fail('Exception was not thrown.');
} catch(\Exception $e) {
$this->assertContains("foo language is not supported", $e->getMessage());
}
}
public function testBuildPhp()
{
$output = '/tmp/output';
$builder = new BuildSdk($this->jsonFile(), $output);
$builder->setLang('php');
$builder->run();
$userApiFile = $output . "/lib/Api/UsersApi.php";
$this->assertFileExists($userApiFile);
}
}