Skip to content

Conversation

@sethbattin
Copy link
Contributor

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.

@defuse
Copy link
Owner

defuse commented Dec 12, 2015

This is awesome. They're even catching new bugs! I'll review this right away :D

Copy link
Owner

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.

Copy link
Collaborator

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.

Copy link
Owner

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.

Copy link
Collaborator

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.

@defuse
Copy link
Owner

defuse commented Dec 12, 2015

Looks good!

defuse added a commit that referenced this pull request Dec 12, 2015
@defuse defuse merged commit 529f794 into defuse:v2.0 Dec 12, 2015
@sethbattin sethbattin deleted the issue/144_convert_file_tests branch December 12, 2015 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants