Skip to content
This repository was archived by the owner on Oct 20, 2022. It is now read-only.

Check for basename to not exist #4

Merged
merged 5 commits into from
Jun 16, 2016
Merged

Conversation

llissssss
Copy link

in general: I used underscore method naming to be consistent with the bundle

}
return false;
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the class receives as an option a regex with the allowed extensions in the format:

'/(\.jpg|\.jpeg|\.gif|\.png|\.pdf)$/i'

$this->assertEquals('.gif', $extensions[2]);
$this->assertEquals('.png', $extensions[3]);
$this->assertEquals('.pdf', $extensions[4]);
$this->assertEquals('', $extensions[5]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why it is needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was actually doing tdd when writing the function, anyway will fail if
they change the regex

2016-06-15 12:34 GMT+02:00 Andrey [email protected]:

In Test/BlueImp/UploadHandlerTest.php
#4 (comment)
:

  • /**
  • *
    
  • */
    
  • public function testGetExtensionsFromRegex()
  • {
  •    $regex = '/(.jpg|.jpeg|.gif|.png|.pdf)$/i';
    
  •    $uploadHandler = new UploadHandlerMock();
    
  •    $extensions = $uploadHandler->get_accepted_extensions_from_options_regex_wrapper($regex);
    
  •    $this->assertCount(6, $extensions);
    
  •    $this->assertEquals('.jpg', $extensions[0]);
    
  •    $this->assertEquals('.jpeg', $extensions[1]);
    
  •    $this->assertEquals('.gif', $extensions[2]);
    
  •    $this->assertEquals('.png', $extensions[3]);
    
  •    $this->assertEquals('.pdf', $extensions[4]);
    
  •    $this->assertEquals('', $extensions[5]);
    

I wonder why it is needed?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/kyto-gmbh/symfony2-file-uploader-bundle/pull/4/files/f33d50be52726a83d2a3a6b8a37d73b03eeb363c#r67138272,
or mute the thread
https://github.com/notifications/unsubscribe/AB4hI9tbhPDeCwxOLJ59-k2qzOYLoBE8ks5qL9UwgaJpZM4I2K8_
.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no I mean why extension extractor returns an empty string

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh sorry, I didn't get that. Just to be safe if no extension, maybe should be handled differently though, I'll check and get back to you

@breathbath
Copy link

I don't know how it's correct to approve but we used to send 👍

@llissssss
Copy link
Author

I guess it is enough :)

2016-06-15 15:37 GMT+02:00 Andrey [email protected]:

I don't know how it's correct to approve but we used to send 👍


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AB4hIwlG_38ThNbnVhqVkdnQK8mU7n4gks5qMAAOgaJpZM4I2K8_
.

@llissssss llissssss merged commit da634c9 into master Jun 16, 2016
@luksurious luksurious deleted the check-for-basename-to-not-exist branch July 24, 2018 14:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants