-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathAbstractTestCase.php
More file actions
27 lines (21 loc) · 899 Bytes
/
Copy pathAbstractTestCase.php
File metadata and controls
27 lines (21 loc) · 899 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
<?php
namespace PhpBinaryReader;
class AbstractTestCase extends \PHPUnit_Framework_TestCase
{
// Data provider for creating both File and String based binary readers.
public function binaryReaders()
{
$fileBig = __DIR__ . '/asset/testfile-big.bin';
$fileLittle = __DIR__ . '/asset/testfile-little.bin';
$dataBig = fopen($fileBig, 'rb');
$dataLittle = fopen($fileLittle, 'rb');
$brBigFile = new BinaryReader(fopen($fileBig, 'rb'), Endian::ENDIAN_BIG);
$brLittleFile = new BinaryReader(fopen($fileLittle, 'rb'), Endian::ENDIAN_LITTLE);
$brBigStr = new BinaryReader(file_get_contents($fileBig), Endian::ENDIAN_BIG);
$brLittleStr = new BinaryReader(file_get_contents($fileLittle), Endian::ENDIAN_LITTLE);
return [
[$brBigFile, $brLittleFile],
[$brBigStr, $brLittleStr],
];
}
}