-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathQuickSortTest.php
More file actions
46 lines (42 loc) · 1.18 KB
/
QuickSortTest.php
File metadata and controls
46 lines (42 loc) · 1.18 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
declare(strict_types=1);
namespace PHPJava\Tests\Cases;
use PHPJava\IO\Standard\Output;
class QuickSortTest extends Base
{
protected $fixtures = [
'QuickSortTest',
];
public function testQuickSortAsc()
{
$calculatedValue = static::$initiatedJavaClasses['QuickSortTest']
->getInvoker()
->getStatic()
->getMethods()
->call(
'asc',
[-14, 5, 111, 44, 2, 9999, 99, 123, 1, -10, 33, -50]
);
$result = Output::getHeapspace();
$this->assertEquals(
file_get_contents(__DIR__ . '/templates/QuickSortAsc.txt'),
$result
);
}
public function testQuickSortDesc()
{
$calculatedValue = static::$initiatedJavaClasses['QuickSortTest']
->getInvoker()
->getStatic()
->getMethods()
->call(
'desc',
[-14, 5, 111, 44, 2, 9999, 99, 123, 1, -10, 33, -50]
);
$result = Output::getHeapspace();
$this->assertEquals(
file_get_contents(__DIR__ . '/templates/QuickSortDesc.txt'),
$result
);
}
}