From 84950aa45f2f0346283fefad6f6c93553f7144d7 Mon Sep 17 00:00:00 2001 From: peter279k Date: Thu, 22 Oct 2020 19:08:20 +0800 Subject: [PATCH] Making assert equals checking strict --- tests/ClientTest.php | 4 ++-- tests/ResourceTest.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/ClientTest.php b/tests/ClientTest.php index ebaab6c..1ab2434 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -89,12 +89,12 @@ public function testSetsCorrectAuthenticationHeader() $request->hasHeader('Content-Type') ); - $this->assertEquals( + $this->assertSame( $request->getHeader('Accept')[0], 'application/json' ); - $this->assertEquals( + $this->assertSame( $request->getHeader('Content-Type')[0], 'application/json' ); diff --git a/tests/ResourceTest.php b/tests/ResourceTest.php index c471a0d..1692b9a 100644 --- a/tests/ResourceTest.php +++ b/tests/ResourceTest.php @@ -74,7 +74,7 @@ public function testGetOne() $this->isJson($response->__toString()); // Can get data - $this->assertEquals(1, $response->id); + $this->assertSame(1, $response->id); $this->assertFalse($response->notExistingProperty); $this->assertTrue(isset($response->id)); } @@ -154,8 +154,8 @@ public function testHandlingErrors() $this->assertInstanceOf(ItemResponse::class, $response); $error =$response->getError(); - $this->assertEquals('DataConflictException', $error->exceptionType); + $this->assertSame('DataConflictException', $error->exceptionType); $this->assertObjectHasAttribute('messages', $error->exception); - $this->assertEquals('Item not Found', $error->exception->messages[0]->messageCode); + $this->assertSame('Item not Found', $error->exception->messages[0]->messageCode); } }