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
46 lines (37 loc) · 1.09 KB
/
BuildSdkTest.php
File metadata and controls
46 lines (37 loc) · 1.09 KB
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
40
41
42
43
44
45
46
<?php
namespace Tests\Sdk;
use ProcessMaker\BuildSdk;
use Tests\TestCase;
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()
{
$this->markTestSkipped('FOUR-6653');
$builder = new BuildSdk($this->jsonFile(), '/tmp/output');
try {
$builder->setLang('foo');
$this->fail('Exception was not thrown.');
} catch (\Exception $e) {
$this->assertStringContainsString('foo language is not supported', $e->getMessage());
}
}
public function testBuildPhp()
{
$this->markTestSkipped('FOUR-6653');
$output = '/tmp/output';
$builder = new BuildSdk($this->jsonFile(), $output);
$builder->setLang('php');
$builder->run();
$userApiFile = $output . '/lib/Api/UsersApi.php';
$this->assertFileExists($userApiFile);
}
}