Skip to content

Commit

Permalink
Fix php-cs fixer errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lehecht committed Mar 4, 2024
1 parent e01f7c1 commit 4d2c78f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -362,14 +362,14 @@ public function testUpdateInvalidPoints()
$this->annotation->shape_id = Shape::rectangleId();
$this->annotation->save();

$response = $this->json('PUT',"api/v1/image-annotations/{$this->annotation->id}", ['points' => [844.69, 1028.44, 844.69, 1028.44, 844.69, 1028.44, 844.69, 1028.44]]);
$response = $this->json('PUT', "api/v1/image-annotations/{$this->annotation->id}", ['points' => [844.69, 1028.44, 844.69, 1028.44, 844.69, 1028.44, 844.69, 1028.44]]);
$response->assertStatus(422);

$this->annotation->points = [0, 1, 2, 3, 4, 5, 6, 7];
$this->annotation->shape_id = Shape::lineId();
$this->annotation->save();

$response = $this->json('PUT',"api/v1/image-annotations/{$this->annotation->id}", ['points' => [844.69, 1028.44, 844.69, 1028.44, 844.69, 1028.44, 844.69, 1028.44]]);
$response = $this->json('PUT', "api/v1/image-annotations/{$this->annotation->id}", ['points' => [844.69, 1028.44, 844.69, 1028.44, 844.69, 1028.44, 844.69, 1028.44]]);
$response->assertStatus(422);
}

Expand Down
13 changes: 7 additions & 6 deletions tests/php/Http/Controllers/Api/VideoAnnotationControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public function testStore()
'points' => [[844.69, 1028.44, 844.69, 1028.44, 844.69, 1028.44, 844.69, 1028.44]],
])->assertStatus(422);

// shape is invalid
// shape is invalid
$this
->json('POST', "/api/v1/videos/{$this->video->id}/annotations", [
'shape_id' => Shape::lineId(),
Expand Down Expand Up @@ -715,25 +715,26 @@ public function testUpdateValidatePoints()
->assertStatus(422);
}

public function testUpdateInvalidPoints(){
public function testUpdateInvalidPoints()
{
$annotation = VideoAnnotationTest::create([
'shape_id' => Shape::rectangleId(),
'video_id' => $this->video->id,
'frames' => [0],
'points' => [[0,1,2,3,4,5,6,7]],
'points' => [[0, 1, 2, 3, 4, 5, 6, 7]],
]);

$this->beAdmin();

$this->putJson("api/v1/video-annotations/{$annotation->id}", ['points' => [[844.69, 1028.44, 844.69, 1028.44, 844.69, 1028.44, 844.69, 1028.44]]])
->assertStatus(422);
->assertStatus(422);

$annotation->points = [[0,1,2,3,4,5,6,7]];
$annotation->points = [[0, 1, 2, 3, 4, 5, 6, 7]];
$annotation->shape_id = Shape::lineId();
$annotation->save();

$this->putJson("api/v1/video-annotations/{$annotation->id}", ['points' => [[844.69, 1028.44, 844.69, 1028.44, 844.69, 1028.44, 844.69, 1028.44]]])
->assertStatus(422);
->assertStatus(422);

}

Expand Down
2 changes: 1 addition & 1 deletion tests/php/ImageAnnotationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function testValidatePointsLine()
public function testValidatePointsPolygon()
{
$this->model->shape_id = Shape::polygonId();
$this->model->validatePoints([10, 10, 20, 20, 30, 30, 10 ,10]);
$this->model->validatePoints([10, 10, 20, 20, 30, 30, 10, 10]);
$this->expectException(Exception::class);
$this->model->validatePoints([10, 10]);
}
Expand Down

0 comments on commit 4d2c78f

Please sign in to comment.