diff --git a/README.md b/README.md index 4aa5d52..bb2d525 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ project at the moment is [tus](https://tus.io/). - [simple-uploader.js](#simple-uploader-js-driver) - [Identifiers](#identifiers) - [Session identifier](#session-identifier) + - [NOP identifier](#nop-identifier) - [Contribution](#contribution) - [License](#license) @@ -197,10 +198,16 @@ file for a specific client. Without the identifier collisions can happen. Service | Driver name ------------------------------------------|------------- [Session identifier](#session-identifier) | `session` +[NOP identifier](#nop-identifier) | `nop` ### Session identifier -This identifier uses the client session and the original file name to create an identifier for the upload file. +This identifier uses the client session and, the original file name to create an identifier for the upload file. + +### NOP identifier + +This identifier uses the original file name to create an identifier for the upload file. This does not abstract the file +identifier which can be useful for testing. ## Contribution diff --git a/src/Identifier/NopIdentifier.php b/src/Identifier/NopIdentifier.php new file mode 100644 index 0000000..1e66c96 --- /dev/null +++ b/src/Identifier/NopIdentifier.php @@ -0,0 +1,11 @@ +identifier = new NopIdentifier(); + } + + public function testGenerateIdentifier() + { + $identifier = $this->identifier->generateIdentifier('any_string'); + $this->assertEquals('any_string', $identifier); + } + + public function testUploadedFileIdentifierName() + { + $identifier = $this->identifier->generateFileIdentifier(200, 'any_filename.ext'); + $this->assertEquals('200_any_filename.ext', $identifier); + } +}