Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Jul 30, 2024
1 parent 41fca19 commit e415791
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/Api/Controllers/DeletePollImageByNameController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Flarum\Http\RequestUtil;
use FoF\Polls\Events\PollImageDeleting;
use FoF\Polls\Poll;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Support\Arr;
use Laminas\Diactoros\Response\EmptyResponse;
Expand Down
15 changes: 12 additions & 3 deletions tests/integration/api/EditPollTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of fof/polls.
*
* Copyright (c) FriendsOfFlarum.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace FoF\Polls\Tests\integration\api;

use Flarum\Testing\integration\RetrievesAuthorizedUsers;
Expand Down Expand Up @@ -30,7 +39,7 @@ public function setUp(): void
['id' => 1, 'user_id' => 1, 'discussion_id' => 1, 'number' => 1, 'created_at' => '2021-01-01 00:00:00', 'content' => 'Post 1', 'type' => 'comment'],
],
'polls' => [
['id' => 1, 'question' => 'Testing Poll--Global', 'subtitle' => 'Testing subtitle', 'image' => 'pollimage-abcdef.png', 'image_alt' => 'test alt', 'post_id' => null, 'user_id' => 1, 'public_poll' => 0, 'end_date' => null, 'created_at' => '2021-01-01 00:00:00', 'updated_at' => '2021-01-01 00:00:00', 'vote_count' => 0, 'allow_multiple_votes' => 0, 'max_votes' => 0, 'settings' => '{"max_votes": 0,"hide_votes": false,"public_poll": false,"allow_change_vote": false,"allow_multiple_votes": false}']
['id' => 1, 'question' => 'Testing Poll--Global', 'subtitle' => 'Testing subtitle', 'image' => 'pollimage-abcdef.png', 'image_alt' => 'test alt', 'post_id' => null, 'user_id' => 1, 'public_poll' => 0, 'end_date' => null, 'created_at' => '2021-01-01 00:00:00', 'updated_at' => '2021-01-01 00:00:00', 'vote_count' => 0, 'allow_multiple_votes' => 0, 'max_votes' => 0, 'settings' => '{"max_votes": 0,"hide_votes": false,"public_poll": false,"allow_change_vote": false,"allow_multiple_votes": false}'],
],
'poll_options' => [
['id' => 1, 'answer' => 'Option 1', 'poll_id' => 1, 'vote_count' => 0, 'image_url' => 'pollimage-hijklm.png', 'created_at' => '2021-01-01 00:00:00', 'updated_at' => '2021-01-01 00:00:00'],
Expand Down Expand Up @@ -95,7 +104,7 @@ public function user_without_permission_cannot_remove_pollimage_by_name_from_glo
public function user_with_permission_can_remove_pollimage_by_name_from_global_poll()
{
$fileName = 'pollimage-abcdef.png';

$response = $this->send(
$this->request('DELETE', '/api/fof/polls/pollImage/name/'.$fileName, [
'authenticatedAs' => 4,
Expand Down Expand Up @@ -153,7 +162,7 @@ public function user_without_permission_cannot_remove_polloption_image_by_name_f
public function user_with_permission_can_remove_polloption_image_by_name_from_global_poll()
{
$fileName = 'pollimage-hijklm.png';

$response = $this->send(
$this->request('DELETE', '/api/fof/polls/pollOptionImage/name/'.$fileName, [
'authenticatedAs' => 4,
Expand Down

0 comments on commit e415791

Please sign in to comment.