-
Notifications
You must be signed in to change notification settings - Fork 311
Issue/144 convert file tests #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This is awesome. They're even catching new bugs! I'll review this right away :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why that file isn't checked in. I'm not even sure where to get it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_large.sh
On Dec 12, 2015 2:13 PM, "Taylor Hornby" notifications@github.com wrote:
In test/unit/FileTest.php
#147 (comment):
- {
$result = File::createNewRandomKey();$this->assertInstanceOf('\Defuse\Crypto\Key', $result);- }
- public function fileToFileProvider()
- {
$data = [];
$data['wat-giagantic-duck'] = ['wat-gigantic-duck.jpg'];$data['large'] = ['large.jpg'];
if (file_exists(**DIR** . '/File/In_the_Conservatory.jpg')){// see File/get_large.sh$data['extra-large'] = ['In_the_Conservatory.jpg'];}I wonder why that file isn't checked in. I'm not even sure where to get it.
—
Reply to this email directly or view it on GitHub
https://github.com/defuse/php-encryption/pull/147/files#r47435458.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I'm an idiot... there's a comment right there telling me to look in get_large.sh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's too large for github. The file tests were originally intended for
benchmarking memory usage BTW. I welcome making these unit tests :)
On Dec 12, 2015 2:17 PM, "Taylor Hornby" notifications@github.com wrote:
In test/unit/FileTest.php
#147 (comment):
- {
$result = File::createNewRandomKey();$this->assertInstanceOf('\Defuse\Crypto\Key', $result);- }
- public function fileToFileProvider()
- {
$data = [];
$data['wat-giagantic-duck'] = ['wat-gigantic-duck.jpg'];$data['large'] = ['large.jpg'];
if (file_exists(**DIR** . '/File/In_the_Conservatory.jpg')){// see File/get_large.sh$data['extra-large'] = ['In_the_Conservatory.jpg'];}Oh I'm an idiot... there's a comment right there telling me to look in
get_large.sh.—
Reply to this email directly or view it on GitHub
https://github.com/defuse/php-encryption/pull/147/files#r47435499.
|
Looks good! |
I saw issue #144 fly by my inbox and decided to try to do it. Let me know if I've missed anything glaring; I've never looked closely at the library before.
Note that my last test method,
testFileCreateRandomKey, is failing. I strongly suspect that the method being tested (File::createNewRandomKey) is a relic that should be removed. It has a name that is identical to other code, but it doesn't function the same way. If I'm right, I could add another commit to remove those parts.