Skip to content

Commit 86c7fe2

Browse files
committed
Installer test
1 parent 511108f commit 86c7fe2

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/Unit/InstallerTest.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
use PHPUnit\Framework\TestCase;
4+
use DivineOmega\HCLParser\Installer;
5+
6+
class InstallerTest extends TestCase
7+
{
8+
public function testBinariesInstallation()
9+
{
10+
foreach(glob(__DIR__.'/../../bin/*') as $file) {
11+
unlink($file);
12+
}
13+
14+
Installer::installBinaries();
15+
16+
$files = glob(__DIR__.'/../../bin/*');
17+
18+
array_walk($files, function(&$value) {
19+
$value = basename($value);
20+
});
21+
22+
$expectedFiles = ['json2hcl_v0.0.6_linux_amd64'];
23+
24+
foreach($expectedFiles as $expectedFile) {
25+
$this->assertContains($expectedFile, $files);
26+
}
27+
28+
}
29+
30+
}

0 commit comments

Comments
 (0)