-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathTestCase.php
45 lines (36 loc) · 1.04 KB
/
TestCase.php
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
<?php
namespace setasign\tests;
use FPDF;
use setasign\SetaFpdf\SetaFpdf;
abstract class TestCase extends \PHPUnit\Framework\TestCase
{
const tempDir = __DIR__ . DIRECTORY_SEPARATOR . 'tmp';
protected function getTempDir()
{
$directory = self::tempDir . DIRECTORY_SEPARATOR
. str_replace('\\', DIRECTORY_SEPARATOR, \get_class($this)) . DIRECTORY_SEPARATOR
. $this->getName(false);
if ($this->usesDataProvider()) {
$directory .= DIRECTORY_SEPARATOR . $this->getDataSetAsString(false);
}
return $directory;
}
/**
* @return string
*/
protected function getAssetsDir()
{
return realpath(dirname(__DIR__) . '/assets/');
}
/**
* @return TestProxy
* @throws \InvalidArgumentException
*/
public function getProxy($orientation = 'P', $unit = 'mm', $size = 'A4')
{
return new TestProxy([
new SetaFpdf($orientation, $unit, $size),
new FPDF($orientation, $unit, $size)
]);
}
}