Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
koriym committed Jan 11, 2025
1 parent 5e26772 commit 1b236b7
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion tests/InvokerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function testOptionsMethodBody(string $view): void
"DELETE": []
}
';
$this->assertSame($expected, $view);
$this->assertJsonStringEqualsJsonString($expected, $view);
}

public function testOptionsMethod2(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/Module/HalModuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ public function testConfigure(): void
}
';
assert($news instanceof Request);
$this->assertSame($expect, (string) $news);
$this->assertJsonStringEqualsJsonString($expect, (string) $news);
}
}
4 changes: 2 additions & 2 deletions tests/Module/ImportModuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testConfigure(): void
}
}
';
$this->assertSame($expect, (string) $news);
$this->assertJsonStringEqualsJsonString($expect, (string) $news);

$news = $resource
->get
Expand All @@ -83,6 +83,6 @@ public function testConfigure(): void
}
}
';
$this->assertSame($expect, (string) $news);
$this->assertJsonStringEqualsJsonString($expect, (string) $news);
}
}
8 changes: 4 additions & 4 deletions tests/OptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function testOptionsMethodBody(ResourceObject $ro): void
}
}
';
$this->assertSame($expected, $actual);
$this->assertJsonStringEqualsJsonString($expected, $actual);

Check failure on line 102 in tests/OptionsTest.php

View workflow job for this annotation

GitHub Actions / sa / PHPStan

Parameter #2 $actualJson of method PHPUnit\Framework\Assert::assertJsonStringEqualsJsonString() expects string, string|null given.
}

/** @return ResourceObject[][] */
Expand Down Expand Up @@ -197,7 +197,7 @@ public function testAssistedResource(ResourceObject $ro): void
}
}
';
$this->assertSame($expected, $actual);
$this->assertJsonStringEqualsJsonString($expected, $actual);

Check failure on line 200 in tests/OptionsTest.php

View workflow job for this annotation

GitHub Actions / sa / PHPStan

Parameter #2 $actualJson of method PHPUnit\Framework\Assert::assertJsonStringEqualsJsonString() expects string, string|null given.
}

public function testOptionsMethodWithJsonSchema(): void
Expand Down Expand Up @@ -244,7 +244,7 @@ public function testOptionsMethodWithJsonSchema(): void
}
}
';
$this->assertSame($expected, $actual);
$this->assertJsonStringEqualsJsonString($expected, $actual);

Check failure on line 247 in tests/OptionsTest.php

View workflow job for this annotation

GitHub Actions / sa / PHPStan

Parameter #2 $actualJson of method PHPUnit\Framework\Assert::assertJsonStringEqualsJsonString() expects string, string|null given.
}

public function testOptionsNoSchemaFile(): void
Expand All @@ -267,6 +267,6 @@ public function testOptionsNoSchemaFile(): void
}
}
';
$this->assertSame($expected, $ro->view);
$this->assertJsonStringEqualsJsonString($expected, $ro->view);

Check failure on line 270 in tests/OptionsTest.php

View workflow job for this annotation

GitHub Actions / sa / PHPStan

Parameter #2 $actualJson of method PHPUnit\Framework\Assert::assertJsonStringEqualsJsonString() expects string, string|null given.
}
}
4 changes: 2 additions & 2 deletions tests/PrettyJsonRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function testRender(): void
{
$ro = new NullResourceObject();
$ro->body = ['a' => ['b' => 'c']];
$this->assertSame('{
$this->assertJsonStringEqualsJsonString('{
"a": {
"b": "c"
}
Expand All @@ -37,7 +37,7 @@ public function testRenderWithEmbeded(): void
$resource = (new Injector(new EmbedResourceModule(new ResourceModule('FakeVendor\Sandbox')), __DIR__ . '/tmp'))->getInstance(ResourceInterface::class);
assert($resource instanceof ResourceInterface);
$ro = $resource->get('app://self/bird/embed-birds', ['id' => '1']);
$this->assertSame('{
$this->assertJsonStringEqualsJsonString('{
"birds": {
"bird1": {
"name": "chill kun"
Expand Down
10 changes: 5 additions & 5 deletions tests/Renderer/HalRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function testRender(): void
}

EOT;
$this->assertSame($expected, $data);
$this->assertJsonStringEqualsJsonString($expected, $data);
}

public function testRenderScalar(): void
Expand All @@ -71,7 +71,7 @@ public function testRenderScalar(): void
}

EOT;
$this->assertSame($expected, $data);
$this->assertJsonStringEqualsJsonString($expected, $data);
}

public function testHeader(): void
Expand Down Expand Up @@ -110,7 +110,7 @@ public function testBodyLink(): void
}

EOT;
$this->assertSame($expected, $actual);
$this->assertJsonStringEqualsJsonString($expected, $actual);
}

public function testLocationHeader(): void
Expand Down Expand Up @@ -140,7 +140,7 @@ public function testNonArrayBody(): void
}

EOT;
$this->assertSame($expected, $actual);
$this->assertJsonStringEqualsJsonString($expected, $actual);
}

public function testRenderNullBody(): void
Expand All @@ -160,7 +160,7 @@ public function testRenderNullBody(): void
}

EOT;
$this->assertSame($expected, $actual);
$this->assertJsonStringEqualsJsonString($expected, $actual);
}

public function testBodyObject(): void
Expand Down
4 changes: 2 additions & 2 deletions tests/ResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public function testHal(): void
}
}
';
$this->assertSame($expected, (string) $user);
$this->assertJsonStringEqualsJsonString($expected, (string) $user);
}

public function testConstructorHasAnotherResourceRequest(): void
Expand Down Expand Up @@ -314,7 +314,7 @@ public function testMultipleRequest(): void
}
}
';
$this->assertSame($expected, $view);
$this->assertJsonStringEqualsJsonString($expected, $view);
}

/** @covers \BEAR\Resource\Resource::options() */
Expand Down

0 comments on commit 1b236b7

Please sign in to comment.