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

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -13,7 +13,7 @@ use Tests\TestCase;
class ProcessMediaJobTest extends TestCase
{
#[Test]
public function nonMediaFilesAreNotSaved(): void
public function non_media_files_are_not_saved(): void
{
$manager = app()->make(ImageManager::class);
Storage::disk('local')->put('media/file.txt', 'This is not an image');
@ -24,7 +24,7 @@ class ProcessMediaJobTest extends TestCase
}
#[Test]
public function smallImagesAreNotResized(): void
public function small_images_are_not_resized(): void
{
$manager = app()->make(ImageManager::class);
Storage::disk('local')->put('media/aaron.png', file_get_contents(__DIR__ . '/../../aaron.png'));
@ -39,7 +39,7 @@ class ProcessMediaJobTest extends TestCase
}
#[Test]
public function largeImagesHaveSmallerImagesCreated(): void
public function large_images_have_smaller_images_created(): void
{
$manager = app()->make(ImageManager::class);
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]
public function failureGettingWebmentionThrowsAnException(): void
public function failure_getting_webmention_throws_an_exception(): void
{
$this->expectException(RemoteContentNotFoundException::class);
@ -53,7 +53,7 @@ class ProcessWebMentionJobTest extends TestCase
}
#[Test]
public function newWebmentionGetsSavedByJob(): void
public function new_webmention_gets_saved_by_job(): void
{
Queue::fake();
@ -85,7 +85,7 @@ class ProcessWebMentionJobTest extends TestCase
}
#[Test]
public function existingWebmentionGetsUpdatedByJob(): void
public function existing_webmention_gets_updated_by_job(): void
{
Queue::fake();
@ -122,7 +122,7 @@ class ProcessWebMentionJobTest extends TestCase
}
#[Test]
public function webmentionReplyGetsDeletedWhenReplyToValueChanges(): void
public function webmention_reply_gets_deleted_when_reply_to_value_changes(): void
{
$parser = new Parser;
@ -159,7 +159,7 @@ class ProcessWebMentionJobTest extends TestCase
}
#[Test]
public function webmentionLikeGetsDeletedWhenLikeOfValueChanges(): void
public function webmention_like_gets_deleted_when_like_of_value_changes(): void
{
$parser = new Parser;
@ -196,7 +196,7 @@ class ProcessWebMentionJobTest extends TestCase
}
#[Test]
public function webmentionRepostGetsDeletedWhenRepostOfValueChanges(): void
public function webmention_repost_gets_deleted_when_repost_of_value_changes(): void
{
$parser = new Parser;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -28,7 +28,7 @@ class NotesTest extends TestCase
* relevant sub-methods.
*/
#[Test]
public function getNoteAttributeMethodCallsSubMethods(): void
public function get_note_attribute_method_calls_sub_methods(): void
{
// phpcs:ignore
$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.
*/
#[Test]
public function defaultImageUsedAsFallbackInMakehcardsMethod(): void
public function default_image_used_as_fallback_in_makehcards_method(): void
{
// phpcs:ignore
$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.
*/
#[Test]
public function specificProfileImageUsedInMakehcardsMethod(): void
public function specific_profile_image_used_in_makehcards_method(): void
{
Contact::factory()->create([
'nick' => 'aaron',
@ -106,7 +106,7 @@ class NotesTest extends TestCase
* Look for twitter URL when theres no associated contact.
*/
#[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;
$note = Note::factory()->create([
@ -116,7 +116,7 @@ class NotesTest extends TestCase
}
#[Test]
public function weGetLatitudeLongitudeValuesOfAssociatedPlaceOfNote(): void
public function we_get_latitude_longitude_values_of_associated_place_of_note(): void
{
$place = Place::factory()->create([
'latitude' => '53.4983',
@ -130,7 +130,7 @@ class NotesTest extends TestCase
}
#[Test]
public function whenNoAssociatedPlaceWeGetNullForLatitudeLongitudeValues(): void
public function when_no_associated_place_we_get_null_for_latitude_longitude_values(): void
{
$note = Note::factory()->create();
$this->assertNull($note->latitude);
@ -138,7 +138,7 @@ class NotesTest extends TestCase
}
#[Test]
public function weCanGetAddressAttributeForAssociatedPlace(): void
public function we_can_get_address_attribute_for_associated_place(): void
{
$place = Place::factory()->create([
'name' => 'The Bridgewater Pub',
@ -152,7 +152,7 @@ class NotesTest extends TestCase
}
#[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
$note = Note::create(['note' => 'temporary #temp']);
@ -167,7 +167,7 @@ class NotesTest extends TestCase
}
#[Test]
public function saveBlankNotesAsNull(): void
public function save_blank_notes_as_null(): void
{
$note = new Note(['note' => '']);
@ -175,7 +175,7 @@ class NotesTest extends TestCase
}
#[Test]
public function reverseGeocodeAnAttraction(): void
public function reverse_geocode_an_attraction(): void
{
// phpcs:disable Generic.Files.LineLength.TooLong
$json = <<<JSON
@ -200,7 +200,7 @@ class NotesTest extends TestCase
}
#[Test]
public function reverseGeocodeASuburb(): void
public function reverse_geocode_a_suburb(): void
{
// phpcs:disable Generic.Files.LineLength.TooLong
$json = <<<JSON
@ -225,7 +225,7 @@ class NotesTest extends TestCase
}
#[Test]
public function reverseGeocodeACity(): void
public function reverse_geocode_a_city(): void
{
// Note Ive modified this JSON response so it only contains the
// city the Uni is in
@ -252,7 +252,7 @@ class NotesTest extends TestCase
}
#[Test]
public function reverseGeocodeACounty(): void
public function reverse_geocode_a_county(): void
{
// Note Ive removed everything below county to test for queries where
// thats all that is returned
@ -276,7 +276,7 @@ class NotesTest extends TestCase
}
#[Test]
public function reverseGeocodeACountry(): void
public function reverse_geocode_a_country(): void
{
// Note Ive removed everything below country to test for querires where
// thats all that is returned
@ -300,7 +300,7 @@ class NotesTest extends TestCase
}
#[Test]
public function addImageElementToNoteContentWhenMediaAssociated(): void
public function add_image_element_to_note_content_when_media_associated(): void
{
$media = Media::factory()->create([
'type' => 'image',
@ -317,7 +317,7 @@ class NotesTest extends TestCase
}
#[Test]
public function addVideoElementToNoteContentWhenMediaAssociated(): void
public function add_video_element_to_note_content_when_media_associated(): void
{
$media = Media::factory()->create([
'type' => 'video',
@ -334,7 +334,7 @@ class NotesTest extends TestCase
}
#[Test]
public function addAudioElementToNoteContentWhenMediaAssociated(): void
public function add_audio_element_to_note_content_when_media_associated(): void
{
$media = Media::factory()->create([
'type' => 'audio',
@ -354,7 +354,7 @@ class NotesTest extends TestCase
* @todo Why do we need to provide text?
*/
#[Test]
public function provideTextForBlankContent(): void
public function provide_text_for_blank_content(): void
{
$note = new Note;
@ -387,7 +387,7 @@ class NotesTest extends TestCase
* For now, just reply on a cached object instead of actually querying Twitter.
*/
#[Test]
public function checkInReplyToIsTwitterLink(): void
public function check_in_reply_to_is_twitter_link(): void
{
$tempContent = (object) [
'html' => 'something random',
@ -402,7 +402,7 @@ class NotesTest extends TestCase
}
#[Test]
public function latitudeAndLongitudeCanBeParsedFromPlainLocation(): void
public function latitude_and_longitude_can_be_parsed_from_plain_location(): void
{
$note = Note::factory()->create([
'location' => '1.23,4.56',
@ -413,7 +413,7 @@ class NotesTest extends TestCase
}
#[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>');
@ -425,7 +425,7 @@ class NotesTest extends TestCase
}
#[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;
$note = Note::factory()->create([

View file

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

View file

@ -17,7 +17,7 @@ class TagsTest extends TestCase
use RefreshDatabase;
#[Test]
public function canGetAssociatedNotes(): void
public function can_get_associated_notes(): void
{
$note = Note::factory()->create();
$tag = Tag::factory()->create();
@ -26,7 +26,7 @@ class TagsTest extends TestCase
}
#[Test]
public function canGetAssociatedBookmarks(): void
public function can_get_associated_bookmarks(): void
{
$bookmark = Bookmark::factory()->create();
$tag = Tag::factory()->create();
@ -36,7 +36,7 @@ class TagsTest extends TestCase
#[Test]
#[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));
}

View file

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