Laravel Pint fixes
Some checks failed
PHP Unit / PHPUnit test suite (pull_request) Has been cancelled
Laravel Pint / Laravel Pint (pull_request) Has been cancelled

This commit is contained in:
Jonny Barnes 2025-04-06 17:25:06 +01:00
parent 7a58287b34
commit 126bb29ae2
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
50 changed files with 299 additions and 299 deletions

View file

@ -14,7 +14,7 @@ class AdminHomeControllerTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function adminHomepageLoads(): void public function admin_homepage_loads(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();

View file

@ -11,21 +11,21 @@ use Tests\TestCase;
class AdminTest extends TestCase class AdminTest extends TestCase
{ {
#[Test] #[Test]
public function adminPageRedirectsUnauthorisedUsersToLoginPage(): void public function admin_page_redirects_unauthorised_users_to_login_page(): void
{ {
$response = $this->get('/admin'); $response = $this->get('/admin');
$response->assertRedirect('/login'); $response->assertRedirect('/login');
} }
#[Test] #[Test]
public function loginPageLoads(): void public function login_page_loads(): void
{ {
$response = $this->get('/login'); $response = $this->get('/login');
$response->assertViewIs('login'); $response->assertViewIs('login');
} }
#[Test] #[Test]
public function loginAttemptWithBadCredentialsFails(): void public function login_attempt_with_bad_credentials_fails(): void
{ {
$response = $this->post('/login', [ $response = $this->post('/login', [
'username' => 'bad', 'username' => 'bad',
@ -35,7 +35,7 @@ class AdminTest extends TestCase
} }
#[Test] #[Test]
public function loginSucceeds(): void public function login_succeeds(): void
{ {
User::factory([ User::factory([
'name' => 'admin', 'name' => 'admin',
@ -51,7 +51,7 @@ class AdminTest extends TestCase
} }
#[Test] #[Test]
public function whenLoggedInRedirectsToAdminPage(): void public function when_logged_in_redirects_to_admin_page(): void
{ {
$user = User::factory()->create(); $user = User::factory()->create();
$response = $this->actingAs($user)->get('/login'); $response = $this->actingAs($user)->get('/login');
@ -59,14 +59,14 @@ class AdminTest extends TestCase
} }
#[Test] #[Test]
public function loggedOutUsersSimplyRedirected(): void public function logged_out_users_simply_redirected(): void
{ {
$response = $this->get('/logout'); $response = $this->get('/logout');
$response->assertRedirect('/'); $response->assertRedirect('/');
} }
#[Test] #[Test]
public function loggedInUsersShownLogoutForm(): void public function logged_in_users_shown_logout_form(): void
{ {
$user = User::factory()->create(); $user = User::factory()->create();
$response = $this->actingAs($user)->get('/logout'); $response = $this->actingAs($user)->get('/logout');
@ -74,7 +74,7 @@ class AdminTest extends TestCase
} }
#[Test] #[Test]
public function loggedInUsersCanLogout(): void public function logged_in_users_can_logout(): void
{ {
$user = User::factory()->create(); $user = User::factory()->create();
$response = $this->actingAs($user)->post('/logout'); $response = $this->actingAs($user)->post('/logout');

View file

@ -17,7 +17,7 @@ class ArticlesTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function adminArticlesPageLoads(): void public function admin_articles_page_loads(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -27,7 +27,7 @@ class ArticlesTest extends TestCase
} }
#[Test] #[Test]
public function adminCanLoadFormToCreateArticle(): void public function admin_can_load_form_to_create_article(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -37,7 +37,7 @@ class ArticlesTest extends TestCase
} }
#[Test] #[Test]
public function admiNCanCreateNewArticle(): void public function admi_n_can_create_new_article(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -50,7 +50,7 @@ class ArticlesTest extends TestCase
} }
#[Test] #[Test]
public function adminCanCreateNewArticleWithFile(): void public function admin_can_create_new_article_with_file(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$faker = Factory::create(); $faker = Factory::create();
@ -75,7 +75,7 @@ class ArticlesTest extends TestCase
} }
#[Test] #[Test]
public function articleCanLoadFormToEditArticle(): void public function article_can_load_form_to_edit_article(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$article = Article::factory()->create([ $article = Article::factory()->create([
@ -88,7 +88,7 @@ class ArticlesTest extends TestCase
} }
#[Test] #[Test]
public function adminCanEditArticle(): void public function admin_can_edit_article(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$article = Article::factory()->create(); $article = Article::factory()->create();
@ -106,7 +106,7 @@ class ArticlesTest extends TestCase
} }
#[Test] #[Test]
public function adminCanDeleteArticle(): void public function admin_can_delete_article(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$article = Article::factory()->create(); $article = Article::factory()->create();

View file

@ -15,7 +15,7 @@ class BioTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function adminBiosPageLoads(): void public function admin_bios_page_loads(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -25,7 +25,7 @@ class BioTest extends TestCase
} }
#[Test] #[Test]
public function adminCanCreateBio(): void public function admin_can_create_bio(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -38,7 +38,7 @@ class BioTest extends TestCase
} }
#[Test] #[Test]
public function adminCanLoadExistingBio(): void public function admin_can_load_existing_bio(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$bio = Bio::factory()->create([ $bio = Bio::factory()->create([
@ -51,7 +51,7 @@ class BioTest extends TestCase
} }
#[Test] #[Test]
public function adminCanEditBio(): void public function admin_can_edit_bio(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$bio = Bio::factory()->create(); $bio = Bio::factory()->create();

View file

@ -15,7 +15,7 @@ class ClientsTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function clientsPageLoads(): void public function clients_page_loads(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -25,7 +25,7 @@ class ClientsTest extends TestCase
} }
#[Test] #[Test]
public function adminCanLoadFormToCreateClient(): void public function admin_can_load_form_to_create_client(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -35,7 +35,7 @@ class ClientsTest extends TestCase
} }
#[Test] #[Test]
public function adminCanCreateNewClient(): void public function admin_can_create_new_client(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -51,7 +51,7 @@ class ClientsTest extends TestCase
} }
#[Test] #[Test]
public function adminCanLoadEditFormForClient(): void public function admin_can_load_edit_form_for_client(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$client = MicropubClient::factory()->create([ $client = MicropubClient::factory()->create([
@ -64,7 +64,7 @@ class ClientsTest extends TestCase
} }
#[Test] #[Test]
public function adminCanEditClient(): void public function admin_can_edit_client(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$client = MicropubClient::factory()->create(); $client = MicropubClient::factory()->create();
@ -82,7 +82,7 @@ class ClientsTest extends TestCase
} }
#[Test] #[Test]
public function adminCanDeleteClient(): void public function admin_can_delete_client(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$client = MicropubClient::factory()->create([ $client = MicropubClient::factory()->create([

View file

@ -29,7 +29,7 @@ class ContactsTest extends TestCase
} }
#[Test] #[Test]
public function contactIndexPageLoads(): void public function contact_index_page_loads(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -38,7 +38,7 @@ class ContactsTest extends TestCase
} }
#[Test] #[Test]
public function contactCreatePageLoads(): void public function contact_create_page_loads(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -47,7 +47,7 @@ class ContactsTest extends TestCase
} }
#[Test] #[Test]
public function adminCanCreateNewContact(): void public function admin_can_create_new_contact(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -64,7 +64,7 @@ class ContactsTest extends TestCase
} }
#[Test] #[Test]
public function adminCanSeeFormToEditContact(): void public function admin_can_see_form_to_edit_contact(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$contact = Contact::factory()->create(); $contact = Contact::factory()->create();
@ -74,7 +74,7 @@ class ContactsTest extends TestCase
} }
#[Test] #[Test]
public function adminCanUpdateContact(): void public function admin_can_update_contact(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$contact = Contact::factory()->create(); $contact = Contact::factory()->create();
@ -93,7 +93,7 @@ class ContactsTest extends TestCase
} }
#[Test] #[Test]
public function adminCanEditContactAndUploadAvatar(): void public function admin_can_edit_contact_and_upload_avatar(): void
{ {
copy(__DIR__ . '/../../aaron.png', sys_get_temp_dir() . '/tantek.png'); copy(__DIR__ . '/../../aaron.png', sys_get_temp_dir() . '/tantek.png');
$path = sys_get_temp_dir() . '/tantek.png'; $path = sys_get_temp_dir() . '/tantek.png';
@ -116,7 +116,7 @@ class ContactsTest extends TestCase
} }
#[Test] #[Test]
public function adminCanDeleteContact(): void public function admin_can_delete_contact(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$contact = Contact::factory()->create(['nick' => 'tantek']); $contact = Contact::factory()->create(['nick' => 'tantek']);
@ -134,7 +134,7 @@ class ContactsTest extends TestCase
} }
#[Test] #[Test]
public function adminCanTriggerRetrievalOfRemoteAvatar(): void public function admin_can_trigger_retrieval_of_remote_avatar(): void
{ {
$html = <<<'HTML' $html = <<<'HTML'
<div class="h-card"> <div class="h-card">
@ -163,7 +163,7 @@ class ContactsTest extends TestCase
} }
#[Test] #[Test]
public function gettingRemoteAvatarFailsGracefullyWithRemoteNotFound(): void public function getting_remote_avatar_fails_gracefully_with_remote_not_found(): void
{ {
$mock = new MockHandler([ $mock = new MockHandler([
new Response(404), new Response(404),
@ -180,7 +180,7 @@ class ContactsTest extends TestCase
} }
#[Test] #[Test]
public function gettingRemoteAvatarFailsGracefullyWithRemoteError(): void public function getting_remote_avatar_fails_gracefully_with_remote_error(): void
{ {
$html = <<<'HTML' $html = <<<'HTML'
<div class="h-card"> <div class="h-card">
@ -203,7 +203,7 @@ class ContactsTest extends TestCase
} }
#[Test] #[Test]
public function gettingRemoteAvatarFailsGracefullyForContactWithNoHompage(): void public function getting_remote_avatar_fails_gracefully_for_contact_with_no_hompage(): void
{ {
$contact = Contact::create([ $contact = Contact::create([
'nick' => 'fred', 'nick' => 'fred',

View file

@ -17,7 +17,7 @@ class LikesTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function likesPageLoads(): void public function likes_page_loads(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -27,7 +27,7 @@ class LikesTest extends TestCase
} }
#[Test] #[Test]
public function likeCreateFormLoads(): void public function like_create_form_loads(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -37,7 +37,7 @@ class LikesTest extends TestCase
} }
#[Test] #[Test]
public function adminCanCreateLike(): void public function admin_can_create_like(): void
{ {
Queue::fake(); Queue::fake();
$user = User::factory()->make(); $user = User::factory()->make();
@ -53,7 +53,7 @@ class LikesTest extends TestCase
} }
#[Test] #[Test]
public function likeEditFormLoads(): void public function like_edit_form_loads(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$like = Like::factory()->create(); $like = Like::factory()->create();
@ -64,7 +64,7 @@ class LikesTest extends TestCase
} }
#[Test] #[Test]
public function adminCanEditLike(): void public function admin_can_edit_like(): void
{ {
Queue::fake(); Queue::fake();
$user = User::factory()->make(); $user = User::factory()->make();
@ -82,7 +82,7 @@ class LikesTest extends TestCase
} }
#[Test] #[Test]
public function adminCanDeleteLike(): void public function admin_can_delete_like(): void
{ {
$like = Like::factory()->create(); $like = Like::factory()->create();
$url = $like->url; $url = $like->url;

View file

@ -17,7 +17,7 @@ class NotesTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function notesPageLoads(): void public function notes_page_loads(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -26,7 +26,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function noteCreatePageLoads(): void public function note_create_page_loads(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -35,7 +35,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function adminCanCreateNewNote(): void public function admin_can_create_new_note(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -49,7 +49,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function noteEditFormLoads(): void public function note_edit_form_loads(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$note = Note::factory()->create(); $note = Note::factory()->create();
@ -59,7 +59,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function adminCanEditNote(): void public function admin_can_edit_note(): void
{ {
Queue::fake(); Queue::fake();
$user = User::factory()->make(); $user = User::factory()->make();
@ -78,7 +78,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function adminCanDeleteNote(): void public function admin_can_delete_note(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$note = Note::factory()->create(); $note = Note::factory()->create();

View file

@ -15,7 +15,7 @@ class PlacesTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function placesPageLoads(): void public function places_page_loads(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -24,7 +24,7 @@ class PlacesTest extends TestCase
} }
#[Test] #[Test]
public function createPlacePageLoads(): void public function create_place_page_loads(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -33,7 +33,7 @@ class PlacesTest extends TestCase
} }
#[Test] #[Test]
public function adminCanCreateNewPlace(): void public function admin_can_create_new_place(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
@ -50,7 +50,7 @@ class PlacesTest extends TestCase
} }
#[Test] #[Test]
public function editPlacePageLoads(): void public function edit_place_page_loads(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$place = Place::factory()->create(); $place = Place::factory()->create();
@ -60,7 +60,7 @@ class PlacesTest extends TestCase
} }
#[Test] #[Test]
public function adminCanUpdatePlace(): void public function admin_can_update_place(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$place = Place::factory()->create([ $place = Place::factory()->create([

View file

@ -15,14 +15,14 @@ class ArticlesTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function articlesPageLoads(): void public function articles_page_loads(): void
{ {
$response = $this->get('/blog'); $response = $this->get('/blog');
$response->assertViewIs('articles.index'); $response->assertViewIs('articles.index');
} }
#[Test] #[Test]
public function singleArticlePageLoads() public function single_article_page_loads()
{ {
$article = Article::factory()->create(); $article = Article::factory()->create();
$response = $this->get($article->link); $response = $this->get($article->link);
@ -30,7 +30,7 @@ class ArticlesTest extends TestCase
} }
#[Test] #[Test]
public function wrongDateInUrlRedirectsToCorrectDate() public function wrong_date_in_url_redirects_to_correct_date()
{ {
$article = Article::factory()->create(); $article = Article::factory()->create();
$response = $this->get('/blog/1900/01/' . $article->titleurl); $response = $this->get('/blog/1900/01/' . $article->titleurl);
@ -38,7 +38,7 @@ class ArticlesTest extends TestCase
} }
#[Test] #[Test]
public function oldUrlsWithIdAreRedirected() public function old_urls_with_id_are_redirected()
{ {
$article = Article::factory()->create(); $article = Article::factory()->create();
$num60Id = resolve(Numbers::class)->numto60($article->id); $num60Id = resolve(Numbers::class)->numto60($article->id);
@ -47,21 +47,21 @@ class ArticlesTest extends TestCase
} }
#[Test] #[Test]
public function unknownSlugGetsNotFoundResponse() public function unknown_slug_gets_not_found_response()
{ {
$response = $this->get('/blog/' . date('Y') . '/' . date('m') . '/unknown-slug'); $response = $this->get('/blog/' . date('Y') . '/' . date('m') . '/unknown-slug');
$response->assertNotFound(); $response->assertNotFound();
} }
#[Test] #[Test]
public function unknownArticleIdGetsNotFoundResponse() public function unknown_article_id_gets_not_found_response()
{ {
$response = $this->get('/blog/s/22'); $response = $this->get('/blog/s/22');
$response->assertNotFound(); $response->assertNotFound();
} }
#[Test] #[Test]
public function someUrlsDoNotParseCorrectly(): void public function some_urls_do_not_parse_correctly(): void
{ {
$response = $this->get('/blog/feed.js'); $response = $this->get('/blog/feed.js');
$response->assertNotFound(); $response->assertNotFound();

View file

@ -17,14 +17,14 @@ class BookmarksTest extends TestCase
use RefreshDatabase, TestToken; use RefreshDatabase, TestToken;
#[Test] #[Test]
public function bookmarksPageLoadsWithoutError(): void public function bookmarks_page_loads_without_error(): void
{ {
$response = $this->get('/bookmarks'); $response = $this->get('/bookmarks');
$response->assertViewIs('bookmarks.index'); $response->assertViewIs('bookmarks.index');
} }
#[Test] #[Test]
public function singleBookmarkPageLoadsWithoutError(): void public function single_bookmark_page_loads_without_error(): void
{ {
$bookmark = Bookmark::factory()->create(); $bookmark = Bookmark::factory()->create();
$response = $this->get('/bookmarks/' . $bookmark->id); $response = $this->get('/bookmarks/' . $bookmark->id);
@ -32,7 +32,7 @@ class BookmarksTest extends TestCase
} }
#[Test] #[Test]
public function whenBookmarkIsAddedUsingHttpSyntaxCheckJobToTakeScreenshotIsInvoked(): void public function when_bookmark_is_added_using_http_syntax_check_job_to_take_screenshot_is_invoked(): void
{ {
Queue::fake(); Queue::fake();
@ -50,7 +50,7 @@ class BookmarksTest extends TestCase
} }
#[Test] #[Test]
public function whenBookmarkIsAddedUsingJsonSyntaxCheckJobToTakeScreenshotIsInvoked(): void public function when_bookmark_is_added_using_json_syntax_check_job_to_take_screenshot_is_invoked(): void
{ {
Queue::fake(); Queue::fake();
@ -70,7 +70,7 @@ class BookmarksTest extends TestCase
} }
#[Test] #[Test]
public function whenTheBookmarkIsCreatedCheckNecessaryTagsAreAlsoCreated(): void public function when_the_bookmark_is_created_check_necessary_tags_are_also_created(): void
{ {
Queue::fake(); Queue::fake();

View file

@ -17,7 +17,7 @@ class ContactsTest extends TestCase
* Check the `/contacts` page gives a good response. * Check the `/contacts` page gives a good response.
*/ */
#[Test] #[Test]
public function contactsPageLoadsWithoutError(): void public function contacts_page_loads_without_error(): void
{ {
$response = $this->get('/contacts'); $response = $this->get('/contacts');
$response->assertStatus(200); $response->assertStatus(200);
@ -27,7 +27,7 @@ class ContactsTest extends TestCase
* Test an individual contact page with default profile image. * Test an individual contact page with default profile image.
*/ */
#[Test] #[Test]
public function contactPageShouldFallbackToDefaultProfilePic(): void public function contact_page_should_fallback_to_default_profile_pic(): void
{ {
Contact::factory()->create([ Contact::factory()->create([
'nick' => 'tantek', 'nick' => 'tantek',
@ -40,7 +40,7 @@ class ContactsTest extends TestCase
* Test an individual contact page with a specific profile image. * Test an individual contact page with a specific profile image.
*/ */
#[Test] #[Test]
public function contactPageShouldUseSpecificProfilePicIfPresent(): void public function contact_page_should_use_specific_profile_pic_if_present(): void
{ {
Contact::factory()->create([ Contact::factory()->create([
'nick' => 'aaron', 'nick' => 'aaron',
@ -51,7 +51,7 @@ class ContactsTest extends TestCase
} }
#[Test] #[Test]
public function unknownContactReturnsNotFoundResponse(): void public function unknown_contact_returns_not_found_response(): void
{ {
$response = $this->get('/contacts/unknown'); $response = $this->get('/contacts/unknown');
$response->assertNotFound(); $response->assertNotFound();

View file

@ -13,7 +13,7 @@ class CorsHeadersTest extends TestCase
use TestToken; use TestToken;
#[Test] #[Test]
public function checkCorsHeadersOnMediaEndpoint(): void public function check_cors_headers_on_media_endpoint(): void
{ {
$response = $this->call( $response = $this->call(
'OPTIONS', 'OPTIONS',
@ -27,7 +27,7 @@ class CorsHeadersTest extends TestCase
} }
#[Test] #[Test]
public function checkForNoCorsHeaderOnNonMediaEndpointLinks(): void public function check_for_no_cors_header_on_non_media_endpoint_links(): void
{ {
$response = $this->get('/blog'); $response = $this->get('/blog');
$response->assertHeaderMissing('Access-Control-Allow-Origin'); $response->assertHeaderMissing('Access-Control-Allow-Origin');

View file

@ -19,7 +19,7 @@ class FeedsTest extends TestCase
* Test the blog RSS feed. * Test the blog RSS feed.
*/ */
#[Test] #[Test]
public function blogRssFeedIsPresent(): void public function blog_rss_feed_is_present(): void
{ {
Article::factory()->count(3)->create(); Article::factory()->count(3)->create();
$response = $this->get('/blog/feed.rss'); $response = $this->get('/blog/feed.rss');
@ -31,7 +31,7 @@ class FeedsTest extends TestCase
* Test the notes RSS feed. * Test the notes RSS feed.
*/ */
#[Test] #[Test]
public function notesRssFeedIsPresent(): void public function notes_rss_feed_is_present(): void
{ {
Note::factory()->count(3)->create(); Note::factory()->count(3)->create();
$response = $this->get('/notes/feed.rss'); $response = $this->get('/notes/feed.rss');
@ -43,7 +43,7 @@ class FeedsTest extends TestCase
* Test the blog RSS feed. * Test the blog RSS feed.
*/ */
#[Test] #[Test]
public function blogAtomFeedIsPresent(): void public function blog_atom_feed_is_present(): void
{ {
Article::factory()->count(3)->create(); Article::factory()->count(3)->create();
$response = $this->get('/blog/feed.atom'); $response = $this->get('/blog/feed.atom');
@ -52,7 +52,7 @@ class FeedsTest extends TestCase
} }
#[Test] #[Test]
public function blogJf2FeedIsPresent(): void public function blog_jf2_feed_is_present(): void
{ {
Article::factory()->count(3)->create(); Article::factory()->count(3)->create();
$response = $this->get('/blog/feed.jf2'); $response = $this->get('/blog/feed.jf2');
@ -77,7 +77,7 @@ class FeedsTest extends TestCase
* Test the notes RSS feed. * Test the notes RSS feed.
*/ */
#[Test] #[Test]
public function notesAtomFeedIsPresent(): void public function notes_atom_feed_is_present(): void
{ {
Note::factory()->count(3)->create(); Note::factory()->count(3)->create();
$response = $this->get('/notes/feed.atom'); $response = $this->get('/notes/feed.atom');
@ -89,7 +89,7 @@ class FeedsTest extends TestCase
* Test the blog JSON feed. * Test the blog JSON feed.
*/ */
#[Test] #[Test]
public function blogJsonFeedIsPresent(): void public function blog_json_feed_is_present(): void
{ {
Article::factory()->count(3)->create(); Article::factory()->count(3)->create();
$response = $this->get('/blog/feed.json'); $response = $this->get('/blog/feed.json');
@ -101,7 +101,7 @@ class FeedsTest extends TestCase
* Test the notes JSON feed. * Test the notes JSON feed.
*/ */
#[Test] #[Test]
public function notesJsonFeedIsPresent(): void public function notes_json_feed_is_present(): void
{ {
Note::factory()->count(3)->create(); Note::factory()->count(3)->create();
$response = $this->get('/notes/feed.json'); $response = $this->get('/notes/feed.json');
@ -110,7 +110,7 @@ class FeedsTest extends TestCase
} }
#[Test] #[Test]
public function notesJf2FeedIsPresent(): void public function notes_jf2_feed_is_present(): void
{ {
Note::factory()->count(3)->create(); Note::factory()->count(3)->create();
$response = $this->get('/notes/feed.jf2'); $response = $this->get('/notes/feed.jf2');
@ -136,7 +136,7 @@ class FeedsTest extends TestCase
* and whichever one they have cant be `null`. * and whichever one they have cant be `null`.
*/ */
#[Test] #[Test]
public function jsonFeedsHaveRequiredAttributes(): void public function json_feeds_have_required_attributes(): void
{ {
Note::factory()->count(3)->create(); Note::factory()->count(3)->create();
$response = $this->get('/notes/feed.json'); $response = $this->get('/notes/feed.json');
@ -156,7 +156,7 @@ class FeedsTest extends TestCase
} }
#[Test] #[Test]
public function jsonNoteFeedLoadsPlaceDataWithoutLazyLoading(): void public function json_note_feed_loads_place_data_without_lazy_loading(): void
{ {
$place = Place::factory()->create(); $place = Place::factory()->create();
Note::factory()->create(['note' => null, 'place_id' => $place->id]); Note::factory()->create(['note' => null, 'place_id' => $place->id]);

View file

@ -15,7 +15,7 @@ class FrontPageTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function frontPageLoadsAllContent(): void public function front_page_loads_all_content(): void
{ {
Note::factory()->create(['note' => 'Note 1']); Note::factory()->create(['note' => 'Note 1']);
Article::factory()->create(['title' => 'Article 1']); Article::factory()->create(['title' => 'Article 1']);

View file

@ -10,7 +10,7 @@ use Tests\TestCase;
class HeaderLinkTest extends TestCase class HeaderLinkTest extends TestCase
{ {
#[Test] #[Test]
public function itShouldSeeTheIndiewebRelatedLinkHeaders(): void public function it_should_see_the_indieweb_related_link_headers(): void
{ {
$response = $this->get('/'); $response = $this->get('/');

View file

@ -12,7 +12,7 @@ class HorizonTest extends TestCase
* Horizon has its own test suite, here we just test it has been installed successfully. * Horizon has its own test suite, here we just test it has been installed successfully.
*/ */
#[Test] #[Test]
public function horizonIsInstalled(): void public function horizon_is_installed(): void
{ {
$user = User::factory()->create([ $user = User::factory()->create([
'name' => 'jonny', 'name' => 'jonny',

View file

@ -21,7 +21,7 @@ class IndieAuthTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function itShouldReturnIndieAuthMetadata(): void public function it_should_return_indie_auth_metadata(): void
{ {
$response = $this->get('/.well-known/indieauth-server'); $response = $this->get('/.well-known/indieauth-server');
@ -37,7 +37,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldRequireAdminLoginToShowAuthoriseForm(): void public function it_should_require_admin_login_to_show_authorise_form(): void
{ {
$response = $this->get('/auth', [ $response = $this->get('/auth', [
'response_type' => 'code', 'response_type' => 'code',
@ -59,7 +59,7 @@ class IndieAuthTest extends TestCase
* same domain, later test will check the flow when they are different. * same domain, later test will check the flow when they are different.
*/ */
#[Test] #[Test]
public function itShouldReturnApprovalViewWhenTheRequestIsValid(): void public function it_should_return_approval_view_when_the_request_is_valid(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$url = url()->query('/auth', [ $url = url()->query('/auth', [
@ -80,7 +80,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldReturnErrorViewWhenResponeTypeIsWrong(): void public function it_should_return_error_view_when_respone_type_is_wrong(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$url = url()->query('/auth', [ $url = url()->query('/auth', [
@ -102,7 +102,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldReturnErrorViewWhenResponeTypeIsMissing(): void public function it_should_return_error_view_when_respone_type_is_missing(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$url = url()->query('/auth', [ $url = url()->query('/auth', [
@ -123,7 +123,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldReturnErrorViewWhenClientIdIsMissing(): void public function it_should_return_error_view_when_client_id_is_missing(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$url = url()->query('/auth', [ $url = url()->query('/auth', [
@ -144,7 +144,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldReturnErrorViewWhenRedirectUriIsMissing(): void public function it_should_return_error_view_when_redirect_uri_is_missing(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$url = url()->query('/auth', [ $url = url()->query('/auth', [
@ -165,7 +165,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldReturnErrorViewWhenStateIsMissing(): void public function it_should_return_error_view_when_state_is_missing(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$url = url()->query('/auth', [ $url = url()->query('/auth', [
@ -186,7 +186,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldReturnErrorViewWhenCodeChallengeIsMissing(): void public function it_should_return_error_view_when_code_challenge_is_missing(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$url = url()->query('/auth', [ $url = url()->query('/auth', [
@ -207,7 +207,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldReturnErrorViewWhenCodeChallengeMethodIsMissing(): void public function it_should_return_error_view_when_code_challenge_method_is_missing(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$url = url()->query('/auth', [ $url = url()->query('/auth', [
@ -228,7 +228,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldReturnErrorViewWhenCodeChallengeMethodIsUnsupportedValue(): void public function it_should_return_error_view_when_code_challenge_method_is_unsupported_value(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$url = url()->query('/auth', [ $url = url()->query('/auth', [
@ -250,7 +250,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldCheckClientIdForValidRedirect(): void public function it_should_check_client_id_for_valid_redirect(): void
{ {
// Mock Guzzle request for client_id // Mock Guzzle request for client_id
$appPageHtml = <<<'HTML' $appPageHtml = <<<'HTML'
@ -295,7 +295,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldErrorIfClientIdPageHasNoValidRedirect(): void public function it_should_error_if_client_id_page_has_no_valid_redirect(): void
{ {
// Mock Guzzle request for client_id // Mock Guzzle request for client_id
$appPageHtml = <<<'HTML' $appPageHtml = <<<'HTML'
@ -340,7 +340,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldRedirectToAppOnApproval(): void public function it_should_redirect_to_app_on_approval(): void
{ {
$user = User::factory()->make(); $user = User::factory()->make();
$response = $this->actingAs($user)->post('/auth/confirm', [ $response = $this->actingAs($user)->post('/auth/confirm', [
@ -373,7 +373,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldShowErrorResponseWhenApprovalRequestIsMissingGrantType(): void public function it_should_show_error_response_when_approval_request_is_missing_grant_type(): void
{ {
$response = $this->post('/auth', [ $response = $this->post('/auth', [
'code' => '123456', 'code' => '123456',
@ -393,7 +393,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldShowErrorResponseWhenApprovalRequestIsMissingCode(): void public function it_should_show_error_response_when_approval_request_is_missing_code(): void
{ {
$response = $this->post('/auth', [ $response = $this->post('/auth', [
'grant_type' => 'authorization_code', 'grant_type' => 'authorization_code',
@ -413,7 +413,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldShowErrorResponseWhenApprovalRequestIsMissingClientId(): void public function it_should_show_error_response_when_approval_request_is_missing_client_id(): void
{ {
$response = $this->post('/auth', [ $response = $this->post('/auth', [
'grant_type' => 'authorization_code', 'grant_type' => 'authorization_code',
@ -433,7 +433,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldShowErrorResponseWhenApprovalRequestIsMissingRedirectUri(): void public function it_should_show_error_response_when_approval_request_is_missing_redirect_uri(): void
{ {
$response = $this->post('/auth', [ $response = $this->post('/auth', [
'grant_type' => 'authorization_code', 'grant_type' => 'authorization_code',
@ -453,7 +453,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldShowErrorResponseWhenApprovalRequestIsMissingCodeVerifier(): void public function it_should_show_error_response_when_approval_request_is_missing_code_verifier(): void
{ {
$response = $this->post('/auth', [ $response = $this->post('/auth', [
'grant_type' => 'authorization_code', 'grant_type' => 'authorization_code',
@ -473,7 +473,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldShowErrorResponseWhenApprovalRequestGrantTypeIsUnsupported(): void public function it_should_show_error_response_when_approval_request_grant_type_is_unsupported(): void
{ {
$response = $this->post('/auth', [ $response = $this->post('/auth', [
'grant_type' => 'unsupported', 'grant_type' => 'unsupported',
@ -494,7 +494,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldReturnErrorForUnknownCode(): void public function it_should_return_error_for_unknown_code(): void
{ {
$response = $this->post('/auth', [ $response = $this->post('/auth', [
'grant_type' => 'authorization_code', 'grant_type' => 'authorization_code',
@ -515,7 +515,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldReturnErrorForInvalidCode(): void public function it_should_return_error_for_invalid_code(): void
{ {
Cache::shouldReceive('pull') Cache::shouldReceive('pull')
->once() ->once()
@ -541,7 +541,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldReturnErrorForInvalidCodeVerifier(): void public function it_should_return_error_for_invalid_code_verifier(): void
{ {
Cache::shouldReceive('pull') Cache::shouldReceive('pull')
->once() ->once()
@ -570,7 +570,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldReturnMeDataForValidRequest(): void public function it_should_return_me_data_for_valid_request(): void
{ {
Cache::shouldReceive('pull') Cache::shouldReceive('pull')
->once() ->once()
@ -600,7 +600,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldReturnErrorWhenNoScopesGivenToTokenEndpoint(): void public function it_should_return_error_when_no_scopes_given_to_token_endpoint(): void
{ {
Cache::shouldReceive('pull') Cache::shouldReceive('pull')
->once() ->once()
@ -635,7 +635,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldReturnErrorWhenClientIdDoesNotMatchDuringTokenRequest(): void public function it_should_return_error_when_client_id_does_not_match_during_token_request(): void
{ {
Cache::shouldReceive('pull') Cache::shouldReceive('pull')
->once() ->once()
@ -670,7 +670,7 @@ class IndieAuthTest extends TestCase
} }
#[Test] #[Test]
public function itShouldReturnAnAccessTokenIfValidationPasses(): void public function it_should_return_an_access_token_if_validation_passes(): void
{ {
Cache::shouldReceive('pull') Cache::shouldReceive('pull')
->once() ->once()

View file

@ -24,14 +24,14 @@ class LikesTest extends TestCase
use TestToken; use TestToken;
#[Test] #[Test]
public function likesPageHasCorrectView(): void public function likes_page_has_correct_view(): void
{ {
$response = $this->get('/likes'); $response = $this->get('/likes');
$response->assertViewIs('likes.index'); $response->assertViewIs('likes.index');
} }
#[Test] #[Test]
public function singleLikePageHasCorrectView(): void public function single_like_page_has_correct_view(): void
{ {
$like = Like::factory()->create(); $like = Like::factory()->create();
$response = $this->get('/likes/' . $like->id); $response = $this->get('/likes/' . $like->id);
@ -39,7 +39,7 @@ class LikesTest extends TestCase
} }
#[Test] #[Test]
public function checkLikeCreatedFromMicropubApiRequests(): void public function check_like_created_from_micropub_api_requests(): void
{ {
Queue::fake(); Queue::fake();
@ -59,7 +59,7 @@ class LikesTest extends TestCase
} }
#[Test] #[Test]
public function checkLikeCreatedFromMicropubWebRequests(): void public function check_like_created_from_micropub_web_requests(): void
{ {
Queue::fake(); Queue::fake();
@ -77,7 +77,7 @@ class LikesTest extends TestCase
} }
#[Test] #[Test]
public function likeWithSimpleAuthor(): void public function like_with_simple_author(): void
{ {
$like = new Like; $like = new Like;
$like->url = 'http://example.org/note/id'; $like->url = 'http://example.org/note/id';
@ -116,7 +116,7 @@ class LikesTest extends TestCase
} }
#[Test] #[Test]
public function likeWithHCard(): void public function like_with_h_card(): void
{ {
$like = new Like; $like = new Like;
$like->url = 'http://example.org/note/id'; $like->url = 'http://example.org/note/id';
@ -159,7 +159,7 @@ class LikesTest extends TestCase
} }
#[Test] #[Test]
public function likeWithoutMicroformats(): void public function like_without_microformats(): void
{ {
$like = new Like; $like = new Like;
$like->url = 'http://example.org/note/id'; $like->url = 'http://example.org/note/id';
@ -195,7 +195,7 @@ class LikesTest extends TestCase
} }
#[Test] #[Test]
public function likeThatIsATweet(): void public function like_that_is_a_tweet(): void
{ {
$like = new Like; $like = new Like;
$like->url = 'https://twitter.com/jonnybarnes/status/1050823255123251200'; $like->url = 'https://twitter.com/jonnybarnes/status/1050823255123251200';
@ -234,7 +234,7 @@ class LikesTest extends TestCase
} }
#[Test] #[Test]
public function noErrorForFailureToPosseWithBridgy(): void public function no_error_for_failure_to_posse_with_bridgy(): void
{ {
$like = new Like; $like = new Like;
$like->url = 'https://twitter.com/jonnybarnes/status/1050823255123251200'; $like->url = 'https://twitter.com/jonnybarnes/status/1050823255123251200';
@ -271,7 +271,7 @@ class LikesTest extends TestCase
} }
#[Test] #[Test]
public function unknownLikeGivesNotFoundResponse(): void public function unknown_like_gives_not_found_response(): void
{ {
$response = $this->get('/likes/202'); $response = $this->get('/likes/202');
$response->assertNotFound(); $response->assertNotFound();

View file

@ -25,7 +25,7 @@ class MicropubControllerTest extends TestCase
use TestToken; use TestToken;
#[Test] #[Test]
public function micropubGetRequestWithoutTokenReturnsErrorResponse(): void public function micropub_get_request_without_token_returns_error_response(): void
{ {
$response = $this->get('/api/post'); $response = $this->get('/api/post');
$response->assertStatus(401); $response->assertStatus(401);
@ -33,7 +33,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubGetRequestWithoutValidTokenReturnsErrorResponse(): void public function micropub_get_request_without_valid_token_returns_error_response(): void
{ {
$response = $this->get('/api/post', ['HTTP_Authorization' => 'Bearer abc123']); $response = $this->get('/api/post', ['HTTP_Authorization' => 'Bearer abc123']);
$response->assertStatus(400); $response->assertStatus(400);
@ -45,7 +45,7 @@ class MicropubControllerTest extends TestCase
* 200 response. Check token information is also returned in the response. * 200 response. Check token information is also returned in the response.
*/ */
#[Test] #[Test]
public function micropubGetRequestWithValidTokenReturnsOkResponse(): void public function micropub_get_request_with_valid_token_returns_ok_response(): void
{ {
$response = $this->get('/api/post', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]); $response = $this->get('/api/post', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]);
$response->assertStatus(200); $response->assertStatus(200);
@ -53,14 +53,14 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientsCanRequestSyndicationTargetsCanBeEmpty(): void public function micropub_clients_can_request_syndication_targets_can_be_empty(): void
{ {
$response = $this->get('/api/post?q=syndicate-to', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]); $response = $this->get('/api/post?q=syndicate-to', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]);
$response->assertJsonFragment(['syndicate-to' => []]); $response->assertJsonFragment(['syndicate-to' => []]);
} }
#[Test] #[Test]
public function micropubClientsCanRequestSyndicationTargetsPopulatesFromModel(): void public function micropub_clients_can_request_syndication_targets_populates_from_model(): void
{ {
$syndicationTarget = SyndicationTarget::factory()->create(); $syndicationTarget = SyndicationTarget::factory()->create();
$response = $this->get('/api/post?q=syndicate-to', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]); $response = $this->get('/api/post?q=syndicate-to', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]);
@ -68,7 +68,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientsCanRequestKnownNearbyPlaces(): void public function micropub_clients_can_request_known_nearby_places(): void
{ {
Place::factory()->create([ Place::factory()->create([
'name' => 'The Bridgewater Pub', 'name' => 'The Bridgewater Pub',
@ -88,21 +88,21 @@ class MicropubControllerTest extends TestCase
$response->assertJson(['places' => [['slug' => 'the-bridgewater-pub']]]); $response->assertJson(['places' => [['slug' => 'the-bridgewater-pub']]]);
}*/ }*/
#[Test] #[Test]
public function returnEmptyResultWhenMicropubClientRequestsKnownNearbyPlaces(): void public function return_empty_result_when_micropub_client_requests_known_nearby_places(): void
{ {
$response = $this->get('/api/post?q=geo:1.23,4.56', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]); $response = $this->get('/api/post?q=geo:1.23,4.56', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]);
$response->assertJson(['places' => []]); $response->assertJson(['places' => []]);
} }
#[Test] #[Test]
public function micropubClientCanRequestEndpointConfig(): void public function micropub_client_can_request_endpoint_config(): void
{ {
$response = $this->get('/api/post?q=config', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]); $response = $this->get('/api/post?q=config', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]);
$response->assertJsonFragment(['media-endpoint' => route('media-endpoint')]); $response->assertJsonFragment(['media-endpoint' => route('media-endpoint')]);
} }
#[Test] #[Test]
public function micropubClientCanCreateNewNote(): void public function micropub_client_can_create_new_note(): void
{ {
$faker = Factory::create(); $faker = Factory::create();
$note = $faker->text; $note = $faker->text;
@ -121,7 +121,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientCanRequestTheNewNoteIsSyndicatedToMastodonAndBluesky(): void public function micropub_client_can_request_the_new_note_is_syndicated_to_mastodon_and_bluesky(): void
{ {
Queue::fake(); Queue::fake();
@ -155,7 +155,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientsCanCreateNewPlaces(): void public function micropub_clients_can_create_new_places(): void
{ {
$response = $this->post( $response = $this->post(
'/api/post', '/api/post',
@ -171,7 +171,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientsCanCreateNewPlacesWithOldLocationSyntax(): void public function micropub_clients_can_create_new_places_with_old_location_syntax(): void
{ {
$response = $this->post( $response = $this->post(
'/api/post', '/api/post',
@ -188,7 +188,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientWebRequestWithInvalidTokenReturnsErrorResponse(): void public function micropub_client_web_request_with_invalid_token_returns_error_response(): void
{ {
$response = $this->post( $response = $this->post(
'/api/post', '/api/post',
@ -203,7 +203,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientWebRequestWithTokenWithoutAnyScopesReturnsErrorResponse(): void public function micropub_client_web_request_with_token_without_any_scopes_returns_error_response(): void
{ {
$response = $this->post( $response = $this->post(
'/api/post', '/api/post',
@ -218,7 +218,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientWebRequestWithTokenWithoutCreateScopesReturnsErrorResponse(): void public function micropub_client_web_request_with_token_without_create_scopes_returns_error_response(): void
{ {
$response = $this->post( $response = $this->post(
'/api/post', '/api/post',
@ -237,7 +237,7 @@ class MicropubControllerTest extends TestCase
* Test a valid micropub requests using JSON syntax creates a new note. * Test a valid micropub requests using JSON syntax creates a new note.
*/ */
#[Test] #[Test]
public function micropubClientApiRequestCreatesNewNote(): void public function micropub_client_api_request_creates_new_note(): void
{ {
Queue::fake(); Queue::fake();
Media::create([ Media::create([
@ -284,7 +284,7 @@ class MicropubControllerTest extends TestCase
* existing self-created place. * existing self-created place.
*/ */
#[Test] #[Test]
public function micropubClientApiRequestCreatesNewNoteWithExistingPlaceInLocationData(): void public function micropub_client_api_request_creates_new_note_with_existing_place_in_location_data(): void
{ {
$place = new Place; $place = new Place;
$place->name = 'Test Place'; $place->name = 'Test Place';
@ -314,7 +314,7 @@ class MicropubControllerTest extends TestCase
* a new place defined in the location block. * a new place defined in the location block.
*/ */
#[Test] #[Test]
public function micropubClientApiRequestCreatesNewNoteWithNewPlaceInLocationData(): void public function micropub_client_api_request_creates_new_note_with_new_place_in_location_data(): void
{ {
$faker = Factory::create(); $faker = Factory::create();
$note = $faker->text; $note = $faker->text;
@ -349,7 +349,7 @@ class MicropubControllerTest extends TestCase
* a new place defined in the location block if there is missing data. * a new place defined in the location block if there is missing data.
*/ */
#[Test] #[Test]
public function micropubClientApiRequestCreatesNewNoteWithoutNewPlaceInLocationData(): void public function micropub_client_api_request_creates_new_note_without_new_place_in_location_data(): void
{ {
$faker = Factory::create(); $faker = Factory::create();
$note = $faker->text; $note = $faker->text;
@ -382,7 +382,7 @@ class MicropubControllerTest extends TestCase
* error. Also check the message. * error. Also check the message.
*/ */
#[Test] #[Test]
public function micropubClientApiRequestWithoutTokenReturnsError(): void public function micropub_client_api_request_without_token_returns_error(): void
{ {
$faker = Factory::create(); $faker = Factory::create();
$note = $faker->text; $note = $faker->text;
@ -408,7 +408,7 @@ class MicropubControllerTest extends TestCase
* an error. Also check the message. * an error. Also check the message.
*/ */
#[Test] #[Test]
public function micropubClientApiRequestWithTokenWithInsufficientPermissionReturnsError(): void public function micropub_client_api_request_with_token_with_insufficient_permission_returns_error(): void
{ {
$faker = Factory::create(); $faker = Factory::create();
$note = $faker->text; $note = $faker->text;
@ -431,7 +431,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientApiRequestForUnsupportedPostTypeReturnsError(): void public function micropub_client_api_request_for_unsupported_post_type_returns_error(): void
{ {
$response = $this->postJson( $response = $this->postJson(
'/api/post', '/api/post',
@ -452,7 +452,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientApiRequestCreatesNewPlace(): void public function micropub_client_api_request_creates_new_place(): void
{ {
$faker = Factory::create(); $faker = Factory::create();
$response = $this->postJson( $response = $this->postJson(
@ -472,7 +472,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientApiRequestCreatesNewPlaceWithUncertaintyParameter(): void public function micropub_client_api_request_creates_new_place_with_uncertainty_parameter(): void
{ {
$faker = Factory::create(); $faker = Factory::create();
$response = $this->postJson( $response = $this->postJson(
@ -492,7 +492,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientApiRequestUpdatesExistingNote(): void public function micropub_client_api_request_updates_existing_note(): void
{ {
$note = Note::factory()->create(); $note = Note::factory()->create();
$response = $this->postJson( $response = $this->postJson(
@ -512,7 +512,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientApiRequestUpdatesNoteSyndicationLinks(): void public function micropub_client_api_request_updates_note_syndication_links(): void
{ {
$note = Note::factory()->create(); $note = Note::factory()->create();
$response = $this->postJson( $response = $this->postJson(
@ -539,7 +539,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientApiRequestAddsImageToNote(): void public function micropub_client_api_request_adds_image_to_note(): void
{ {
$note = Note::factory()->create(); $note = Note::factory()->create();
$response = $this->postJson( $response = $this->postJson(
@ -562,7 +562,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientApiRequestReturnsErrorTryingToUpdateNonNoteModel(): void public function micropub_client_api_request_returns_error_trying_to_update_non_note_model(): void
{ {
$response = $this->postJson( $response = $this->postJson(
'/api/post', '/api/post',
@ -581,7 +581,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientApiRequestReturnsErrorTryingToUpdateNonExistingNote(): void public function micropub_client_api_request_returns_error_trying_to_update_non_existing_note(): void
{ {
$response = $this->postJson( $response = $this->postJson(
'/api/post', '/api/post',
@ -600,7 +600,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientApiRequestReturnsErrorWhenTryingToUpdateUnsupportedProperty(): void public function micropub_client_api_request_returns_error_when_trying_to_update_unsupported_property(): void
{ {
$note = Note::factory()->create(); $note = Note::factory()->create();
$response = $this->postJson( $response = $this->postJson(
@ -620,7 +620,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientApiRequestWithTokenWithInsufficientScopeReturnsError(): void public function micropub_client_api_request_with_token_with_insufficient_scope_returns_error(): void
{ {
$response = $this->postJson( $response = $this->postJson(
'/api/post', '/api/post',
@ -639,7 +639,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientApiRequestCanReplaceNoteSyndicationTargets(): void public function micropub_client_api_request_can_replace_note_syndication_targets(): void
{ {
$note = Note::factory()->create(); $note = Note::factory()->create();
$response = $this->postJson( $response = $this->postJson(
@ -666,7 +666,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientWebRequestCanEncodeTokenWithinTheForm(): void public function micropub_client_web_request_can_encode_token_within_the_form(): void
{ {
$faker = Factory::create(); $faker = Factory::create();
$note = $faker->text; $note = $faker->text;
@ -684,7 +684,7 @@ class MicropubControllerTest extends TestCase
} }
#[Test] #[Test]
public function micropubClientApiRequestCreatesArticlesWhenItIncludesTheNameProperty(): void public function micropub_client_api_request_creates_articles_when_it_includes_the_name_property(): void
{ {
$faker = Factory::create(); $faker = Factory::create();
$name = $faker->text(50); $name = $faker->text(50);

View file

@ -21,7 +21,7 @@ class MicropubMediaTest extends TestCase
use TestToken; use TestToken;
#[Test] #[Test]
public function emptyResponseForLastUploadWhenNoneFound(): void public function empty_response_for_last_upload_when_none_found(): void
{ {
// Make sure theres no media // Make sure theres no media
$this->assertCount(0, Media::all()); $this->assertCount(0, Media::all());
@ -35,7 +35,7 @@ class MicropubMediaTest extends TestCase
} }
#[Test] #[Test]
public function getRequestWithInvalidTokenReturnsErrorResponse(): void public function get_request_with_invalid_token_returns_error_response(): void
{ {
$response = $this->get( $response = $this->get(
'/api/media?q=last', '/api/media?q=last',
@ -46,7 +46,7 @@ class MicropubMediaTest extends TestCase
} }
#[Test] #[Test]
public function getRequestWithTokenWithoutScopeReturnsErrorResponse(): void public function get_request_with_token_without_scope_returns_error_response(): void
{ {
$response = $this->get( $response = $this->get(
'/api/media?q=last', '/api/media?q=last',
@ -57,7 +57,7 @@ class MicropubMediaTest extends TestCase
} }
#[Test] #[Test]
public function getRequestWithTokenWithInsufficientScopeReturnsErrorResponse(): void public function get_request_with_token_with_insufficient_scope_returns_error_response(): void
{ {
$response = $this->get( $response = $this->get(
'/api/media?q=last', '/api/media?q=last',
@ -68,7 +68,7 @@ class MicropubMediaTest extends TestCase
} }
#[Test] #[Test]
public function emptyGetRequestWithTokenReceivesOkResponse(): void public function empty_get_request_with_token_receives_ok_response(): void
{ {
$response = $this->get( $response = $this->get(
'/api/media', '/api/media',
@ -79,7 +79,7 @@ class MicropubMediaTest extends TestCase
} }
#[Test] #[Test]
public function clientCanListLastUpload(): void public function client_can_list_last_upload(): void
{ {
Queue::fake(); Queue::fake();
$file = __DIR__ . '/../aaron.png'; $file = __DIR__ . '/../aaron.png';
@ -108,7 +108,7 @@ class MicropubMediaTest extends TestCase
} }
#[Test] #[Test]
public function clientCanSourceUploads(): void public function client_can_source_uploads(): void
{ {
Queue::fake(); Queue::fake();
$file = __DIR__ . '/../aaron.png'; $file = __DIR__ . '/../aaron.png';
@ -140,7 +140,7 @@ class MicropubMediaTest extends TestCase
} }
#[Test] #[Test]
public function clientCanSourceUploadsWithLimit(): void public function client_can_source_uploads_with_limit(): void
{ {
Queue::fake(); Queue::fake();
$file = __DIR__ . '/../aaron.png'; $file = __DIR__ . '/../aaron.png';
@ -174,7 +174,7 @@ class MicropubMediaTest extends TestCase
} }
#[Test] #[Test]
public function mediaEndpointUploadRequiresFile(): void public function media_endpoint_upload_requires_file(): void
{ {
$response = $this->post( $response = $this->post(
'/api/media', '/api/media',
@ -190,7 +190,7 @@ class MicropubMediaTest extends TestCase
} }
#[Test] #[Test]
public function errorResponseForUnknownQValue(): void public function error_response_for_unknown_q_value(): void
{ {
$response = $this->get( $response = $this->get(
'/api/media?q=unknown', '/api/media?q=unknown',
@ -201,7 +201,7 @@ class MicropubMediaTest extends TestCase
} }
#[Test] #[Test]
public function optionsRequestReturnsCorsResponse(): void public function options_request_returns_cors_response(): void
{ {
$response = $this->options('/api/media'); $response = $this->options('/api/media');
@ -210,7 +210,7 @@ class MicropubMediaTest extends TestCase
} }
#[Test] #[Test]
public function mediaEndpointRequestWithInvalidTokenReturns400Response(): void public function media_endpoint_request_with_invalid_token_returns400_response(): void
{ {
$response = $this->post( $response = $this->post(
'/api/media', '/api/media',
@ -222,7 +222,7 @@ class MicropubMediaTest extends TestCase
} }
#[Test] #[Test]
public function mediaEndpointRequestWithTokenWithNoScopeReturns400Response(): void public function media_endpoint_request_with_token_with_no_scope_returns400_response(): void
{ {
$response = $this->post( $response = $this->post(
'/api/media', '/api/media',
@ -234,7 +234,7 @@ class MicropubMediaTest extends TestCase
} }
#[Test] #[Test]
public function mediaEndpointRequestWithInsufficientTokenScopesReturns401Response(): void public function media_endpoint_request_with_insufficient_token_scopes_returns401_response(): void
{ {
$response = $this->post( $response = $this->post(
'/api/media', '/api/media',
@ -248,7 +248,7 @@ class MicropubMediaTest extends TestCase
} }
#[Test] #[Test]
public function mediaEndpointUploadFile(): void public function media_endpoint_upload_file(): void
{ {
Queue::fake(); Queue::fake();
$file = __DIR__ . '/../aaron.png'; $file = __DIR__ . '/../aaron.png';
@ -271,7 +271,7 @@ class MicropubMediaTest extends TestCase
} }
#[Test] #[Test]
public function mediaEndpointUploadAudioFile(): void public function media_endpoint_upload_audio_file(): void
{ {
Queue::fake(); Queue::fake();
$file = __DIR__ . '/../audio.mp3'; $file = __DIR__ . '/../audio.mp3';
@ -294,7 +294,7 @@ class MicropubMediaTest extends TestCase
} }
#[Test] #[Test]
public function mediaEndpointUploadVideoFile(): void public function media_endpoint_upload_video_file(): void
{ {
Queue::fake(); Queue::fake();
$file = __DIR__ . '/../video.ogv'; $file = __DIR__ . '/../video.ogv';
@ -317,7 +317,7 @@ class MicropubMediaTest extends TestCase
} }
#[Test] #[Test]
public function mediaEndpointUploadDocumentFile(): void public function media_endpoint_upload_document_file(): void
{ {
Queue::fake(); Queue::fake();
@ -339,7 +339,7 @@ class MicropubMediaTest extends TestCase
} }
#[Test] #[Test]
public function mediaEndpointUploadInvalidFileReturnsError(): void public function media_endpoint_upload_invalid_file_returns_error(): void
{ {
Queue::fake(); Queue::fake();
Storage::fake('local'); Storage::fake('local');

View file

@ -18,7 +18,7 @@ class NotesControllerTest extends TestCase
* mean the database is being hit. * mean the database is being hit.
*/ */
#[Test] #[Test]
public function notesPageLoads(): void public function notes_page_loads(): void
{ {
$response = $this->get('/notes'); $response = $this->get('/notes');
$response->assertStatus(200); $response->assertStatus(200);
@ -28,7 +28,7 @@ class NotesControllerTest extends TestCase
* Test a specific note. * Test a specific note.
*/ */
#[Test] #[Test]
public function specificNotePageLoads(): void public function specific_note_page_loads(): void
{ {
$note = Note::factory()->create(); $note = Note::factory()->create();
$response = $this->get($note->uri); $response = $this->get($note->uri);
@ -47,7 +47,7 @@ class NotesControllerTest extends TestCase
* Test that `/note/{decID}` redirects to `/notes/{nb60id}`. * Test that `/note/{decID}` redirects to `/notes/{nb60id}`.
*/ */
#[Test] #[Test]
public function oldNoteUrlsRedirect(): void public function old_note_urls_redirect(): void
{ {
$note = Note::factory()->create(); $note = Note::factory()->create();
$response = $this->get('/note/' . $note->id); $response = $this->get('/note/' . $note->id);
@ -58,21 +58,21 @@ class NotesControllerTest extends TestCase
* Visit the tagged page and check the tag view data. * Visit the tagged page and check the tag view data.
*/ */
#[Test] #[Test]
public function taggedNotesPageLoads(): void public function tagged_notes_page_loads(): void
{ {
$response = $this->get('/notes/tagged/beer'); $response = $this->get('/notes/tagged/beer');
$response->assertViewHas('tag', 'beer'); $response->assertViewHas('tag', 'beer');
} }
#[Test] #[Test]
public function unknownNoteGives404(): void public function unknown_note_gives404(): void
{ {
$response = $this->get('/notes/112233'); $response = $this->get('/notes/112233');
$response->assertNotFound(); $response->assertNotFound();
} }
#[Test] #[Test]
public function checkNoteIdNotOutOfRange(): void public function check_note_id_not_out_of_range(): void
{ {
$response = $this->get('/notes/photou-photologo'); $response = $this->get('/notes/photou-photologo');
$response->assertNotFound(); $response->assertNotFound();

View file

@ -16,7 +16,7 @@ class OwnYourGramTest extends TestCase
use TestToken; use TestToken;
#[Test] #[Test]
public function postingInstagramUrlSavesMediaPath(): void public function posting_instagram_url_saves_media_path(): void
{ {
$response = $this->json( $response = $this->json(
'POST', 'POST',

View file

@ -27,7 +27,7 @@ class ParseCachedWebMentionsTest extends TestCase
} }
#[Test] #[Test]
public function parseWebmentionHtml(): void public function parse_webmention_html(): void
{ {
$webmentionAaron = WebMention::factory()->create([ $webmentionAaron = WebMention::factory()->create([
'source' => 'https://aaronpk.localhost/reply/1', 'source' => 'https://aaronpk.localhost/reply/1',

View file

@ -17,7 +17,7 @@ class PlacesTest extends TestCase
* Test the `/places` page for OK response. * Test the `/places` page for OK response.
*/ */
#[Test] #[Test]
public function placesPageLoads(): void public function places_page_loads(): void
{ {
$response = $this->get('/places'); $response = $this->get('/places');
$response->assertStatus(200); $response->assertStatus(200);
@ -27,7 +27,7 @@ class PlacesTest extends TestCase
* Test a specific place. * Test a specific place.
*/ */
#[Test] #[Test]
public function singlePlacePageLoads(): void public function single_place_page_loads(): void
{ {
$place = Place::factory()->create(); $place = Place::factory()->create();
$response = $this->get($place->uri); $response = $this->get($place->uri);
@ -35,7 +35,7 @@ class PlacesTest extends TestCase
} }
#[Test] #[Test]
public function unknownPlaceGives404() public function unknown_place_gives404()
{ {
$response = $this->get('/places/unknown'); $response = $this->get('/places/unknown');
$response->assertNotFound(); $response->assertNotFound();

View file

@ -17,7 +17,7 @@ class ReDownloadWebMentionsTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function downloadJobGetsQueued(): void public function download_job_gets_queued(): void
{ {
Queue::fake(); Queue::fake();

View file

@ -11,7 +11,7 @@ use Tests\TestCase;
class SearchTest extends TestCase class SearchTest extends TestCase
{ {
#[Test] #[Test]
public function searchEndpointReturnsResults(): void public function search_endpoint_returns_results(): void
{ {
Note::factory(10)->create(); Note::factory(10)->create();
Note::Factory()->create(['note' => 'hello world']); Note::Factory()->create(['note' => 'hello world']);

View file

@ -21,7 +21,7 @@ class SwarmTest extends TestCase
* Given a check in to Foursquare, this is the content Ownyourswarm will post to us. * Given a check in to Foursquare, this is the content Ownyourswarm will post to us.
*/ */
#[Test] #[Test]
public function mockedOwnyourswarmRequestWithFoursquare(): void public function mocked_ownyourswarm_request_with_foursquare(): void
{ {
Queue::fake(); Queue::fake();
@ -68,7 +68,7 @@ class SwarmTest extends TestCase
* OpenStreetMap data. * OpenStreetMap data.
*/ */
#[Test] #[Test]
public function mockedOwnyourswarmRequestWithOsm(): void public function mocked_ownyourswarm_request_with_osm(): void
{ {
Queue::fake(); Queue::fake();
@ -110,7 +110,7 @@ class SwarmTest extends TestCase
* This request would actually come from another client than OwnYourSwarm, as that would include a Foursquare URL * This request would actually come from another client than OwnYourSwarm, as that would include a Foursquare URL
*/ */
#[Test] #[Test]
public function mockedOwnyourswarmRequestWithoutKnownExternalUrl(): void public function mocked_ownyourswarm_request_without_known_external_url(): void
{ {
Queue::fake(); Queue::fake();
@ -149,7 +149,7 @@ class SwarmTest extends TestCase
} }
#[Test] #[Test]
public function mockedOwnyourswarmRequestWithNoTextContent(): void public function mocked_ownyourswarm_request_with_no_text_content(): void
{ {
$response = $this->json( $response = $this->json(
'POST', 'POST',
@ -186,7 +186,7 @@ class SwarmTest extends TestCase
} }
#[Test] #[Test]
public function mockedOwnyourswarmRequestSavesJustThePostWhenAnErrorOccursInTheCheckinData(): void public function mocked_ownyourswarm_request_saves_just_the_post_when_an_error_occurs_in_the_checkin_data(): void
{ {
Queue::fake(); Queue::fake();
@ -224,7 +224,7 @@ class SwarmTest extends TestCase
} }
#[Test] #[Test]
public function mockedOwnyourswarmRequestWithHAdrLocation(): void public function mocked_ownyourswarm_request_with_h_adr_location(): void
{ {
Queue::fake(); Queue::fake();
@ -270,7 +270,7 @@ class SwarmTest extends TestCase
} }
#[Test] #[Test]
public function ownyourswarmCheckinTestUsingRealData(): void public function ownyourswarm_checkin_test_using_real_data(): void
{ {
$response = $this->json( $response = $this->json(
'POST', 'POST',

View file

@ -19,7 +19,7 @@ class TokenServiceTest extends TestCase
* the APP_KEY, to test, we shall create a token, and then verify it. * the APP_KEY, to test, we shall create a token, and then verify it.
*/ */
#[Test] #[Test]
public function tokenserviceCreatesAndValidatesTokens(): void public function tokenservice_creates_and_validates_tokens(): void
{ {
$tokenService = new TokenService; $tokenService = new TokenService;
$data = [ $data = [
@ -38,7 +38,7 @@ class TokenServiceTest extends TestCase
} }
#[Test] #[Test]
public function tokensWithDifferentSigningKeyThrowsException(): void public function tokens_with_different_signing_key_throws_exception(): void
{ {
$this->expectException(RequiredConstraintsViolated::class); $this->expectException(RequiredConstraintsViolated::class);

View file

@ -16,7 +16,7 @@ class WebMentionsControllerTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function webmentionEndpointCanServeBrowserRequest(): void public function webmention_endpoint_can_serve_browser_request(): void
{ {
$response = $this->get('/webmention'); $response = $this->get('/webmention');
$response->assertViewIs('webmention-endpoint'); $response->assertViewIs('webmention-endpoint');
@ -26,7 +26,7 @@ class WebMentionsControllerTest extends TestCase
* Test webmentions without source and target are rejected. * Test webmentions without source and target are rejected.
*/ */
#[Test] #[Test]
public function webmentionsWithoutSourceAndTargetAreRejected(): void public function webmentions_without_source_and_target_are_rejected(): void
{ {
$response = $this->call('POST', '/webmention', ['source' => 'https://example.org/post/123']); $response = $this->call('POST', '/webmention', ['source' => 'https://example.org/post/123']);
$response->assertStatus(400); $response->assertStatus(400);
@ -38,7 +38,7 @@ class WebMentionsControllerTest extends TestCase
* In this case an invalid target is a URL that doesnt exist on our domain. * In this case an invalid target is a URL that doesnt exist on our domain.
*/ */
#[Test] #[Test]
public function invalidTargetReturnsErrorResponse(): void public function invalid_target_returns_error_response(): void
{ {
$response = $this->call('POST', '/webmention', [ $response = $this->call('POST', '/webmention', [
'source' => 'https://example.org/post/123', 'source' => 'https://example.org/post/123',
@ -51,7 +51,7 @@ class WebMentionsControllerTest extends TestCase
* Test blog target gets a 501 response due to our not supporting it. * Test blog target gets a 501 response due to our not supporting it.
*/ */
#[Test] #[Test]
public function blogTargetReturns501Response(): void public function blog_target_returns501_response(): void
{ {
$response = $this->call('POST', '/webmention', [ $response = $this->call('POST', '/webmention', [
'source' => 'https://example.org/post/123', 'source' => 'https://example.org/post/123',
@ -64,7 +64,7 @@ class WebMentionsControllerTest extends TestCase
* Test that a non-existent note gives a 400 response. * Test that a non-existent note gives a 400 response.
*/ */
#[Test] #[Test]
public function nonexistentNoteReturnsErrorResponse(): void public function nonexistent_note_returns_error_response(): void
{ {
$response = $this->call('POST', '/webmention', [ $response = $this->call('POST', '/webmention', [
'source' => 'https://example.org/post/123', 'source' => 'https://example.org/post/123',
@ -74,7 +74,7 @@ class WebMentionsControllerTest extends TestCase
} }
#[Test] #[Test]
public function legitimateWebmentionTriggersProcessWebmentionJob(): void public function legitimate_webmention_triggers_process_webmention_job(): void
{ {
Queue::fake(); Queue::fake();

View file

@ -15,7 +15,7 @@ class ArticlesTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function titleSlugIsGeneratedAutomatically(): void public function title_slug_is_generated_automatically(): void
{ {
$article = new Article; $article = new Article;
$article->title = 'My Title'; $article->title = 'My Title';
@ -26,7 +26,7 @@ class ArticlesTest extends TestCase
} }
#[Test] #[Test]
public function markdownContentIsConverted(): void public function markdown_content_is_converted(): void
{ {
$article = new Article; $article = new Article;
$article->main = 'Some *markdown*'; $article->main = 'Some *markdown*';
@ -35,7 +35,7 @@ class ArticlesTest extends TestCase
} }
#[Test] #[Test]
public function weGenerateTheDifferentTimeAttributes(): void public function we_generate_the_different_time_attributes(): void
{ {
$article = Article::create([ $article = Article::create([
'title' => 'Test', 'title' => 'Test',
@ -49,7 +49,7 @@ class ArticlesTest extends TestCase
} }
#[Test] #[Test]
public function weGenerateTheArticleLinkFromTheSlug(): void public function we_generate_the_article_link_from_the_slug(): void
{ {
$article = Article::create([ $article = Article::create([
'title' => 'Test', 'title' => 'Test',
@ -64,7 +64,7 @@ class ArticlesTest extends TestCase
} }
#[Test] #[Test]
public function dateScopeReturnsExpectedArticles(): void public function date_scope_returns_expected_articles(): void
{ {
Article::factory()->create([ Article::factory()->create([
'created_at' => Carbon::now()->subYear()->toDateTimeString(), 'created_at' => Carbon::now()->subYear()->toDateTimeString(),
@ -83,7 +83,7 @@ class ArticlesTest extends TestCase
} }
#[Test] #[Test]
public function dateScopeReturnsExpectedArticlesForDecember(): void public function date_scope_returns_expected_articles_for_december(): void
{ {
Article::factory()->create([ Article::factory()->create([
'created_at' => Carbon::now()->setDay(11)->setMonth(11)->toDateTimeString(), 'created_at' => Carbon::now()->setDay(11)->setMonth(11)->toDateTimeString(),

View file

@ -27,7 +27,7 @@ class BookmarksTest extends TestCase
}*/ }*/
#[Test] #[Test]
public function archiveLinkMethodCallsArchiveService(): void public function archive_link_method_calls_archive_service(): void
{ {
$mock = new MockHandler([ $mock = new MockHandler([
new Response(200, ['Content-Location' => '/web/1234/example.org']), new Response(200, ['Content-Location' => '/web/1234/example.org']),
@ -40,7 +40,7 @@ class BookmarksTest extends TestCase
} }
#[Test] #[Test]
public function archiveLinkMethodThrowsAnExceptionOnError(): void public function archive_link_method_throws_an_exception_on_error(): void
{ {
$this->expectException(InternetArchiveException::class); $this->expectException(InternetArchiveException::class);
@ -54,7 +54,7 @@ class BookmarksTest extends TestCase
} }
#[Test] #[Test]
public function archiveLinkMethodThrowsAnExceptionIfNoLocationReturned(): void public function archive_link_method_throws_an_exception_if_no_location_returned(): void
{ {
$this->expectException(InternetArchiveException::class); $this->expectException(InternetArchiveException::class);

View file

@ -11,7 +11,7 @@ use Tests\TestCase;
class HelpersTest extends TestCase class HelpersTest extends TestCase
{ {
#[Test] #[Test]
public function normalizeUrlIsIdempotent(): void public function normalize_url_is_idempotent(): void
{ {
$input = 'http://example.org:80/index.php?foo=bar&baz=1'; $input = 'http://example.org:80/index.php?foo=bar&baz=1';
$this->assertEquals(normalize_url(normalize_url($input)), normalize_url($input)); $this->assertEquals(normalize_url(normalize_url($input)), normalize_url($input));
@ -19,13 +19,13 @@ class HelpersTest extends TestCase
#[Test] #[Test]
#[DataProvider('urlProvider')] #[DataProvider('urlProvider')]
public function normalizeUrlOnDataProvider(string $input, string $output): void public function normalize_url_on_data_provider(string $input, string $output): void
{ {
$this->assertEquals($output, normalize_url($input)); $this->assertEquals($output, normalize_url($input));
} }
#[Test] #[Test]
public function prettyPrintJson(): void public function pretty_print_json(): void
{ {
// phpcs:disable Generic.Files.LineLength.TooLong // phpcs:disable Generic.Files.LineLength.TooLong
$json = <<<'JSON' $json = <<<'JSON'

View file

@ -14,7 +14,7 @@ class AddClientToDatabaseJobTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function clientIsAddedToDatabaseByJob(): void public function client_is_added_to_database_by_job(): void
{ {
$job = new AddClientToDatabase('https://example.org/client'); $job = new AddClientToDatabase('https://example.org/client');
$job->handle(); $job->handle();

View file

@ -25,7 +25,7 @@ class DownloadWebMentionJobTest extends TestCase
} }
#[Test] #[Test]
public function htmlIsSavedByJob(): void public function html_is_saved_by_job(): void
{ {
$this->assertFileDoesNotExist(storage_path('HTML/https')); $this->assertFileDoesNotExist(storage_path('HTML/https'));
$source = 'https://example.org/reply/1'; $source = 'https://example.org/reply/1';
@ -53,7 +53,7 @@ class DownloadWebMentionJobTest extends TestCase
} }
#[Test] #[Test]
public function htmlAndBackupSavedByJob(): void public function html_and_backup_saved_by_job(): void
{ {
$this->assertFileDoesNotExist(storage_path('HTML/https')); $this->assertFileDoesNotExist(storage_path('HTML/https'));
$source = 'https://example.org/reply/1'; $source = 'https://example.org/reply/1';
@ -88,7 +88,7 @@ class DownloadWebMentionJobTest extends TestCase
} }
#[Test] #[Test]
public function indexHtmlFileIsSavedByJobForUrlsEndingWithSlash(): void public function index_html_file_is_saved_by_job_for_urls_ending_with_slash(): void
{ {
$this->assertFileDoesNotExist(storage_path('HTML/https')); $this->assertFileDoesNotExist(storage_path('HTML/https'));
$source = 'https://example.org/reply-one/'; $source = 'https://example.org/reply-one/';

View file

@ -19,7 +19,7 @@ class ProcessBookmarkJobTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function archiveLinkIsSavedByJobAndScreenshotJobIsQueued(): void public function archive_link_is_saved_by_job_and_screenshot_job_is_queued(): void
{ {
Queue::fake(); Queue::fake();
@ -40,7 +40,7 @@ class ProcessBookmarkJobTest extends TestCase
} }
#[Test] #[Test]
public function archiveLinkSavedAsNullWhenExceptionThrown(): void public function archive_link_saved_as_null_when_exception_thrown(): void
{ {
Queue::fake(); Queue::fake();

View file

@ -13,7 +13,7 @@ use Tests\TestCase;
class ProcessMediaJobTest extends TestCase class ProcessMediaJobTest extends TestCase
{ {
#[Test] #[Test]
public function nonMediaFilesAreNotSaved(): void public function non_media_files_are_not_saved(): void
{ {
$manager = app()->make(ImageManager::class); $manager = app()->make(ImageManager::class);
Storage::disk('local')->put('media/file.txt', 'This is not an image'); Storage::disk('local')->put('media/file.txt', 'This is not an image');
@ -24,7 +24,7 @@ class ProcessMediaJobTest extends TestCase
} }
#[Test] #[Test]
public function smallImagesAreNotResized(): void public function small_images_are_not_resized(): void
{ {
$manager = app()->make(ImageManager::class); $manager = app()->make(ImageManager::class);
Storage::disk('local')->put('media/aaron.png', file_get_contents(__DIR__ . '/../../aaron.png')); Storage::disk('local')->put('media/aaron.png', file_get_contents(__DIR__ . '/../../aaron.png'));
@ -39,7 +39,7 @@ class ProcessMediaJobTest extends TestCase
} }
#[Test] #[Test]
public function largeImagesHaveSmallerImagesCreated(): void public function large_images_have_smaller_images_created(): void
{ {
$manager = app()->make(ImageManager::class); $manager = app()->make(ImageManager::class);
Storage::disk('local')->put('media/test-image.jpg', file_get_contents(__DIR__.'/../../test-image.jpg')); Storage::disk('local')->put('media/test-image.jpg', file_get_contents(__DIR__.'/../../test-image.jpg'));

View file

@ -34,7 +34,7 @@ class ProcessWebMentionJobTest extends TestCase
} }
#[Test] #[Test]
public function failureGettingWebmentionThrowsAnException(): void public function failure_getting_webmention_throws_an_exception(): void
{ {
$this->expectException(RemoteContentNotFoundException::class); $this->expectException(RemoteContentNotFoundException::class);
@ -53,7 +53,7 @@ class ProcessWebMentionJobTest extends TestCase
} }
#[Test] #[Test]
public function newWebmentionGetsSavedByJob(): void public function new_webmention_gets_saved_by_job(): void
{ {
Queue::fake(); Queue::fake();
@ -85,7 +85,7 @@ class ProcessWebMentionJobTest extends TestCase
} }
#[Test] #[Test]
public function existingWebmentionGetsUpdatedByJob(): void public function existing_webmention_gets_updated_by_job(): void
{ {
Queue::fake(); Queue::fake();
@ -122,7 +122,7 @@ class ProcessWebMentionJobTest extends TestCase
} }
#[Test] #[Test]
public function webmentionReplyGetsDeletedWhenReplyToValueChanges(): void public function webmention_reply_gets_deleted_when_reply_to_value_changes(): void
{ {
$parser = new Parser; $parser = new Parser;
@ -159,7 +159,7 @@ class ProcessWebMentionJobTest extends TestCase
} }
#[Test] #[Test]
public function webmentionLikeGetsDeletedWhenLikeOfValueChanges(): void public function webmention_like_gets_deleted_when_like_of_value_changes(): void
{ {
$parser = new Parser; $parser = new Parser;
@ -196,7 +196,7 @@ class ProcessWebMentionJobTest extends TestCase
} }
#[Test] #[Test]
public function webmentionRepostGetsDeletedWhenRepostOfValueChanges(): void public function webmention_repost_gets_deleted_when_repost_of_value_changes(): void
{ {
$parser = new Parser; $parser = new Parser;

View file

@ -26,7 +26,7 @@ class SaveProfileImageJobTest extends TestCase
} }
#[Test] #[Test]
public function authorshipAlgorithmReturnsNullOnException(): void public function authorship_algorithm_returns_null_on_exception(): void
{ {
$mf = ['items' => []]; $mf = ['items' => []];
$authorship = $this->createMock(Authorship::class); $authorship = $this->createMock(Authorship::class);
@ -38,7 +38,7 @@ class SaveProfileImageJobTest extends TestCase
} }
#[Test] #[Test]
public function weDoNotProcessTwitterImages(): void public function we_do_not_process_twitter_images(): void
{ {
$mf = ['items' => []]; $mf = ['items' => []];
$author = [ $author = [
@ -56,7 +56,7 @@ class SaveProfileImageJobTest extends TestCase
} }
#[Test] #[Test]
public function remoteAuthorImagesAreSavedLocally(): void public function remote_author_images_are_saved_locally(): void
{ {
$mock = new MockHandler([ $mock = new MockHandler([
new Response(200, ['Content-Type' => 'image/jpeg'], 'fake jpeg image'), new Response(200, ['Content-Type' => 'image/jpeg'], 'fake jpeg image'),
@ -81,7 +81,7 @@ class SaveProfileImageJobTest extends TestCase
} }
#[Test] #[Test]
public function localDefaultAuthorImageIsUsedAsFallback(): void public function local_default_author_image_is_used_as_fallback(): void
{ {
$mock = new MockHandler([ $mock = new MockHandler([
new Response(404), new Response(404),
@ -109,7 +109,7 @@ class SaveProfileImageJobTest extends TestCase
} }
#[Test] #[Test]
public function weGetUrlFromPhotoObjectIfAltTextIsProvided(): void public function we_get_url_from_photo_object_if_alt_text_is_provided(): void
{ {
$mock = new MockHandler([ $mock = new MockHandler([
new Response(200, ['Content-Type' => 'image/jpeg'], 'fake jpeg image'), new Response(200, ['Content-Type' => 'image/jpeg'], 'fake jpeg image'),
@ -137,7 +137,7 @@ class SaveProfileImageJobTest extends TestCase
} }
#[Test] #[Test]
public function useFirstUrlIfMultipleHomepagesAreProvided(): void public function use_first_url_if_multiple_homepages_are_provided(): void
{ {
$mock = new MockHandler([ $mock = new MockHandler([
new Response(200, ['Content-Type' => 'image/jpeg'], 'fake jpeg image'), new Response(200, ['Content-Type' => 'image/jpeg'], 'fake jpeg image'),

View file

@ -21,7 +21,7 @@ class SaveScreenshotJobTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function screenshotIsSavedByJob(): void public function screenshot_is_saved_by_job(): void
{ {
Storage::fake('public'); Storage::fake('public');
$guzzleMock = new MockHandler([ $guzzleMock = new MockHandler([
@ -86,7 +86,7 @@ class SaveScreenshotJobTest extends TestCase
} }
#[Test] #[Test]
public function screenshotJobHandlesUnfinishedTasks(): void public function screenshot_job_handles_unfinished_tasks(): void
{ {
Storage::fake('public'); Storage::fake('public');
$guzzleMock = new MockHandler([ $guzzleMock = new MockHandler([

View file

@ -16,7 +16,7 @@ use Tests\TestCase;
class SendWebMentionJobTest extends TestCase class SendWebMentionJobTest extends TestCase
{ {
#[Test] #[Test]
public function discoverWebmentionEndpointOnOwnDomain(): void public function discover_webmention_endpoint_on_own_domain(): void
{ {
$note = new Note; $note = new Note;
$job = new SendWebMentions($note); $job = new SendWebMentions($note);
@ -25,7 +25,7 @@ class SendWebMentionJobTest extends TestCase
} }
#[Test] #[Test]
public function discoverWebmentionEndpointFromHeaderLinks(): void public function discover_webmention_endpoint_from_header_links(): void
{ {
$url = 'https://example.org/webmention'; $url = 'https://example.org/webmention';
$mock = new MockHandler([ $mock = new MockHandler([
@ -40,7 +40,7 @@ class SendWebMentionJobTest extends TestCase
} }
#[Test] #[Test]
public function discoverWebmentionEndpointFromHtmlLinkTags(): void public function discover_webmention_endpoint_from_html_link_tags(): void
{ {
$html = '<link rel="webmention" href="https://example.org/webmention">'; $html = '<link rel="webmention" href="https://example.org/webmention">';
$mock = new MockHandler([ $mock = new MockHandler([
@ -58,7 +58,7 @@ class SendWebMentionJobTest extends TestCase
} }
#[Test] #[Test]
public function discoverWebmentionEndpointFromLegacyHtmlMarkup(): void public function discover_webmention_endpoint_from_legacy_html_markup(): void
{ {
$html = '<link rel="http://webmention.org/" href="https://example.org/webmention">'; $html = '<link rel="http://webmention.org/" href="https://example.org/webmention">';
$mock = new MockHandler([ $mock = new MockHandler([
@ -76,14 +76,14 @@ class SendWebMentionJobTest extends TestCase
} }
#[Test] #[Test]
public function ensureEmptyNoteDoesNotTriggerAnyActions(): void public function ensure_empty_note_does_not_trigger_any_actions(): void
{ {
$job = new SendWebMentions(new Note); $job = new SendWebMentions(new Note);
$this->assertNull($job->handle()); $this->assertNull($job->handle());
} }
#[Test] #[Test]
public function weResolveRelativeUris(): void public function we_resolve_relative_uris(): void
{ {
$uri = '/blog/post'; $uri = '/blog/post';
$base = 'https://example.org/'; $base = 'https://example.org/';
@ -92,7 +92,7 @@ class SendWebMentionJobTest extends TestCase
} }
#[Test] #[Test]
public function weSendAWebmentionForANote(): void public function we_send_a_webmention_for_a_note(): void
{ {
$html = '<link rel="http://webmention.org/" href="https://example.org/webmention">'; $html = '<link rel="http://webmention.org/" href="https://example.org/webmention">';
$mock = new MockHandler([ $mock = new MockHandler([
@ -112,7 +112,7 @@ class SendWebMentionJobTest extends TestCase
} }
#[Test] #[Test]
public function linksInNotesCanNotSupportWebmentions(): void public function links_in_notes_can_not_support_webmentions(): void
{ {
$mock = new MockHandler([ $mock = new MockHandler([
// URLs with commas currently break the parse function Im using // URLs with commas currently break the parse function Im using

View file

@ -19,7 +19,7 @@ class SyndicateNoteToBlueskyJobTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function weSyndicateNotesToBluesky(): void public function we_syndicate_notes_to_bluesky(): void
{ {
config(['bridgy.bluesky_token' => 'test']); config(['bridgy.bluesky_token' => 'test']);
$faker = Factory::create(); $faker = Factory::create();
@ -40,7 +40,7 @@ class SyndicateNoteToBlueskyJobTest extends TestCase
} }
#[Test] #[Test]
public function weSyndicateTheOriginalMarkdownToBluesky(): void public function we_syndicate_the_original_markdown_to_bluesky(): void
{ {
config(['bridgy.bluesky_token' => 'test']); config(['bridgy.bluesky_token' => 'test']);
$faker = Factory::create(); $faker = Factory::create();

View file

@ -19,7 +19,7 @@ class SyndicateNoteToMastodonJobTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function weSyndicateNotesToMastodon(): void public function we_syndicate_notes_to_mastodon(): void
{ {
config(['bridgy.mastodon_token' => 'test']); config(['bridgy.mastodon_token' => 'test']);
$faker = Factory::create(); $faker = Factory::create();
@ -40,7 +40,7 @@ class SyndicateNoteToMastodonJobTest extends TestCase
} }
#[Test] #[Test]
public function weSyndicateTheOriginalMarkdown(): void public function we_syndicate_the_original_markdown(): void
{ {
config(['bridgy.mastodon_token' => 'test']); config(['bridgy.mastodon_token' => 'test']);
$faker = Factory::create(); $faker = Factory::create();

View file

@ -14,7 +14,7 @@ class LikesTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function weCanSetTheAuthorUrl(): void public function we_can_set_the_author_url(): void
{ {
$like = new Like; $like = new Like;
$like->author_url = 'https://joe.bloggs/'; $like->author_url = 'https://joe.bloggs/';
@ -22,7 +22,7 @@ class LikesTest extends TestCase
} }
#[Test] #[Test]
public function weDoNotModifyPlainTextContent(): void public function we_do_not_modify_plain_text_content(): void
{ {
$like = new Like; $like = new Like;
$like->url = 'https://example.org/post/123'; $like->url = 'https://example.org/post/123';
@ -33,7 +33,7 @@ class LikesTest extends TestCase
} }
#[Test] #[Test]
public function weCanHandleBlankContent(): void public function we_can_handle_blank_content(): void
{ {
$like = new Like; $like = new Like;
$like->url = 'https://example.org/post/123'; $like->url = 'https://example.org/post/123';
@ -44,7 +44,7 @@ class LikesTest extends TestCase
} }
#[Test] #[Test]
public function htmlLikeContentIsFiltered(): void public function html_like_content_is_filtered(): void
{ {
$htmlEvil = <<<'HTML' $htmlEvil = <<<'HTML'
<div class="h-entry"> <div class="h-entry">

View file

@ -15,7 +15,7 @@ class MediaTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function getTheNoteThatMediaInstanceBelongsTo(): void public function get_the_note_that_media_instance_belongs_to(): void
{ {
$media = Media::factory()->for(Note::factory())->create(); $media = Media::factory()->for(Note::factory())->create();
@ -23,7 +23,7 @@ class MediaTest extends TestCase
} }
#[Test] #[Test]
public function absoluteUrlsAreReturnedUnmodified(): void public function absolute_urls_are_returned_unmodified(): void
{ {
$absoluteUrl = 'https://instagram-cdn.com/image/uuid'; $absoluteUrl = 'https://instagram-cdn.com/image/uuid';
$media = new Media; $media = new Media;

View file

@ -15,7 +15,7 @@ class MicropubClientsTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function weCanGetNotesRelatingToClient(): void public function we_can_get_notes_relating_to_client(): void
{ {
$client = MicropubClient::factory()->make(); $client = MicropubClient::factory()->make();

View file

@ -28,7 +28,7 @@ class NotesTest extends TestCase
* relevant sub-methods. * relevant sub-methods.
*/ */
#[Test] #[Test]
public function getNoteAttributeMethodCallsSubMethods(): void public function get_note_attribute_method_calls_sub_methods(): void
{ {
// phpcs:ignore // phpcs:ignore
$expected = '<p>Having a <a rel="tag" class="p-category" href="/notes/tagged/beer">#beer</a> at the local. 🍺</p>' . PHP_EOL; $expected = '<p>Having a <a rel="tag" class="p-category" href="/notes/tagged/beer">#beer</a> at the local. 🍺</p>' . PHP_EOL;
@ -42,7 +42,7 @@ class NotesTest extends TestCase
* Look for a default image in the contacts h-card for the makeHCards method. * Look for a default image in the contacts h-card for the makeHCards method.
*/ */
#[Test] #[Test]
public function defaultImageUsedAsFallbackInMakehcardsMethod(): void public function default_image_used_as_fallback_in_makehcards_method(): void
{ {
// phpcs:ignore // phpcs:ignore
$expected = '<p>Hi <span class="u-category h-card mini-h-card"> $expected = '<p>Hi <span class="u-category h-card mini-h-card">
@ -71,7 +71,7 @@ class NotesTest extends TestCase
* Look for a specific profile image in the contacts h-card. * Look for a specific profile image in the contacts h-card.
*/ */
#[Test] #[Test]
public function specificProfileImageUsedInMakehcardsMethod(): void public function specific_profile_image_used_in_makehcards_method(): void
{ {
Contact::factory()->create([ Contact::factory()->create([
'nick' => 'aaron', 'nick' => 'aaron',
@ -106,7 +106,7 @@ class NotesTest extends TestCase
* Look for twitter URL when theres no associated contact. * Look for twitter URL when theres no associated contact.
*/ */
#[Test] #[Test]
public function twitterLinkIsCreatedWhenNoContactFound(): void public function twitter_link_is_created_when_no_contact_found(): void
{ {
$expected = '<p>Hi <a href="https://twitter.com/bob">@bob</a></p>' . PHP_EOL; $expected = '<p>Hi <a href="https://twitter.com/bob">@bob</a></p>' . PHP_EOL;
$note = Note::factory()->create([ $note = Note::factory()->create([
@ -116,7 +116,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function weGetLatitudeLongitudeValuesOfAssociatedPlaceOfNote(): void public function we_get_latitude_longitude_values_of_associated_place_of_note(): void
{ {
$place = Place::factory()->create([ $place = Place::factory()->create([
'latitude' => '53.4983', 'latitude' => '53.4983',
@ -130,7 +130,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function whenNoAssociatedPlaceWeGetNullForLatitudeLongitudeValues(): void public function when_no_associated_place_we_get_null_for_latitude_longitude_values(): void
{ {
$note = Note::factory()->create(); $note = Note::factory()->create();
$this->assertNull($note->latitude); $this->assertNull($note->latitude);
@ -138,7 +138,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function weCanGetAddressAttributeForAssociatedPlace(): void public function we_can_get_address_attribute_for_associated_place(): void
{ {
$place = Place::factory()->create([ $place = Place::factory()->create([
'name' => 'The Bridgewater Pub', 'name' => 'The Bridgewater Pub',
@ -152,7 +152,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function deletingNotesAlsoDeletesTagsViaTheEventObserver(): void public function deleting_notes_also_deletes_tags_via_the_event_observer(): void
{ {
// first well create a temporary note to delete // first well create a temporary note to delete
$note = Note::create(['note' => 'temporary #temp']); $note = Note::create(['note' => 'temporary #temp']);
@ -167,7 +167,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function saveBlankNotesAsNull(): void public function save_blank_notes_as_null(): void
{ {
$note = new Note(['note' => '']); $note = new Note(['note' => '']);
@ -175,7 +175,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function reverseGeocodeAnAttraction(): void public function reverse_geocode_an_attraction(): void
{ {
// phpcs:disable Generic.Files.LineLength.TooLong // phpcs:disable Generic.Files.LineLength.TooLong
$json = <<<JSON $json = <<<JSON
@ -200,7 +200,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function reverseGeocodeASuburb(): void public function reverse_geocode_a_suburb(): void
{ {
// phpcs:disable Generic.Files.LineLength.TooLong // phpcs:disable Generic.Files.LineLength.TooLong
$json = <<<JSON $json = <<<JSON
@ -225,7 +225,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function reverseGeocodeACity(): void public function reverse_geocode_a_city(): void
{ {
// Note Ive modified this JSON response so it only contains the // Note Ive modified this JSON response so it only contains the
// city the Uni is in // city the Uni is in
@ -252,7 +252,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function reverseGeocodeACounty(): void public function reverse_geocode_a_county(): void
{ {
// Note Ive removed everything below county to test for queries where // Note Ive removed everything below county to test for queries where
// thats all that is returned // thats all that is returned
@ -276,7 +276,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function reverseGeocodeACountry(): void public function reverse_geocode_a_country(): void
{ {
// Note Ive removed everything below country to test for querires where // Note Ive removed everything below country to test for querires where
// thats all that is returned // thats all that is returned
@ -300,7 +300,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function addImageElementToNoteContentWhenMediaAssociated(): void public function add_image_element_to_note_content_when_media_associated(): void
{ {
$media = Media::factory()->create([ $media = Media::factory()->create([
'type' => 'image', 'type' => 'image',
@ -317,7 +317,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function addVideoElementToNoteContentWhenMediaAssociated(): void public function add_video_element_to_note_content_when_media_associated(): void
{ {
$media = Media::factory()->create([ $media = Media::factory()->create([
'type' => 'video', 'type' => 'video',
@ -334,7 +334,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function addAudioElementToNoteContentWhenMediaAssociated(): void public function add_audio_element_to_note_content_when_media_associated(): void
{ {
$media = Media::factory()->create([ $media = Media::factory()->create([
'type' => 'audio', 'type' => 'audio',
@ -354,7 +354,7 @@ class NotesTest extends TestCase
* @todo Why do we need to provide text? * @todo Why do we need to provide text?
*/ */
#[Test] #[Test]
public function provideTextForBlankContent(): void public function provide_text_for_blank_content(): void
{ {
$note = new Note; $note = new Note;
@ -387,7 +387,7 @@ class NotesTest extends TestCase
* For now, just reply on a cached object instead of actually querying Twitter. * For now, just reply on a cached object instead of actually querying Twitter.
*/ */
#[Test] #[Test]
public function checkInReplyToIsTwitterLink(): void public function check_in_reply_to_is_twitter_link(): void
{ {
$tempContent = (object) [ $tempContent = (object) [
'html' => 'something random', 'html' => 'something random',
@ -402,7 +402,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function latitudeAndLongitudeCanBeParsedFromPlainLocation(): void public function latitude_and_longitude_can_be_parsed_from_plain_location(): void
{ {
$note = Note::factory()->create([ $note = Note::factory()->create([
'location' => '1.23,4.56', 'location' => '1.23,4.56',
@ -413,7 +413,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function addressAttributeCanBeRetrievedFromPlainLocation(): void public function address_attribute_can_be_retrieved_from_plain_location(): void
{ {
Cache::put('1.23,4.56', '<span class="p-country-name">Antarctica</span>'); Cache::put('1.23,4.56', '<span class="p-country-name">Antarctica</span>');
@ -425,7 +425,7 @@ class NotesTest extends TestCase
} }
#[Test] #[Test]
public function mastodonUsernamesAreParsedCorrectly(): void public function mastodon_usernames_are_parsed_correctly(): void
{ {
$expected = '<p>Hi <a href="https://phpc.social/@freekmurze">@freekmurze@phpc.social</a> how are you?</p>' . PHP_EOL; $expected = '<p>Hi <a href="https://phpc.social/@freekmurze">@freekmurze@phpc.social</a> how are you?</p>' . PHP_EOL;
$note = Note::factory()->create([ $note = Note::factory()->create([

View file

@ -18,7 +18,7 @@ class PlacesTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function canRetrieveAssociatedNotes(): void public function can_retrieve_associated_notes(): void
{ {
$place = Place::factory()->create(); $place = Place::factory()->create();
Note::factory(5)->create([ Note::factory(5)->create([
@ -29,7 +29,7 @@ class PlacesTest extends TestCase
} }
#[Test] #[Test]
public function nearMethodReturnsCollection(): void public function near_method_returns_collection(): void
{ {
Place::factory()->create([ Place::factory()->create([
'name' => 'The Bridgewater Pub', 'name' => 'The Bridgewater Pub',
@ -41,7 +41,7 @@ class PlacesTest extends TestCase
} }
#[Test] #[Test]
public function getUri(): void public function get_uri(): void
{ {
$place = Place::factory()->create([ $place = Place::factory()->create([
'name' => 'The Bridgewater Pub', 'name' => 'The Bridgewater Pub',
@ -50,7 +50,7 @@ class PlacesTest extends TestCase
} }
#[Test] #[Test]
public function placeServiceReturnsExistingPlaceBasedOnExternalUrlsSearch(): void public function place_service_returns_existing_place_based_on_external_urls_search(): void
{ {
Place::factory(10)->create(); Place::factory(10)->create();
@ -70,7 +70,7 @@ class PlacesTest extends TestCase
} }
#[Test] #[Test]
public function placeServiceRequiresNameWhenCreatingNewPlace(): void public function place_service_requires_name_when_creating_new_place(): void
{ {
$this->expectException(InvalidArgumentException::class); $this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Missing required name'); $this->expectExceptionMessage('Missing required name');
@ -80,7 +80,7 @@ class PlacesTest extends TestCase
} }
#[Test] #[Test]
public function placeServiceRequiresLatitudeWhenCreatingNewPlace(): void public function place_service_requires_latitude_when_creating_new_place(): void
{ {
$this->expectException(InvalidArgumentException::class); $this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Missing required longitude/latitude'); $this->expectExceptionMessage('Missing required longitude/latitude');
@ -90,7 +90,7 @@ class PlacesTest extends TestCase
} }
#[Test] #[Test]
public function placeServiceCanUpdateExternalUrls(): void public function place_service_can_update_external_urls(): void
{ {
$place = Place::factory()->create([ $place = Place::factory()->create([
'name' => 'The Bridgewater Pub', 'name' => 'The Bridgewater Pub',

View file

@ -17,7 +17,7 @@ class TagsTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function canGetAssociatedNotes(): void public function can_get_associated_notes(): void
{ {
$note = Note::factory()->create(); $note = Note::factory()->create();
$tag = Tag::factory()->create(); $tag = Tag::factory()->create();
@ -26,7 +26,7 @@ class TagsTest extends TestCase
} }
#[Test] #[Test]
public function canGetAssociatedBookmarks(): void public function can_get_associated_bookmarks(): void
{ {
$bookmark = Bookmark::factory()->create(); $bookmark = Bookmark::factory()->create();
$tag = Tag::factory()->create(); $tag = Tag::factory()->create();
@ -36,7 +36,7 @@ class TagsTest extends TestCase
#[Test] #[Test]
#[DataProvider('tagsProvider')] #[DataProvider('tagsProvider')]
public function canNormalize(string $input, string $expected): void public function can_normalize(string $input, string $expected): void
{ {
$this->assertSame($expected, Tag::normalize($input)); $this->assertSame($expected, Tag::normalize($input));
} }

View file

@ -18,7 +18,7 @@ class WebMentionTest extends TestCase
use RefreshDatabase; use RefreshDatabase;
#[Test] #[Test]
public function commentableMethodLinksToNotes(): void public function commentable_method_links_to_notes(): void
{ {
$note = Note::factory()->create(); $note = Note::factory()->create();
$webmention = WebMention::factory()->make([ $webmention = WebMention::factory()->make([
@ -29,7 +29,7 @@ class WebMentionTest extends TestCase
} }
#[Test] #[Test]
public function publishedAttributeUsesUpdatedAtWhenNoRelevantMf2Data(): void public function published_attribute_uses_updated_at_when_no_relevant_mf2_data(): void
{ {
$webmention = new WebMention; $webmention = new WebMention;
$updated_at = Carbon::now(); $updated_at = Carbon::now();
@ -38,7 +38,7 @@ class WebMentionTest extends TestCase
} }
#[Test] #[Test]
public function publishedAttributeUsesUpdatedAtWhenErrorParsingMf2Data(): void public function published_attribute_uses_updated_at_when_error_parsing_mf2_data(): void
{ {
$webmention = new WebMention; $webmention = new WebMention;
$updated_at = Carbon::now(); $updated_at = Carbon::now();
@ -56,7 +56,7 @@ class WebMentionTest extends TestCase
} }
#[Test] #[Test]
public function createPhotoLinkDoesNothingWithGenericUrlAndNoLocallySavedImage(): void public function create_photo_link_does_nothing_with_generic_url_and_no_locally_saved_image(): void
{ {
$webmention = new WebMention; $webmention = new WebMention;
$homepage = 'https://example.org/profile.png'; $homepage = 'https://example.org/profile.png';
@ -65,7 +65,7 @@ class WebMentionTest extends TestCase
} }
#[Test] #[Test]
public function createPhotoLinkReturnsLocallySavedImageUrlIfItExists(): void public function create_photo_link_returns_locally_saved_image_url_if_it_exists(): void
{ {
$webmention = new WebMention; $webmention = new WebMention;
$homepage = 'https://aaronparecki.com/profile.png'; $homepage = 'https://aaronparecki.com/profile.png';
@ -74,7 +74,7 @@ class WebMentionTest extends TestCase
} }
#[Test] #[Test]
public function createPhotoLinkDealsWithSpecialCaseOfDirectTwitterPhotoLinks(): void public function create_photo_link_deals_with_special_case_of_direct_twitter_photo_links(): void
{ {
$webmention = new WebMention; $webmention = new WebMention;
$twitterProfileImage = 'http://pbs.twimg.com/1234'; $twitterProfileImage = 'http://pbs.twimg.com/1234';
@ -83,7 +83,7 @@ class WebMentionTest extends TestCase
} }
#[Test] #[Test]
public function createPhotoLinkReturnsCachedTwitterPhotoLinks(): void public function create_photo_link_returns_cached_twitter_photo_links(): void
{ {
$webmention = new WebMention; $webmention = new WebMention;
$twitterURL = 'https://twitter.com/example'; $twitterURL = 'https://twitter.com/example';
@ -93,7 +93,7 @@ class WebMentionTest extends TestCase
} }
#[Test] #[Test]
public function createPhotoLinkResolvesTwitterPhotoLinks(): void public function create_photo_link_resolves_twitter_photo_links(): void
{ {
$info = (object) [ $info = (object) [
'profile_image_url_https' => 'https://pbs.twimg.com/static_profile_link.jpg', 'profile_image_url_https' => 'https://pbs.twimg.com/static_profile_link.jpg',
@ -118,14 +118,14 @@ class WebMentionTest extends TestCase
} }
#[Test] #[Test]
public function getReplyAttributeDefaultsToNull(): void public function get_reply_attribute_defaults_to_null(): void
{ {
$webmention = new WebMention; $webmention = new WebMention;
$this->assertNull($webmention->reply); $this->assertNull($webmention->reply);
} }
#[Test] #[Test]
public function getReplyAttributeWithMf2WithoutHtmlReturnsNull(): void public function get_reply_attribute_with_mf2_without_html_returns_null(): void
{ {
$webmention = new WebMention; $webmention = new WebMention;
$webmention->mf2 = json_encode(['no_html' => 'found_here']); $webmention->mf2 = json_encode(['no_html' => 'found_here']);