-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathBase.php
More file actions
32 lines (26 loc) · 908 Bytes
/
Base.php
File metadata and controls
32 lines (26 loc) · 908 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
<?php
namespace PHPJava\Tests;
use PHPUnit\Framework\TestCase;
class Base extends TestCase
{
protected $fixtures = [];
protected $initiatedJavaClasses = [];
public function setUp(): void
{
parent::setUp();
// build fixtures
$pathRoot = __DIR__ . '/fixtures/java/';
foreach ($this->fixtures as $fixture) {
exec('javac -classpath ' . $pathRoot . ':' . $pathRoot . 'caches -encoding UTF8 ' . $pathRoot . str_replace(['../', './'], '', $fixture) . '.java -d ' . __DIR__ . '/caches');
$this->initiatedJavaClasses[$fixture] = new \PHPJava\Core\JavaClass(
new \PHPJava\Core\JavaClassFileReader(
$this->getClassName($fixture)
)
);
}
}
protected function getClassName($fixtureName)
{
return __DIR__ . '/caches/' . $fixtureName . '.class';
}
}