Fix files with Laravel Pint

This commit is contained in:
Jonny Barnes 2022-07-09 10:08:26 +01:00
parent c714457604
commit e36f15d391
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
116 changed files with 409 additions and 378 deletions

View file

@ -53,8 +53,8 @@ class ActivityStreamTest extends TestCase
],
'object' => [
'type' => 'Note',
'name' => strip_tags($note->note)
]
'name' => strip_tags($note->note),
],
]);
}
}

View file

@ -43,7 +43,7 @@ class ArticlesTest extends TestCase
$this->actingAs($user)
->post('/admin/blog', [
'title' => 'Test Title',
'main' => 'Article content'
'main' => 'Article content',
]);
$this->assertDatabaseHas('articles', ['title' => 'Test Title']);
}
@ -63,8 +63,8 @@ class ArticlesTest extends TestCase
$this->actingAs($user)
->post('/admin/blog', [
'title' => 'Uploaded Article',
'article' => $file,
'title' => 'Uploaded Article',
'article' => $file,
]);
$this->assertDatabaseHas('articles', [

View file

@ -41,11 +41,11 @@ class ClientsTest extends TestCase
$this->actingAs($user)
->post('/admin/clients', [
'client_name' => 'Micropublish',
'client_url' => 'https://micropublish.net'
'client_url' => 'https://micropublish.net',
]);
$this->assertDatabaseHas('clients', [
'client_name' => 'Micropublish',
'client_url' => 'https://micropublish.net'
'client_url' => 'https://micropublish.net',
]);
}

View file

@ -4,8 +4,8 @@ declare(strict_types=1);
namespace Tests\Feature\Admin;
use App\Models\User;
use App\Models\Contact;
use App\Models\User;
use GuzzleHttp\Client;
use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\HandlerStack;
@ -58,7 +58,7 @@ class ContactsTest extends TestCase
$this->assertDatabaseHas('contacts', [
'name' => 'Fred Bloggs',
'nick' => 'fred',
'homepage' => 'https://fred.blog/gs'
'homepage' => 'https://fred.blog/gs',
]);
}
@ -135,7 +135,7 @@ class ContactsTest extends TestCase
/** @test */
public function adminCanTriggerRetrievalOfRemoteAvatar(): void
{
$html = <<<HTML
$html = <<<'HTML'
<div class="h-card">
<img class="u-photo" alt="" src="http://tantek.com/tantek.png">
</div>
@ -181,7 +181,7 @@ class ContactsTest extends TestCase
/** @test */
public function gettingRemoteAvatarFailsGracefullyWithRemoteError(): void
{
$html = <<<HTML
$html = <<<'HTML'
<div class="h-card">
<img class="u-photo" src="http://tantek.com/tantek.png">
</div>

View file

@ -43,10 +43,10 @@ class LikesTest extends TestCase
$this->actingAs($user)
->post('/admin/likes', [
'like_url' => 'https://example.com'
'like_url' => 'https://example.com',
]);
$this->assertDatabaseHas('likes', [
'url' => 'https://example.com'
'url' => 'https://example.com',
]);
Queue::assertPushed(ProcessLike::class);
}

View file

@ -70,7 +70,7 @@ class FeedsTest extends TestCase
'children' => [[
'type' => 'entry',
'post-type' => 'article',
]]
]],
]);
}
@ -131,7 +131,7 @@ class FeedsTest extends TestCase
'children' => [[
'type' => 'entry',
'post-type' => 'note',
]]
]],
]);
}

View file

@ -3,8 +3,6 @@
namespace Tests\Feature;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
class HorizonTest extends TestCase
@ -13,6 +11,7 @@ class HorizonTest extends TestCase
* Horizon has its own test suite, here we just test it has been installed successfully.
*
* @test
*
* @return void
*/
public function horizonIsInstalled(): void

View file

@ -85,7 +85,7 @@ class LikesTest extends TestCase
$job = new ProcessLike($like);
$content = <<<END
$content = <<<'END'
<html>
<body>
<div class="h-entry">
@ -124,7 +124,7 @@ class LikesTest extends TestCase
$job = new ProcessLike($like);
$content = <<<END
$content = <<<'END'
<html>
<body>
<div class="h-entry">
@ -167,7 +167,7 @@ class LikesTest extends TestCase
$job = new ProcessLike($like);
$content = <<<END
$content = <<<'END'
<html>
<body>
<div>

View file

