-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from jwpage/use_resources
Use file resources for BinaryReader
- Loading branch information
Showing
16 changed files
with
594 additions
and
467 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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], | ||
]; | ||
} | ||
} |
Oops, something went wrong.