Code Duplication    Length = 15-16 lines in 3 locations

tests/test-rest-comments-controller.php 3 locations

@@ 1377-1391 (lines=15) @@
1374
		$this->assertArrayHasKey( 'children', $response->get_links() );
1375
	}
1376
1377
	public function test_delete_item() {
1378
		wp_set_current_user( $this->admin_id );
1379
1380
		$comment_id = $this->factory->comment->create( array(
1381
			'comment_approved' => 1,
1382
			'comment_post_ID'  => $this->post_id,
1383
			'user_id'          => $this->subscriber_id,
1384
		));
1385
		$request = new WP_REST_Request( 'DELETE', sprintf( '/wp/v2/comments/%d', $comment_id ) );
1386
1387
		$response = $this->server->dispatch( $request );
1388
		$this->assertEquals( 200, $response->get_status() );
1389
		$data = $response->get_data();
1390
		$this->assertEquals( $this->post_id, $data['post'] );
1391
	}
1392
1393
	public function test_delete_item_skip_trash() {
1394
		wp_set_current_user( $this->admin_id );
@@ 1393-1408 (lines=16) @@
1390
		$this->assertEquals( $this->post_id, $data['post'] );
1391
	}
1392
1393
	public function test_delete_item_skip_trash() {
1394
		wp_set_current_user( $this->admin_id );
1395
1396
		$comment_id = $this->factory->comment->create( array(
1397
			'comment_approved' => 1,
1398
			'comment_post_ID'  => $this->post_id,
1399
			'user_id'          => $this->subscriber_id,
1400
		));
1401
		$request = new WP_REST_Request( 'DELETE', sprintf( '/wp/v2/comments/%d', $comment_id ) );
1402
		$request['force'] = true;
1403
1404
		$response = $this->server->dispatch( $request );
1405
		$this->assertEquals( 200, $response->get_status() );
1406
		$data = $response->get_data();
1407
		$this->assertEquals( $this->post_id, $data['post'] );
1408
	}
1409
1410
	public function test_delete_item_already_trashed() {
1411
		wp_set_current_user( $this->admin_id );
@@ 1410-1424 (lines=15) @@
1407
		$this->assertEquals( $this->post_id, $data['post'] );
1408
	}
1409
1410
	public function test_delete_item_already_trashed() {
1411
		wp_set_current_user( $this->admin_id );
1412
1413
		$comment_id = $this->factory->comment->create( array(
1414
			'comment_approved' => 1,
1415
			'comment_post_ID'  => $this->post_id,
1416
			'user_id'          => $this->subscriber_id,
1417
		));
1418
		$request = new WP_REST_Request( 'DELETE', sprintf( '/wp/v2/comments/%d', $comment_id ) );
1419
		$response = $this->server->dispatch( $request );
1420
		$this->assertEquals( 200, $response->get_status() );
1421
		$data = $response->get_data();
1422
		$response = $this->server->dispatch( $request );
1423
		$this->assertErrorResponse( 'rest_already_trashed', $response, 410 );
1424
	}
1425
1426
	public function test_delete_comment_invalid_id() {
1427
		wp_set_current_user( $this->admin_id );