@ -4,13 +4,17 @@ declare(strict_types=1);
namespace Tests\Feature;
use App\Jobs\SendWebMentions;
use App\Jobs\SyndicateNoteToTwitter;
use App\Models\Media;
use App\Models\Note;
use App\Models\Place;
use Carbon\Carbon;
use Faker\Factory;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\Jobs\{SendWebMentions, SyndicateNoteToTwitter};
use App\Models\{Media, Note, Place};
use Carbon\Carbon;
use Illuminate\Support\Facades\Queue;
use Tests\{TestCase, TestToken};
use Tests\TestCase;
use Tests\TestToken;
class MicropubControllerTest extends TestCase
{
@ -67,6 +71,7 @@ class MicropubControllerTest extends TestCase
/**
* @test
*
* @todo Add uncertainty parameter
*
public function micropubClientsCanRequestKnownNearbyPlacesWithUncertaintyParameter(): void
@ -119,7 +124,7 @@ class MicropubControllerTest extends TestCase
[
'h' => 'entry',
'content' => $note,
'mp-syndicate-to' => 'https://twitter.com/jonnybarnes'
'mp-syndicate-to' => 'https://twitter.com/jonnybarnes',
],
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
);
@ -136,7 +141,7 @@ class MicropubControllerTest extends TestCase
[
'h' => 'card',
'name' => 'The Barton Arms',
'geo' => 'geo:53.4974,-2.3768'
'geo' => 'geo:53.4974,-2.3768',
],
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
);
@ -199,7 +204,7 @@ class MicropubControllerTest extends TestCase
[
'h' => 'card',
'name' => 'The Barton Arms',
'geo' => 'geo:53.4974,-2.3768'
'geo' => 'geo:53.4974,-2.3768',
],
['HTTP_Authorization' => 'Bearer ' . $this->getTokenWithIncorrectScope()]
);
@ -366,7 +371,7 @@ class MicropubControllerTest extends TestCase
$response
->assertJson([
'response' => 'error',
'error' => 'unauthorized'
'error' => 'unauthorized',
])
->assertStatus(401);
}
@ -394,7 +399,7 @@ class MicropubControllerTest extends TestCase
$response
->assertJson([
'response' => 'error',
'error' => 'insufficient_scope'
'error' => 'insufficient_scope',
])
->assertStatus(401);
}
@ -415,7 +420,7 @@ class MicropubControllerTest extends TestCase
$response
->assertJson([
'response' => 'error',
'error_description' => 'unsupported_request_type'
'error_description' => 'unsupported_request_type',
])
->assertStatus(500);
}
@ -430,7 +435,7 @@ class MicropubControllerTest extends TestCase
'type' => ['h-card'],
'properties' => [
'name' => $faker->name,
'geo' => 'geo:' . $faker->latitude . ',' . $faker->longitude
'geo' => 'geo:' . $faker->latitude . ',' . $faker->longitude,
],
],
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
@ -450,7 +455,7 @@ class MicropubControllerTest extends TestCase
'type' => ['h-card'],
'properties' => [
'name' => $faker->name,
'geo' => 'geo:' . $faker->latitude . ',' . $faker->longitude . ';u=35'
'geo' => 'geo:' . $faker->latitude . ',' . $faker->longitude . ';u=35',
],
],
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]

View file

@ -29,7 +29,7 @@ class OwnYourGramTest extends TestCase
'syndication' => ['https://www.instagram.com/p/BVC_nVTBFfi/'],
'photo' => [
// phpcs:ignore Generic.Files.LineLength.TooLong
'https://scontent-sjc2-1.cdninstagram.com/t51.2885-15/e35/18888604_425332491185600_326487281944756224_n.jpg'
'https://scontent-sjc2-1.cdninstagram.com/t51.2885-15/e35/18888604_425332491185600_326487281944756224_n.jpg',
],
],
],
@ -37,15 +37,15 @@ class OwnYourGramTest extends TestCase
);
$response->assertStatus(201)->assertJson([
'response' => 'created'
'response' => 'created',
]);
$this->assertDatabaseHas('media_endpoint', [
// phpcs:ignore Generic.Files.LineLength.TooLong
'path' => 'https://scontent-sjc2-1.cdninstagram.com/t51.2885-15/e35/18888604_425332491185600_326487281944756224_n.jpg'
'path' => 'https://scontent-sjc2-1.cdninstagram.com/t51.2885-15/e35/18888604_425332491185600_326487281944756224_n.jpg',
]);
$this->assertDatabaseHas('notes', [
'note' => 'How beautiful are the plates and chopsticks',
'instagram_url' => 'https://www.instagram.com/p/BVC_nVTBFfi/'
'instagram_url' => 'https://www.instagram.com/p/BVC_nVTBFfi/',
]);
}
}

View file

@ -54,10 +54,10 @@ class SwarmTest extends TestCase
->assertStatus(201)
->assertJson(['response' => 'created']);
$this->assertDatabaseHas('notes', [
'swarm_url' => 'https://www.swarmapp.com/checkin/abc'
'swarm_url' => 'https://www.swarmapp.com/checkin/abc',
]);
$this->assertDatabaseHas('places', [
'external_urls' => '{"foursquare": "https://foursquare.com/v/123456"}'
'external_urls' => '{"foursquare": "https://foursquare.com/v/123456"}',
]);
Queue::assertPushed(SendWebMentions::class);
@ -101,7 +101,7 @@ class SwarmTest extends TestCase
->assertStatus(201)
->assertJson(['response' => 'created']);
$this->assertDatabaseHas('places', [
'external_urls' => '{"osm": "https://www.openstreetmap.org/way/123456"}'
'external_urls' => '{"osm": "https://www.openstreetmap.org/way/123456"}',
]);
Queue::assertPushed(SendWebMentions::class);
@ -144,7 +144,7 @@ class SwarmTest extends TestCase
->assertStatus(201)
->assertJson(['response' => 'created']);
$this->assertDatabaseHas('places', [
'external_urls' => '{"default": "https://www.example.org/way/123456"}'
'external_urls' => '{"default": "https://www.example.org/way/123456"}',
]);
Queue::assertPushed(SendWebMentions::class);
@ -178,10 +178,10 @@ class SwarmTest extends TestCase
->assertStatus(201)
->assertJson(['response' => 'created']);
$this->assertDatabaseHas('places', [
'external_urls' => '{"foursquare": "https://foursquare.com/v/654321"}'
'external_urls' => '{"foursquare": "https://foursquare.com/v/654321"}',
]);
$this->assertDatabaseHas('notes', [
'swarm_url' => 'https://www.swarmapp.com/checkin/def'
'swarm_url' => 'https://www.swarmapp.com/checkin/def',
]);
// Check the default text content for the note was saved
$this->get($response->__get('headers')->get('location'))->assertSee('📍');
@ -280,10 +280,10 @@ class SwarmTest extends TestCase
[
'type' => ['h-entry'],
'properties' => [
'published' => [Carbon::now()->toDateTimeString()]
'published' => [Carbon::now()->toDateTimeString()],
],
'syndication' => [
'https://www.swarmapp.com/user/199841/checkin/5c4b1ac56dcf04002c0a4f58'
'https://www.swarmapp.com/user/199841/checkin/5c4b1ac56dcf04002c0a4f58',
],
'checkin' => [
'type' => ['h-card'],
@ -295,9 +295,9 @@ class SwarmTest extends TestCase
'street-address' => ['65 Oldham St.'],
'locality' => ['Manchester'],
'country-name' => ['United Kingdom'],
'postal-code' => ['M1 1JR']
'postal-code' => ['M1 1JR'],
],
'value' => 'https://foursquare.com/v/4ade0e46f964a520bf6f21e3'
'value' => 'https://foursquare.com/v/4ade0e46f964a520bf6f21e3',
],
'location' => [
'type' => ['h-adr'],
@ -307,8 +307,8 @@ class SwarmTest extends TestCase
'street-address' => ['65 Oldham St.'],
'locality' => ['Manchester'],
'country-name' => ['United Kingdom'],
'postal-code' => ['M1 1JR']
]
'postal-code' => ['M1 1JR'],
],
],
],
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]

View file

@ -59,7 +59,7 @@ class TokenEndpointTest extends TestCase
]);
$response->assertStatus(401);
$response->assertJson([
'error' => 'There was an error verifying the authorisation code.'
'error' => 'There was an error verifying the authorisation code.',
]);
}
@ -81,7 +81,7 @@ class TokenEndpointTest extends TestCase
]);
$response->assertStatus(400);
$response->assertJson([
'error' => 'Cant determine the authorisation endpoint.']
'error' => 'Cant determine the authorisation endpoint.', ]
);
}
}

View file

@ -25,14 +25,14 @@ class TokenServiceTest extends TestCase
$data = [
'me' => 'https://example.org',
'client_id' => 'https://quill.p3k.io',
'scope' => 'post'
'scope' => 'post',
];
$token = $tokenService->getNewToken($data);
$valid = $tokenService->validateToken($token);
$validData = [
'me' => $valid->claims()->get('me'),
'client_id' => $valid->claims()->get('client_id'),
'scope' => $valid->claims()->get('scope')
'scope' => $valid->claims()->get('scope'),
];
$this->assertSame($data, $validData);
}
@ -45,7 +45,7 @@ class TokenServiceTest extends TestCase
$data = [
'me' => 'https://example.org',
'client_id' => 'https://quill.p3k.io',
'scope' => 'post'
'scope' => 'post',
];
$config = resolve(Configuration::class);

View file

@ -43,7 +43,7 @@ class WebMentionsControllerTest extends TestCase
{
$response = $this->call('POST', '/webmention', [
'source' => 'https://example.org/post/123',
'target' => config('app.url') . '/invalid/target'
'target' => config('app.url') . '/invalid/target',
]);
$response->assertStatus(400);
}
@ -57,7 +57,7 @@ class WebMentionsControllerTest extends TestCase
{
$response = $this->call('POST', '/webmention', [
'source' => 'https://example.org/post/123',
'target' => config('app.url') . '/blog/target'
'target' => config('app.url') . '/blog/target',
]);
$response->assertStatus(501);
}
@ -71,7 +71,7 @@ class WebMentionsControllerTest extends TestCase
{
$response = $this->call('POST', '/webmention', [
'source' => 'https://example.org/post/123',
'target' => config('app.url') . '/notes/ZZZZZ'
'target' => config('app.url') . '/notes/ZZZZZ',
]);
$response->assertStatus(400);
}