Skip to content

Commit

Permalink
Replace assertEquals by assertSame
Browse files Browse the repository at this point in the history
  • Loading branch information
lehecht committed Aug 20, 2024
1 parent 7bce163 commit a013687
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions tests/AnnotationAssistanceRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testReceiverOptional()
public function testGenerateToken()
{
$token = AnnotationAssistanceRequest::generateToken();
$this->assertEquals(64, strlen($token));
$this->assertSame(64, strlen($token));
}

public function testGetResponseLabelAttribute()
Expand All @@ -74,6 +74,6 @@ public function testGetResponseLabelAttribute()
$this->model->response_label_id = 1;
$this->assertNull($this->model->response_label);
$this->model->response_label_id = 2;
$this->assertEquals(['id' => 2, 'name' => 'my label'], $this->model->response_label);
$this->assertSame(['id' => 2, 'name' => 'my label'], $this->model->response_label);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public function testStore()
$response->assertSuccessful();

$assistanceRequest = AnnotationAssistanceRequest::first();
$this->assertEquals($annotation->id, $assistanceRequest->annotation_id);
$this->assertEquals('Hi Joe!', $assistanceRequest->request_text);
$this->assertEquals($this->editor()->id, $assistanceRequest->user_id);
$this->assertSame($annotation->id, $assistanceRequest->annotation_id);
$this->assertSame('Hi Joe!', $assistanceRequest->request_text);
$this->assertSame($this->editor()->id, $assistanceRequest->user_id);
$labels = [
[
'id' => $this->labelRoot()->id,
Expand Down Expand Up @@ -83,7 +83,7 @@ public function testStoreReceiver()
]);
$response->assertSuccessful();
$assistanceRequest = AnnotationAssistanceRequest::first();
$this->assertEquals($this->user()->id, $assistanceRequest->receiver_id);
$this->assertSame($this->user()->id, $assistanceRequest->receiver_id);
}

public function testStoreRateLimiting()
Expand Down Expand Up @@ -162,7 +162,7 @@ public function testUpdate()
])
->assertStatus(200);

$this->assertEquals('This is a stone.', $ananas->fresh()->response_text);
$this->assertSame('This is a stone.', $ananas->fresh()->response_text);

$this->json('PUT', "/api/v1/annotation-assistance-requests/{$token}", [
'response_text' => 'This is a stone.',
Expand All @@ -186,7 +186,7 @@ public function testUpdate()
])
->assertStatus(200);

$this->assertEquals(9999, $ananas->fresh()->response_label_id);
$this->assertSame(9999, $ananas->fresh()->response_label_id);

$ananas = AnanasTest::create(['request_labels' => [['id' => 9999]]]);
$token = $ananas->token;
Expand All @@ -197,8 +197,8 @@ public function testUpdate()
])
->assertStatus(200);

$this->assertEquals('This is a stone.', $ananas->fresh()->response_text);
$this->assertEquals(9999, $ananas->fresh()->response_label_id);
$this->assertSame('This is a stone.', $ananas->fresh()->response_text);
$this->assertSame(9999, $ananas->fresh()->response_label_id);
}

public function testUpdateNotification()
Expand Down
2 changes: 1 addition & 1 deletion tests/Http/Controllers/Api/ImageControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public function testShow()

$response = $this->get("/api/v1/annotation-assistance-requests/{$token}/image");
$response->assertStatus(200);
$this->assertEquals('image/jpeg', $response->headers->get('content-type'));
$this->assertSame('image/jpeg', $response->headers->get('content-type'));
}
}
4 changes: 2 additions & 2 deletions tests/Http/Requests/UpdateUserSettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ public function testUpdate()
$this->putJson("/api/v1/users/my/settings", ['ananas_notifications' => 'email'])
->assertStatus(200);

$this->assertEquals('email', $this->user()->fresh()->getSettings('ananas_notifications'));
$this->assertSame('email', $this->user()->fresh()->getSettings('ananas_notifications'));

$this->putJson("/api/v1/users/my/settings", ['ananas_notifications' => 'web'])
->assertStatus(200);

$this->assertEquals('web', $this->user()->fresh()->getSettings('ananas_notifications'));
$this->assertSame('web', $this->user()->fresh()->getSettings('ananas_notifications'));
}
}

0 comments on commit a013687

Please sign in to comment.