-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
…r to add a suffix at the end
} | ||
return false; | ||
} | ||
|
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.
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]); |
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 it is needed?
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 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_
.
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.
no I mean why extension extractor returns an empty string
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 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
I don't know how it's correct to approve but we used to send 👍 |
I guess it is enough :) 2016-06-15 15:37 GMT+02:00 Andrey [email protected]:
|
in general: I used underscore method naming to be consistent with the bundle