Skip to content

Commit

Permalink
Fix: Cases
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Jan 28, 2022
1 parent 613f20a commit 9311d07
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 38 deletions.
31 changes: 20 additions & 11 deletions test/Unit/JsonPointerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,31 @@ public function testFromJsonStringReturnsJsonPointer(string $value): void
public function provideValidJsonStringValue(): \Generator
{
$values = [
'array-index' => '/0',
'document' => '',
'document-root' => '/',
'property-points-to-array-element' => '/foo/0',
'property-with-escaped-forward-slash' => '/a~1b',
'property-with-escaped-tilde' => '/m~0n',
'property-with-unescaped-back-slash' => '/i\\j',
'property-with-unescaped-caret' => '/e^f',
'property-with-unescaped-double-quote' => '/k"l',
'property-with-unescaped-percent' => '/c%d',
'property-caret' => '/^',
'property-percent' => '/%',
'property-pipe' => '/|',
'property-with-pipe' => '/foo|bar',
'property-quote-single' => "/foo'bar",
'property-quote-double' => '/foo"bar',
'property-quote-double' => '/"',
'property-quote-single' => "/'",
'property-slash-backward' => '/\\',
'property-slash-forward-escaped' => '/~1',
'property-space' => '/ ',
'property-text' => '/foo',
'property-tilde-escaped' => '/~0',
'property-unicode-character' => '/😆',
'property-with-array-index' => '/foo/0',
'property-with-caret' => '/foo^bar',
'property-with-percent' => '/foo%bar',
'property-with-pipe' => '/foo|bar',
'property-with-quote-double' => '/foo"bar',
'property-with-quote-single' => "/foo'bar",
'property-with-slash-backward' => '/foo\\bar',
'property-with-slash-forward-escaped' => '/foo~1bar',
'property-with-tilde-escaped' => '/foo~0bar',
'property-with-unicode-character' => '/foo😆bar',
'property-with-word' => '/foo/bar',
'property-word' => '/foo',
];

foreach ($values as $key => $value) {
Expand Down
50 changes: 23 additions & 27 deletions test/Unit/ReferenceTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,99 +92,95 @@ public function testFromStringReturnsReferenceToken(
public function provideValueAndJsonStringValue(): \Generator
{
$values = [
'integerish-9000' => [
'array-index-9000' => [
'9000',
'9000',
],
'integerish-zero' => [
'array-index-zero' => [
'0',
'0',
],
'string-back-slash' => [
'\\',
'\\',
],
'string-caret' => [
'caret' => [
'^',
'^',
],
'string-percent' => [
'percent' => [
'%',
'%',
],
'string-pipe' => [
'pipe' => [
'|',
'|',
],
'string-quote-double' => [
'quote-double' => [
'"',
'"',
],
'string-quote-single' => [
'quote-single' => [
"'",
"'",
],
'string-slash-backward' => [
'slash-backwards' => [
'\\',
'\\',
],
'string-slash-forward' => [
'slash-forward' => [
'/',
'~1',
],
'string-space' => [
'space' => [
' ',
' ',
],
'string-word' => [
'word' => [
'foo',
'foo',
],
'string-tilde' => [
'tilde' => [
'~',
'~0',
],
'string-unicode-character' => [
'unicode-character' => [
'😆',
'😆',
],
'string-with-caret' => [
'with-caret' => [
'foo^bar',
'foo^bar',
],
'string-with-percent' => [
'with-percent' => [
'foo%bar',
'foo%bar',
],
'string-with-pipe' => [
'with-pipe' => [
'foo|bar',
'foo|bar',
],
'string-with-quote-double' => [
'with-quote-double' => [
'foo"bar',
'foo"bar',
],
'string-with-quote-single' => [
'with-quote-single' => [
"foo'bar",
"foo'bar",
],
'string-with-slash-backward' => [
'with-slash-backwards' => [
'foo\\bar',
'foo\\bar',
],
'string-with-slash-forward' => [
'with-slash-forwards' => [
'foo/bar',
'foo~1bar',
],
'string-with-space' => [
'with-space' => [
'foo bar',
'foo bar',
],
'string-with-tilde' => [
'with-tilde' => [
'foo~bar',
'foo~0bar',
],
'string-with-unicode-character' => [
'with-unicode-character' => [
'foo😆bar',
'foo😆bar',
],
Expand Down

0 comments on commit 9311d07

Please sign in to comment.