Skip to content

Commit 3a651b5

Browse files
authored
Added more edge cases (#25)
* Added more edge cases * Remove test against RFC3986 * cs
1 parent 86d53df commit 3a651b5

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

phpunit.xml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11-
syntaxCheck="false"
1211
bootstrap="vendor/autoload.php"
1312
>
1413
<testsuites>

src/BaseTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ protected function buildUploadableFile($data)
101101
}
102102

103103
if (class_exists(GuzzleUploadedFile::class)) {
104-
return new GuzzleUploadedFile($data, count($data), 0);
104+
return new GuzzleUploadedFile($data, strlen($data), 0);
105105
}
106106

107107
if (class_exists(ZendUploadedFile::class)) {
108-
return new ZendUploadedFile($data, count($data), 0);
108+
return new ZendUploadedFile($data, strlen($data), 0);
109109
}
110110

111111
throw new \RuntimeException('Could not create Stream. Check your config');

src/UriIntegrationTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,29 @@ public function getFragments()
199199
[$this->createUri('http://www.foo.com#foo%20bar'), 'foo%20bar'],
200200
];
201201
}
202+
203+
public function testUriModification1()
204+
{
205+
$expected = 'https://0:0@0:1/0?0#0';
206+
$uri = $this->createUri($expected);
207+
208+
$this->assertSame($expected, (string) $uri);
209+
}
210+
211+
public function testUriModification2()
212+
{
213+
$expected = 'https://0:0@0:1/0?0#0';
214+
$uri = $this
215+
->createUri('')
216+
->withHost('0')
217+
->withPort(1)
218+
->withUserInfo('0', '0')
219+
->withScheme('https')
220+
->withPath('/0')
221+
->withQuery('0')
222+
->withFragment('0')
223+
;
224+
225+
$this->assertSame($expected, (string) $uri);
226+
}
202227
}

0 commit comments

Comments
 (0)