Skip to content

Commit

Permalink
Merge pull request #283 from akrabat/update-for-new-compatibility-tests
Browse files Browse the repository at this point in the history
update for new compatibility tests
  • Loading branch information
akrabat authored Apr 10, 2023
2 parents a6f0cae + 2c1cd47 commit c75d045
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ protected function filterUserInfo(?string $info = null): string
}

$match = preg_replace_callback(
'/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=]+|%(?![A-Fa-f0-9]{2}))/u',
'/(?:[^%a-zA-Z0-9_\-\.~\pL!\$&\'\(\)\*\+,;=]+|%(?![A-Fa-f0-9]{2}))/u',
function ($match) {
return rawurlencode($match[0]);
},
Expand Down
22 changes: 20 additions & 2 deletions tests/Integration/UploadedFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,31 @@ class UploadedFileTest extends UploadedFileIntegrationTest
{
use BaseTestFactories;

protected string $tempFilename;

/**
* @return UploadedFileInterface
*/
public function createSubject()
{
$file = tempnam(sys_get_temp_dir(), 'Slim_Http_UploadedFileTest_');
$this->tempFilename = tempnam(sys_get_temp_dir(), 'Slim_Http_UploadedFileTest_');
if (!$this->tempFilename) {
throw new \RuntimeException("Unable to create temporary file");
}
file_put_contents($this->tempFilename, '12345');

return new UploadedFile(
$this->tempFilename,
basename($this->tempFilename),
'text/plain',
(int)filesize($this->tempFilename)
);
}

return new UploadedFile($file);
protected function tearDown(): void
{
if (is_file($this->tempFilename)) {
unlink($this->tempFilename);
}
}
}

0 comments on commit c75d045

Please sign in to comment.