@@ -163,7 +163,7 @@ class ContactsTest extends TestCase
}
#[Test]
- public function getting_remote_avatar_fails_gracefully_with_remote_not_found(): void
+ public function gettingRemoteAvatarFailsGracefullyWithRemoteNotFound(): void
{
$mock = new MockHandler([
new Response(404),
@@ -180,7 +180,7 @@ class ContactsTest extends TestCase
}
#[Test]
- public function getting_remote_avatar_fails_gracefully_with_remote_error(): void
+ public function gettingRemoteAvatarFailsGracefullyWithRemoteError(): void
{
$html = <<<'HTML'
@@ -203,7 +203,7 @@ class ContactsTest extends TestCase
}
#[Test]
- public function getting_remote_avatar_fails_gracefully_for_contact_with_no_hompage(): void
+ public function gettingRemoteAvatarFailsGracefullyForContactWithNoHompage(): void
{
$contact = Contact::create([
'nick' => 'fred',
diff --git a/tests/Feature/Admin/LikesTest.php b/tests/Feature/Admin/LikesTest.php
index 436088d6..151f7b73 100644
--- a/tests/Feature/Admin/LikesTest.php
+++ b/tests/Feature/Admin/LikesTest.php
@@ -17,7 +17,7 @@ class LikesTest extends TestCase
use RefreshDatabase;
#[Test]
- public function likes_page_loads(): void
+ public function likesPageLoads(): void
{
$user = User::factory()->make();
@@ -27,7 +27,7 @@ class LikesTest extends TestCase
}
#[Test]
- public function like_create_form_loads(): void
+ public function likeCreateFormLoads(): void
{
$user = User::factory()->make();
@@ -37,7 +37,7 @@ class LikesTest extends TestCase
}
#[Test]
- public function admin_can_create_like(): void
+ public function adminCanCreateLike(): void
{
Queue::fake();
$user = User::factory()->make();
@@ -53,7 +53,7 @@ class LikesTest extends TestCase
}
#[Test]
- public function like_edit_form_loads(): void
+ public function likeEditFormLoads(): void
{
$user = User::factory()->make();
$like = Like::factory()->create();
@@ -64,7 +64,7 @@ class LikesTest extends TestCase
}
#[Test]
- public function admin_can_edit_like(): void
+ public function adminCanEditLike(): void
{
Queue::fake();
$user = User::factory()->make();
@@ -82,7 +82,7 @@ class LikesTest extends TestCase
}
#[Test]
- public function admin_can_delete_like(): void
+ public function adminCanDeleteLike(): void
{
$like = Like::factory()->create();
$url = $like->url;
diff --git a/tests/Feature/Admin/NotesTest.php b/tests/Feature/Admin/NotesTest.php
index ca6b8339..ccd3a867 100644
--- a/tests/Feature/Admin/NotesTest.php
+++ b/tests/Feature/Admin/NotesTest.php
@@ -17,7 +17,7 @@ class NotesTest extends TestCase
use RefreshDatabase;
#[Test]
- public function notes_page_loads(): void
+ public function notesPageLoads(): void
{
$user = User::factory()->make();
@@ -26,7 +26,7 @@ class NotesTest extends TestCase
}
#[Test]
- public function note_create_page_loads(): void
+ public function noteCreatePageLoads(): void
{
$user = User::factory()->make();
@@ -35,7 +35,7 @@ class NotesTest extends TestCase
}
#[Test]
- public function admin_can_create_new_note(): void
+ public function adminCanCreateNewNote(): void
{
$user = User::factory()->make();
@@ -49,7 +49,7 @@ class NotesTest extends TestCase
}
#[Test]
- public function note_edit_form_loads(): void
+ public function noteEditFormLoads(): void
{
$user = User::factory()->make();
$note = Note::factory()->create();
@@ -59,7 +59,7 @@ class NotesTest extends TestCase
}
#[Test]
- public function admin_can_edit_note(): void
+ public function adminCanEditNote(): void
{
Queue::fake();
$user = User::factory()->make();
@@ -78,7 +78,7 @@ class NotesTest extends TestCase
}
#[Test]
- public function admin_can_delete_note(): void
+ public function adminCanDeleteNote(): void
{
$user = User::factory()->make();
$note = Note::factory()->create();
diff --git a/tests/Feature/Admin/PlacesTest.php b/tests/Feature/Admin/PlacesTest.php
index 367fbcb2..1f711e8e 100644
--- a/tests/Feature/Admin/PlacesTest.php
+++ b/tests/Feature/Admin/PlacesTest.php
@@ -15,7 +15,7 @@ class PlacesTest extends TestCase
use RefreshDatabase;
#[Test]
- public function places_page_loads(): void
+ public function placesPageLoads(): void
{
$user = User::factory()->make();
@@ -24,7 +24,7 @@ class PlacesTest extends TestCase
}
#[Test]
- public function create_place_page_loads(): void
+ public function createPlacePageLoads(): void
{
$user = User::factory()->make();
@@ -33,7 +33,7 @@ class PlacesTest extends TestCase
}
#[Test]
- public function admin_can_create_new_place(): void
+ public function adminCanCreateNewPlace(): void
{
$user = User::factory()->make();
@@ -50,7 +50,7 @@ class PlacesTest extends TestCase
}
#[Test]
- public function edit_place_page_loads(): void
+ public function editPlacePageLoads(): void
{
$user = User::factory()->make();
$place = Place::factory()->create();
@@ -60,7 +60,7 @@ class PlacesTest extends TestCase
}
#[Test]
- public function admin_can_update_place(): void
+ public function adminCanUpdatePlace(): void
{
$user = User::factory()->make();
$place = Place::factory()->create([
diff --git a/tests/Feature/ArticlesTest.php b/tests/Feature/ArticlesTest.php
index c3922beb..8e544009 100644
--- a/tests/Feature/ArticlesTest.php
+++ b/tests/Feature/ArticlesTest.php
@@ -15,14 +15,14 @@ class ArticlesTest extends TestCase
use RefreshDatabase;
#[Test]
- public function articles_page_loads(): void
+ public function articlesPageLoads(): void
{
$response = $this->get('/blog');
$response->assertViewIs('articles.index');
}
#[Test]
- public function single_article_page_loads()
+ public function singleArticlePageLoads()
{
$article = Article::factory()->create();
$response = $this->get($article->link);
@@ -30,7 +30,7 @@ class ArticlesTest extends TestCase
}
#[Test]
- public function wrong_date_in_url_redirects_to_correct_date()
+ public function wrongDateInUrlRedirectsToCorrectDate()
{
$article = Article::factory()->create();
$response = $this->get('/blog/1900/01/' . $article->titleurl);
@@ -38,7 +38,7 @@ class ArticlesTest extends TestCase
}
#[Test]
- public function old_urls_with_id_are_redirected()
+ public function oldUrlsWithIdAreRedirected()
{
$article = Article::factory()->create();
$num60Id = resolve(Numbers::class)->numto60($article->id);
@@ -47,21 +47,21 @@ class ArticlesTest extends TestCase
}
#[Test]
- public function unknown_slug_gets_not_found_response()
+ public function unknownSlugGetsNotFoundResponse()
{
$response = $this->get('/blog/' . date('Y') . '/' . date('m') . '/unknown-slug');
$response->assertNotFound();
}
#[Test]
- public function unknown_article_id_gets_not_found_response()
+ public function unknownArticleIdGetsNotFoundResponse()
{
$response = $this->get('/blog/s/22');
$response->assertNotFound();
}
#[Test]
- public function some_urls_do_not_parse_correctly(): void
+ public function someUrlsDoNotParseCorrectly(): void
{
$response = $this->get('/blog/feed.js');
$response->assertNotFound();
diff --git a/tests/Feature/BookmarksTest.php b/tests/Feature/BookmarksTest.php
index ebbcedf6..73948237 100644
--- a/tests/Feature/BookmarksTest.php
+++ b/tests/Feature/BookmarksTest.php
@@ -17,14 +17,14 @@ class BookmarksTest extends TestCase
use RefreshDatabase, TestToken;
#[Test]
- public function bookmarks_page_loads_without_error(): void
+ public function bookmarksPageLoadsWithoutError(): void
{
$response = $this->get('/bookmarks');
$response->assertViewIs('bookmarks.index');
}
#[Test]
- public function single_bookmark_page_loads_without_error(): void
+ public function singleBookmarkPageLoadsWithoutError(): void
{
$bookmark = Bookmark::factory()->create();
$response = $this->get('/bookmarks/' . $bookmark->id);
@@ -32,7 +32,7 @@ class BookmarksTest extends TestCase
}
#[Test]
- public function when_bookmark_is_added_using_http_syntax_check_job_to_take_screenshot_is_invoked(): void
+ public function whenBookmarkIsAddedUsingHttpSyntaxCheckJobToTakeScreenshotIsInvoked(): void
{
Queue::fake();
@@ -50,7 +50,7 @@ class BookmarksTest extends TestCase
}
#[Test]
- public function when_bookmark_is_added_using_json_syntax_check_job_to_take_screenshot_is_invoked(): void
+ public function whenBookmarkIsAddedUsingJsonSyntaxCheckJobToTakeScreenshotIsInvoked(): void
{
Queue::fake();
@@ -70,7 +70,7 @@ class BookmarksTest extends TestCase
}
#[Test]
- public function when_the_bookmark_is_created_check_necessary_tags_are_also_created(): void
+ public function whenTheBookmarkIsCreatedCheckNecessaryTagsAreAlsoCreated(): void
{
Queue::fake();
diff --git a/tests/Feature/ContactsTest.php b/tests/Feature/ContactsTest.php
index 0c4af8e9..a773e45f 100644
--- a/tests/Feature/ContactsTest.php
+++ b/tests/Feature/ContactsTest.php
@@ -17,7 +17,7 @@ class ContactsTest extends TestCase
* Check the `/contacts` page gives a good response.
*/
#[Test]
- public function contacts_page_loads_without_error(): void
+ public function contactsPageLoadsWithoutError(): void
{
$response = $this->get('/contacts');
$response->assertStatus(200);
@@ -27,7 +27,7 @@ class ContactsTest extends TestCase
* Test an individual contact page with default profile image.
*/
#[Test]
- public function contact_page_should_fallback_to_default_profile_pic(): void
+ public function contactPageShouldFallbackToDefaultProfilePic(): void
{
Contact::factory()->create([
'nick' => 'tantek',
@@ -40,7 +40,7 @@ class ContactsTest extends TestCase
* Test an individual contact page with a specific profile image.
*/
#[Test]
- public function contact_page_should_use_specific_profile_pic_if_present(): void
+ public function contactPageShouldUseSpecificProfilePicIfPresent(): void
{
Contact::factory()->create([
'nick' => 'aaron',
@@ -51,7 +51,7 @@ class ContactsTest extends TestCase
}
#[Test]
- public function unknown_contact_returns_not_found_response(): void
+ public function unknownContactReturnsNotFoundResponse(): void
{
$response = $this->get('/contacts/unknown');
$response->assertNotFound();
diff --git a/tests/Feature/CorsHeadersTest.php b/tests/Feature/CorsHeadersTest.php
index e0804058..07af166e 100644
--- a/tests/Feature/CorsHeadersTest.php
+++ b/tests/Feature/CorsHeadersTest.php
@@ -13,7 +13,7 @@ class CorsHeadersTest extends TestCase
use TestToken;
#[Test]
- public function check_cors_headers_on_media_endpoint(): void
+ public function checkCorsHeadersOnMediaEndpoint(): void
{
$response = $this->call(
'OPTIONS',
@@ -27,7 +27,7 @@ class CorsHeadersTest extends TestCase
}
#[Test]
- public function check_for_no_cors_header_on_non_media_endpoint_links(): void
+ public function checkForNoCorsHeaderOnNonMediaEndpointLinks(): void
{
$response = $this->get('/blog');
$response->assertHeaderMissing('Access-Control-Allow-Origin');
diff --git a/tests/Feature/FeedsTest.php b/tests/Feature/FeedsTest.php
index 7c403da5..a0704b90 100644
--- a/tests/Feature/FeedsTest.php
+++ b/tests/Feature/FeedsTest.php
@@ -19,7 +19,7 @@ class FeedsTest extends TestCase
* Test the blog RSS feed.
*/
#[Test]
- public function blog_rss_feed_is_present(): void
+ public function blogRssFeedIsPresent(): void
{
Article::factory()->count(3)->create();
$response = $this->get('/blog/feed.rss');
@@ -31,7 +31,7 @@ class FeedsTest extends TestCase
* Test the notes RSS feed.
*/
#[Test]
- public function notes_rss_feed_is_present(): void
+ public function notesRssFeedIsPresent(): void
{
Note::factory()->count(3)->create();
$response = $this->get('/notes/feed.rss');
@@ -43,7 +43,7 @@ class FeedsTest extends TestCase
* Test the blog RSS feed.
*/
#[Test]
- public function blog_atom_feed_is_present(): void
+ public function blogAtomFeedIsPresent(): void
{
Article::factory()->count(3)->create();
$response = $this->get('/blog/feed.atom');
@@ -52,7 +52,7 @@ class FeedsTest extends TestCase
}
#[Test]
- public function blog_jf2_feed_is_present(): void
+ public function blogJf2FeedIsPresent(): void
{
Article::factory()->count(3)->create();
$response = $this->get('/blog/feed.jf2');
@@ -64,7 +64,7 @@ class FeedsTest extends TestCase
'author' => [
'type' => 'card',
'name' => config('user.display_name'),
- 'url' => config('app.url'),
+ 'url' => config('url.longurl'),
],
'children' => [[
'type' => 'entry',
@@ -77,7 +77,7 @@ class FeedsTest extends TestCase
* Test the notes RSS feed.
*/
#[Test]
- public function notes_atom_feed_is_present(): void
+ public function notesAtomFeedIsPresent(): void
{
Note::factory()->count(3)->create();
$response = $this->get('/notes/feed.atom');
@@ -89,7 +89,7 @@ class FeedsTest extends TestCase
* Test the blog JSON feed.
*/
#[Test]
- public function blog_json_feed_is_present(): void
+ public function blogJsonFeedIsPresent(): void
{
Article::factory()->count(3)->create();
$response = $this->get('/blog/feed.json');
@@ -101,7 +101,7 @@ class FeedsTest extends TestCase
* Test the notes JSON feed.
*/
#[Test]
- public function notes_json_feed_is_present(): void
+ public function notesJsonFeedIsPresent(): void
{
Note::factory()->count(3)->create();
$response = $this->get('/notes/feed.json');
@@ -110,7 +110,7 @@ class FeedsTest extends TestCase
}
#[Test]
- public function notes_jf2_feed_is_present(): void
+ public function notesJf2FeedIsPresent(): void
{
Note::factory()->count(3)->create();
$response = $this->get('/notes/feed.jf2');
@@ -122,7 +122,7 @@ class FeedsTest extends TestCase
'author' => [
'type' => 'card',
'name' => config('user.display_name'),
- 'url' => config('app.url'),
+ 'url' => config('url.longurl'),
],
'children' => [[
'type' => 'entry',
@@ -136,7 +136,7 @@ class FeedsTest extends TestCase
* and whichever one they have can’t be `null`.
*/
#[Test]
- public function json_feeds_have_required_attributes(): void
+ public function jsonFeedsHaveRequiredAttributes(): void
{
Note::factory()->count(3)->create();
$response = $this->get('/notes/feed.json');
@@ -156,7 +156,7 @@ class FeedsTest extends TestCase
}
#[Test]
- public function json_note_feed_loads_place_data_without_lazy_loading(): void
+ public function jsonNoteFeedLoadsPlaceDataWithoutLazyLoading(): void
{
$place = Place::factory()->create();
Note::factory()->create(['note' => null, 'place_id' => $place->id]);
diff --git a/tests/Feature/FrontPageTest.php b/tests/Feature/FrontPageTest.php
index 8c8a5706..b78191bf 100644
--- a/tests/Feature/FrontPageTest.php
+++ b/tests/Feature/FrontPageTest.php
@@ -15,7 +15,7 @@ class FrontPageTest extends TestCase
use RefreshDatabase;
#[Test]
- public function front_page_loads_all_content(): void
+ public function frontPageLoadsAllContent(): void
{
Note::factory()->create(['note' => 'Note 1']);
Article::factory()->create(['title' => 'Article 1']);
diff --git a/tests/Feature/HeaderLinkTest.php b/tests/Feature/HeaderLinkTest.php
index e3d0ffff..8e220c79 100644
--- a/tests/Feature/HeaderLinkTest.php
+++ b/tests/Feature/HeaderLinkTest.php
@@ -10,7 +10,7 @@ use Tests\TestCase;
class HeaderLinkTest extends TestCase
{
#[Test]
- public function it_should_see_the_indieweb_related_link_headers(): void
+ public function itShouldSeeTheIndiewebRelatedLinkHeaders(): void
{
$response = $this->get('/');
diff --git a/tests/Feature/HorizonTest.php b/tests/Feature/HorizonTest.php
index 26485c8a..f4566e2f 100644
--- a/tests/Feature/HorizonTest.php
+++ b/tests/Feature/HorizonTest.php
@@ -12,7 +12,7 @@ class HorizonTest extends TestCase
* Horizon has its own test suite, here we just test it has been installed successfully.
*/
#[Test]
- public function horizon_is_installed(): void
+ public function horizonIsInstalled(): void
{
$user = User::factory()->create([
'name' => 'jonny',
diff --git a/tests/Feature/IndieAuthTest.php b/tests/Feature/IndieAuthTest.php
index 106d9ae3..78ba8130 100644
--- a/tests/Feature/IndieAuthTest.php
+++ b/tests/Feature/IndieAuthTest.php
@@ -21,7 +21,7 @@ class IndieAuthTest extends TestCase
use RefreshDatabase;
#[Test]
- public function it_should_return_indie_auth_metadata(): void
+ public function itShouldReturnIndieAuthMetadata(): void
{
$response = $this->get('/.well-known/indieauth-server');
@@ -37,7 +37,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_require_admin_login_to_show_authorise_form(): void
+ public function itShouldRequireAdminLoginToShowAuthoriseForm(): void
{
$response = $this->get('/auth', [
'response_type' => 'code',
@@ -59,7 +59,7 @@ class IndieAuthTest extends TestCase
* same domain, later test will check the flow when they are different.
*/
#[Test]
- public function it_should_return_approval_view_when_the_request_is_valid(): void
+ public function itShouldReturnApprovalViewWhenTheRequestIsValid(): void
{
$user = User::factory()->make();
$url = url()->query('/auth', [
@@ -80,7 +80,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_return_error_view_when_respone_type_is_wrong(): void
+ public function itShouldReturnErrorViewWhenResponeTypeIsWrong(): void
{
$user = User::factory()->make();
$url = url()->query('/auth', [
@@ -102,7 +102,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_return_error_view_when_respone_type_is_missing(): void
+ public function itShouldReturnErrorViewWhenResponeTypeIsMissing(): void
{
$user = User::factory()->make();
$url = url()->query('/auth', [
@@ -123,7 +123,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_return_error_view_when_client_id_is_missing(): void
+ public function itShouldReturnErrorViewWhenClientIdIsMissing(): void
{
$user = User::factory()->make();
$url = url()->query('/auth', [
@@ -144,7 +144,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_return_error_view_when_redirect_uri_is_missing(): void
+ public function itShouldReturnErrorViewWhenRedirectUriIsMissing(): void
{
$user = User::factory()->make();
$url = url()->query('/auth', [
@@ -165,7 +165,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_return_error_view_when_state_is_missing(): void
+ public function itShouldReturnErrorViewWhenStateIsMissing(): void
{
$user = User::factory()->make();
$url = url()->query('/auth', [
@@ -186,7 +186,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_return_error_view_when_code_challenge_is_missing(): void
+ public function itShouldReturnErrorViewWhenCodeChallengeIsMissing(): void
{
$user = User::factory()->make();
$url = url()->query('/auth', [
@@ -207,7 +207,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_return_error_view_when_code_challenge_method_is_missing(): void
+ public function itShouldReturnErrorViewWhenCodeChallengeMethodIsMissing(): void
{
$user = User::factory()->make();
$url = url()->query('/auth', [
@@ -228,7 +228,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_return_error_view_when_code_challenge_method_is_unsupported_value(): void
+ public function itShouldReturnErrorViewWhenCodeChallengeMethodIsUnsupportedValue(): void
{
$user = User::factory()->make();
$url = url()->query('/auth', [
@@ -250,7 +250,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_check_client_id_for_valid_redirect(): void
+ public function itShouldCheckClientIdForValidRedirect(): void
{
// Mock Guzzle request for client_id
$appPageHtml = <<<'HTML'
@@ -295,7 +295,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_error_if_client_id_page_has_no_valid_redirect(): void
+ public function itShouldErrorIfClientIdPageHasNoValidRedirect(): void
{
// Mock Guzzle request for client_id
$appPageHtml = <<<'HTML'
@@ -340,7 +340,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_redirect_to_app_on_approval(): void
+ public function itShouldRedirectToAppOnApproval(): void
{
$user = User::factory()->make();
$response = $this->actingAs($user)->post('/auth/confirm', [
@@ -373,7 +373,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_show_error_response_when_approval_request_is_missing_grant_type(): void
+ public function itShouldShowErrorResponseWhenApprovalRequestIsMissingGrantType(): void
{
$response = $this->post('/auth', [
'code' => '123456',
@@ -393,7 +393,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_show_error_response_when_approval_request_is_missing_code(): void
+ public function itShouldShowErrorResponseWhenApprovalRequestIsMissingCode(): void
{
$response = $this->post('/auth', [
'grant_type' => 'authorization_code',
@@ -413,7 +413,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_show_error_response_when_approval_request_is_missing_client_id(): void
+ public function itShouldShowErrorResponseWhenApprovalRequestIsMissingClientId(): void
{
$response = $this->post('/auth', [
'grant_type' => 'authorization_code',
@@ -433,7 +433,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_show_error_response_when_approval_request_is_missing_redirect_uri(): void
+ public function itShouldShowErrorResponseWhenApprovalRequestIsMissingRedirectUri(): void
{
$response = $this->post('/auth', [
'grant_type' => 'authorization_code',
@@ -453,7 +453,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_show_error_response_when_approval_request_is_missing_code_verifier(): void
+ public function itShouldShowErrorResponseWhenApprovalRequestIsMissingCodeVerifier(): void
{
$response = $this->post('/auth', [
'grant_type' => 'authorization_code',
@@ -473,7 +473,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_show_error_response_when_approval_request_grant_type_is_unsupported(): void
+ public function itShouldShowErrorResponseWhenApprovalRequestGrantTypeIsUnsupported(): void
{
$response = $this->post('/auth', [
'grant_type' => 'unsupported',
@@ -494,7 +494,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_return_error_for_unknown_code(): void
+ public function itShouldReturnErrorForUnknownCode(): void
{
$response = $this->post('/auth', [
'grant_type' => 'authorization_code',
@@ -515,7 +515,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_return_error_for_invalid_code(): void
+ public function itShouldReturnErrorForInvalidCode(): void
{
Cache::shouldReceive('pull')
->once()
@@ -541,7 +541,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_return_error_for_invalid_code_verifier(): void
+ public function itShouldReturnErrorForInvalidCodeVerifier(): void
{
Cache::shouldReceive('pull')
->once()
@@ -570,7 +570,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_return_me_data_for_valid_request(): void
+ public function itShouldReturnMeDataForValidRequest(): void
{
Cache::shouldReceive('pull')
->once()
@@ -600,7 +600,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_return_error_when_no_scopes_given_to_token_endpoint(): void
+ public function itShouldReturnErrorWhenNoScopesGivenToTokenEndpoint(): void
{
Cache::shouldReceive('pull')
->once()
@@ -635,7 +635,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_return_error_when_client_id_does_not_match_during_token_request(): void
+ public function itShouldReturnErrorWhenClientIdDoesNotMatchDuringTokenRequest(): void
{
Cache::shouldReceive('pull')
->once()
@@ -670,7 +670,7 @@ class IndieAuthTest extends TestCase
}
#[Test]
- public function it_should_return_an_access_token_if_validation_passes(): void
+ public function itShouldReturnAnAccessTokenIfValidationPasses(): void
{
Cache::shouldReceive('pull')
->once()
diff --git a/tests/Feature/LikesTest.php b/tests/Feature/LikesTest.php
index b32b84b8..3f13724a 100644
--- a/tests/Feature/LikesTest.php
+++ b/tests/Feature/LikesTest.php
@@ -24,14 +24,14 @@ class LikesTest extends TestCase
use TestToken;
#[Test]
- public function likes_page_has_correct_view(): void
+ public function likesPageHasCorrectView(): void
{
$response = $this->get('/likes');
$response->assertViewIs('likes.index');
}
#[Test]
- public function single_like_page_has_correct_view(): void
+ public function singleLikePageHasCorrectView(): void
{
$like = Like::factory()->create();
$response = $this->get('/likes/' . $like->id);
@@ -39,7 +39,7 @@ class LikesTest extends TestCase
}
#[Test]
- public function check_like_created_from_micropub_api_requests(): void
+ public function checkLikeCreatedFromMicropubApiRequests(): void
{
Queue::fake();
@@ -59,7 +59,7 @@ class LikesTest extends TestCase
}
#[Test]
- public function check_like_created_from_micropub_web_requests(): void
+ public function checkLikeCreatedFromMicropubWebRequests(): void
{
Queue::fake();
@@ -77,7 +77,7 @@ class LikesTest extends TestCase
}
#[Test]
- public function like_with_simple_author(): void
+ public function likeWithSimpleAuthor(): void
{
$like = new Like;
$like->url = 'http://example.org/note/id';
@@ -116,7 +116,7 @@ class LikesTest extends TestCase
}
#[Test]
- public function like_with_h_card(): void
+ public function likeWithHCard(): void
{
$like = new Like;
$like->url = 'http://example.org/note/id';
@@ -159,7 +159,7 @@ class LikesTest extends TestCase
}
#[Test]
- public function like_without_microformats(): void
+ public function likeWithoutMicroformats(): void
{
$like = new Like;
$like->url = 'http://example.org/note/id';
@@ -195,7 +195,7 @@ class LikesTest extends TestCase
}
#[Test]
- public function like_that_is_a_tweet(): void
+ public function likeThatIsATweet(): void
{
$like = new Like;
$like->url = 'https://twitter.com/jonnybarnes/status/1050823255123251200';
@@ -234,7 +234,7 @@ class LikesTest extends TestCase
}
#[Test]
- public function no_error_for_failure_to_posse_with_bridgy(): void
+ public function noErrorForFailureToPosseWithBridgy(): void
{
$like = new Like;
$like->url = 'https://twitter.com/jonnybarnes/status/1050823255123251200';
@@ -271,7 +271,7 @@ class LikesTest extends TestCase
}
#[Test]
- public function unknown_like_gives_not_found_response(): void
+ public function unknownLikeGivesNotFoundResponse(): void
{
$response = $this->get('/likes/202');
$response->assertNotFound();
diff --git a/tests/Feature/MicropubControllerTest.php b/tests/Feature/MicropubControllerTest.php
index 0e7abdfc..2cd75fc3 100644
--- a/tests/Feature/MicropubControllerTest.php
+++ b/tests/Feature/MicropubControllerTest.php
@@ -25,7 +25,7 @@ class MicropubControllerTest extends TestCase
use TestToken;
#[Test]
- public function micropub_get_request_without_token_returns_error_response(): void
+ public function micropubGetRequestWithoutTokenReturnsErrorResponse(): void
{
$response = $this->get('/api/post');
$response->assertStatus(401);
@@ -33,7 +33,7 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_get_request_without_valid_token_returns_error_response(): void
+ public function micropubGetRequestWithoutValidTokenReturnsErrorResponse(): void
{
$response = $this->get('/api/post', ['HTTP_Authorization' => 'Bearer abc123']);
$response->assertStatus(400);
@@ -45,7 +45,7 @@ class MicropubControllerTest extends TestCase
* 200 response. Check token information is also returned in the response.
*/
#[Test]
- public function micropub_get_request_with_valid_token_returns_ok_response(): void
+ public function micropubGetRequestWithValidTokenReturnsOkResponse(): void
{
$response = $this->get('/api/post', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]);
$response->assertStatus(200);
@@ -53,14 +53,14 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_clients_can_request_syndication_targets_can_be_empty(): void
+ public function micropubClientsCanRequestSyndicationTargetsCanBeEmpty(): void
{
$response = $this->get('/api/post?q=syndicate-to', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]);
$response->assertJsonFragment(['syndicate-to' => []]);
}
#[Test]
- public function micropub_clients_can_request_syndication_targets_populates_from_model(): void
+ public function micropubClientsCanRequestSyndicationTargetsPopulatesFromModel(): void
{
$syndicationTarget = SyndicationTarget::factory()->create();
$response = $this->get('/api/post?q=syndicate-to', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]);
@@ -68,7 +68,7 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_clients_can_request_known_nearby_places(): void
+ public function micropubClientsCanRequestKnownNearbyPlaces(): void
{
Place::factory()->create([
'name' => 'The Bridgewater Pub',
@@ -88,21 +88,21 @@ class MicropubControllerTest extends TestCase
$response->assertJson(['places' => [['slug' => 'the-bridgewater-pub']]]);
}*/
#[Test]
- public function return_empty_result_when_micropub_client_requests_known_nearby_places(): void
+ public function returnEmptyResultWhenMicropubClientRequestsKnownNearbyPlaces(): void
{
$response = $this->get('/api/post?q=geo:1.23,4.56', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]);
$response->assertJson(['places' => []]);
}
#[Test]
- public function micropub_client_can_request_endpoint_config(): void
+ public function micropubClientCanRequestEndpointConfig(): void
{
$response = $this->get('/api/post?q=config', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]);
$response->assertJsonFragment(['media-endpoint' => route('media-endpoint')]);
}
#[Test]
- public function micropub_client_can_create_new_note(): void
+ public function micropubClientCanCreateNewNote(): void
{
$faker = Factory::create();
$note = $faker->text;
@@ -121,7 +121,7 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_client_can_request_the_new_note_is_syndicated_to_mastodon_and_bluesky(): void
+ public function micropubClientCanRequestTheNewNoteIsSyndicatedToMastodonAndBluesky(): void
{
Queue::fake();
@@ -155,7 +155,7 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_clients_can_create_new_places(): void
+ public function micropubClientsCanCreateNewPlaces(): void
{
$response = $this->post(
'/api/post',
@@ -171,7 +171,7 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_clients_can_create_new_places_with_old_location_syntax(): void
+ public function micropubClientsCanCreateNewPlacesWithOldLocationSyntax(): void
{
$response = $this->post(
'/api/post',
@@ -188,7 +188,7 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_client_web_request_with_invalid_token_returns_error_response(): void
+ public function micropubClientWebRequestWithInvalidTokenReturnsErrorResponse(): void
{
$response = $this->post(
'/api/post',
@@ -203,7 +203,7 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_client_web_request_with_token_without_any_scopes_returns_error_response(): void
+ public function micropubClientWebRequestWithTokenWithoutAnyScopesReturnsErrorResponse(): void
{
$response = $this->post(
'/api/post',
@@ -218,7 +218,7 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_client_web_request_with_token_without_create_scopes_returns_error_response(): void
+ public function micropubClientWebRequestWithTokenWithoutCreateScopesReturnsErrorResponse(): void
{
$response = $this->post(
'/api/post',
@@ -237,7 +237,7 @@ class MicropubControllerTest extends TestCase
* Test a valid micropub requests using JSON syntax creates a new note.
*/
#[Test]
- public function micropub_client_api_request_creates_new_note(): void
+ public function micropubClientApiRequestCreatesNewNote(): void
{
Queue::fake();
Media::create([
@@ -284,7 +284,7 @@ class MicropubControllerTest extends TestCase
* existing self-created place.
*/
#[Test]
- public function micropub_client_api_request_creates_new_note_with_existing_place_in_location_data(): void
+ public function micropubClientApiRequestCreatesNewNoteWithExistingPlaceInLocationData(): void
{
$place = new Place;
$place->name = 'Test Place';
@@ -299,7 +299,7 @@ class MicropubControllerTest extends TestCase
'type' => ['h-entry'],
'properties' => [
'content' => [$note],
- 'location' => [$place->uri],
+ 'location' => [$place->longurl],
],
],
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
@@ -314,7 +314,7 @@ class MicropubControllerTest extends TestCase
* a new place defined in the location block.
*/
#[Test]
- public function micropub_client_api_request_creates_new_note_with_new_place_in_location_data(): void
+ public function micropubClientApiRequestCreatesNewNoteWithNewPlaceInLocationData(): void
{
$faker = Factory::create();
$note = $faker->text;
@@ -349,7 +349,7 @@ class MicropubControllerTest extends TestCase
* a new place defined in the location block if there is missing data.
*/
#[Test]
- public function micropub_client_api_request_creates_new_note_without_new_place_in_location_data(): void
+ public function micropubClientApiRequestCreatesNewNoteWithoutNewPlaceInLocationData(): void
{
$faker = Factory::create();
$note = $faker->text;
@@ -382,7 +382,7 @@ class MicropubControllerTest extends TestCase
* error. Also check the message.
*/
#[Test]
- public function micropub_client_api_request_without_token_returns_error(): void
+ public function micropubClientApiRequestWithoutTokenReturnsError(): void
{
$faker = Factory::create();
$note = $faker->text;
@@ -408,7 +408,7 @@ class MicropubControllerTest extends TestCase
* an error. Also check the message.
*/
#[Test]
- public function micropub_client_api_request_with_token_with_insufficient_permission_returns_error(): void
+ public function micropubClientApiRequestWithTokenWithInsufficientPermissionReturnsError(): void
{
$faker = Factory::create();
$note = $faker->text;
@@ -431,7 +431,7 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_client_api_request_for_unsupported_post_type_returns_error(): void
+ public function micropubClientApiRequestForUnsupportedPostTypeReturnsError(): void
{
$response = $this->postJson(
'/api/post',
@@ -452,7 +452,7 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_client_api_request_creates_new_place(): void
+ public function micropubClientApiRequestCreatesNewPlace(): void
{
$faker = Factory::create();
$response = $this->postJson(
@@ -472,7 +472,7 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_client_api_request_creates_new_place_with_uncertainty_parameter(): void
+ public function micropubClientApiRequestCreatesNewPlaceWithUncertaintyParameter(): void
{
$faker = Factory::create();
$response = $this->postJson(
@@ -492,14 +492,14 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_client_api_request_updates_existing_note(): void
+ public function micropubClientApiRequestUpdatesExistingNote(): void
{
$note = Note::factory()->create();
$response = $this->postJson(
'/api/post',
[
'action' => 'update',
- 'url' => $note->uri,
+ 'url' => $note->longurl,
'replace' => [
'content' => ['replaced content'],
],
@@ -512,14 +512,14 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_client_api_request_updates_note_syndication_links(): void
+ public function micropubClientApiRequestUpdatesNoteSyndicationLinks(): void
{
$note = Note::factory()->create();
$response = $this->postJson(
'/api/post',
[
'action' => 'update',
- 'url' => $note->uri,
+ 'url' => $note->longurl,
'add' => [
'syndication' => [
'https://www.swarmapp.com/checkin/123',
@@ -539,14 +539,14 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_client_api_request_adds_image_to_note(): void
+ public function micropubClientApiRequestAddsImageToNote(): void
{
$note = Note::factory()->create();
$response = $this->postJson(
'/api/post',
[
'action' => 'update',
- 'url' => $note->uri,
+ 'url' => $note->longurl,
'add' => [
'photo' => ['https://example.org/photo.jpg'],
],
@@ -562,7 +562,7 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_client_api_request_returns_error_trying_to_update_non_note_model(): void
+ public function micropubClientApiRequestReturnsErrorTryingToUpdateNonNoteModel(): void
{
$response = $this->postJson(
'/api/post',
@@ -581,7 +581,7 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_client_api_request_returns_error_trying_to_update_non_existing_note(): void
+ public function micropubClientApiRequestReturnsErrorTryingToUpdateNonExistingNote(): void
{
$response = $this->postJson(
'/api/post',
@@ -600,14 +600,14 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_client_api_request_returns_error_when_trying_to_update_unsupported_property(): void
+ public function micropubClientApiRequestReturnsErrorWhenTryingToUpdateUnsupportedProperty(): void
{
$note = Note::factory()->create();
$response = $this->postJson(
'/api/post',
[
'action' => 'update',
- 'url' => $note->uri,
+ 'url' => $note->longurl,
'morph' => [ // or any other unsupported update type
'syndication' => ['https://www.swarmapp.com/checkin/123'],
],
@@ -620,7 +620,7 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_client_api_request_with_token_with_insufficient_scope_returns_error(): void
+ public function micropubClientApiRequestWithTokenWithInsufficientScopeReturnsError(): void
{
$response = $this->postJson(
'/api/post',
@@ -639,14 +639,14 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_client_api_request_can_replace_note_syndication_targets(): void
+ public function micropubClientApiRequestCanReplaceNoteSyndicationTargets(): void
{
$note = Note::factory()->create();
$response = $this->postJson(
'/api/post',
[
'action' => 'update',
- 'url' => $note->uri,
+ 'url' => $note->longurl,
'replace' => [
'syndication' => [
'https://www.swarmapp.com/checkin/the-id',
@@ -666,7 +666,7 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_client_web_request_can_encode_token_within_the_form(): void
+ public function micropubClientWebRequestCanEncodeTokenWithinTheForm(): void
{
$faker = Factory::create();
$note = $faker->text;
@@ -684,7 +684,7 @@ class MicropubControllerTest extends TestCase
}
#[Test]
- public function micropub_client_api_request_creates_articles_when_it_includes_the_name_property(): void
+ public function micropubClientApiRequestCreatesArticlesWhenItIncludesTheNameProperty(): void
{
$faker = Factory::create();
$name = $faker->text(50);
diff --git a/tests/Feature/MicropubMediaTest.php b/tests/Feature/MicropubMediaTest.php
index e11d8a1e..c38483f1 100644
--- a/tests/Feature/MicropubMediaTest.php
+++ b/tests/Feature/MicropubMediaTest.php
@@ -21,7 +21,7 @@ class MicropubMediaTest extends TestCase
use TestToken;
#[Test]
- public function empty_response_for_last_upload_when_none_found(): void
+ public function emptyResponseForLastUploadWhenNoneFound(): void
{
// Make sure there’s no media
$this->assertCount(0, Media::all());
@@ -35,7 +35,7 @@ class MicropubMediaTest extends TestCase
}
#[Test]
- public function get_request_with_invalid_token_returns_error_response(): void
+ public function getRequestWithInvalidTokenReturnsErrorResponse(): void
{
$response = $this->get(
'/api/media?q=last',
@@ -46,7 +46,7 @@ class MicropubMediaTest extends TestCase
}
#[Test]
- public function get_request_with_token_without_scope_returns_error_response(): void
+ public function getRequestWithTokenWithoutScopeReturnsErrorResponse(): void
{
$response = $this->get(
'/api/media?q=last',
@@ -57,7 +57,7 @@ class MicropubMediaTest extends TestCase
}
#[Test]
- public function get_request_with_token_with_insufficient_scope_returns_error_response(): void
+ public function getRequestWithTokenWithInsufficientScopeReturnsErrorResponse(): void
{
$response = $this->get(
'/api/media?q=last',
@@ -68,7 +68,7 @@ class MicropubMediaTest extends TestCase
}
#[Test]
- public function empty_get_request_with_token_receives_ok_response(): void
+ public function emptyGetRequestWithTokenReceivesOkResponse(): void
{
$response = $this->get(
'/api/media',
@@ -79,7 +79,7 @@ class MicropubMediaTest extends TestCase
}
#[Test]
- public function client_can_list_last_upload(): void
+ public function clientCanListLastUpload(): void
{
Queue::fake();
$file = __DIR__ . '/../aaron.png';
@@ -108,7 +108,7 @@ class MicropubMediaTest extends TestCase
}
#[Test]
- public function client_can_source_uploads(): void
+ public function clientCanSourceUploads(): void
{
Queue::fake();
$file = __DIR__ . '/../aaron.png';
@@ -140,7 +140,7 @@ class MicropubMediaTest extends TestCase
}
#[Test]
- public function client_can_source_uploads_with_limit(): void
+ public function clientCanSourceUploadsWithLimit(): void
{
Queue::fake();
$file = __DIR__ . '/../aaron.png';
@@ -174,7 +174,7 @@ class MicropubMediaTest extends TestCase
}
#[Test]
- public function media_endpoint_upload_requires_file(): void
+ public function mediaEndpointUploadRequiresFile(): void
{
$response = $this->post(
'/api/media',
@@ -190,7 +190,7 @@ class MicropubMediaTest extends TestCase
}
#[Test]
- public function error_response_for_unknown_q_value(): void
+ public function errorResponseForUnknownQValue(): void
{
$response = $this->get(
'/api/media?q=unknown',
@@ -201,7 +201,7 @@ class MicropubMediaTest extends TestCase
}
#[Test]
- public function options_request_returns_cors_response(): void
+ public function optionsRequestReturnsCorsResponse(): void
{
$response = $this->options('/api/media');
@@ -210,7 +210,7 @@ class MicropubMediaTest extends TestCase
}
#[Test]
- public function media_endpoint_request_with_invalid_token_returns400_response(): void
+ public function mediaEndpointRequestWithInvalidTokenReturns400Response(): void
{
$response = $this->post(
'/api/media',
@@ -222,7 +222,7 @@ class MicropubMediaTest extends TestCase
}
#[Test]
- public function media_endpoint_request_with_token_with_no_scope_returns400_response(): void
+ public function mediaEndpointRequestWithTokenWithNoScopeReturns400Response(): void
{
$response = $this->post(
'/api/media',
@@ -234,7 +234,7 @@ class MicropubMediaTest extends TestCase
}
#[Test]
- public function media_endpoint_request_with_insufficient_token_scopes_returns401_response(): void
+ public function mediaEndpointRequestWithInsufficientTokenScopesReturns401Response(): void
{
$response = $this->post(
'/api/media',
@@ -248,7 +248,7 @@ class MicropubMediaTest extends TestCase
}
#[Test]
- public function media_endpoint_upload_file(): void
+ public function mediaEndpointUploadFile(): void
{
Queue::fake();
$file = __DIR__ . '/../aaron.png';
@@ -271,7 +271,7 @@ class MicropubMediaTest extends TestCase
}
#[Test]
- public function media_endpoint_upload_audio_file(): void
+ public function mediaEndpointUploadAudioFile(): void
{
Queue::fake();
$file = __DIR__ . '/../audio.mp3';
@@ -294,7 +294,7 @@ class MicropubMediaTest extends TestCase
}
#[Test]
- public function media_endpoint_upload_video_file(): void
+ public function mediaEndpointUploadVideoFile(): void
{
Queue::fake();
$file = __DIR__ . '/../video.ogv';
@@ -317,7 +317,7 @@ class MicropubMediaTest extends TestCase
}
#[Test]
- public function media_endpoint_upload_document_file(): void
+ public function mediaEndpointUploadDocumentFile(): void
{
Queue::fake();
@@ -339,7 +339,7 @@ class MicropubMediaTest extends TestCase
}
#[Test]
- public function media_endpoint_upload_invalid_file_returns_error(): void
+ public function mediaEndpointUploadInvalidFileReturnsError(): void
{
Queue::fake();
Storage::fake('local');
diff --git a/tests/Feature/NotesControllerTest.php b/tests/Feature/NotesControllerTest.php
index ac3b08a4..43e5a050 100644
--- a/tests/Feature/NotesControllerTest.php
+++ b/tests/Feature/NotesControllerTest.php
@@ -18,7 +18,7 @@ class NotesControllerTest extends TestCase
* mean the database is being hit.
*/
#[Test]
- public function notes_page_loads(): void
+ public function notesPageLoads(): void
{
$response = $this->get('/notes');
$response->assertStatus(200);
@@ -28,10 +28,10 @@ class NotesControllerTest extends TestCase
* Test a specific note.
*/
#[Test]
- public function specific_note_page_loads(): void
+ public function specificNotePageLoads(): void
{
$note = Note::factory()->create();
- $response = $this->get($note->uri);
+ $response = $this->get($note->longurl);
$response->assertViewHas('note');
}
@@ -47,32 +47,32 @@ class NotesControllerTest extends TestCase
* Test that `/note/{decID}` redirects to `/notes/{nb60id}`.
*/
#[Test]
- public function old_note_urls_redirect(): void
+ public function oldNoteUrlsRedirect(): void
{
$note = Note::factory()->create();
$response = $this->get('/note/' . $note->id);
- $response->assertRedirect($note->uri);
+ $response->assertRedirect($note->longurl);
}
/**
* Visit the tagged page and check the tag view data.
*/
#[Test]
- public function tagged_notes_page_loads(): void
+ public function taggedNotesPageLoads(): void
{
$response = $this->get('/notes/tagged/beer');
$response->assertViewHas('tag', 'beer');
}
#[Test]
- public function unknown_note_gives404(): void
+ public function unknownNoteGives404(): void
{
$response = $this->get('/notes/112233');
$response->assertNotFound();
}
#[Test]
- public function check_note_id_not_out_of_range(): void
+ public function checkNoteIdNotOutOfRange(): void
{
$response = $this->get('/notes/photou-photologo');
$response->assertNotFound();
diff --git a/tests/Feature/OwnYourGramTest.php b/tests/Feature/OwnYourGramTest.php
index b2edaf97..a1ff9026 100644
--- a/tests/Feature/OwnYourGramTest.php
+++ b/tests/Feature/OwnYourGramTest.php
@@ -16,7 +16,7 @@ class OwnYourGramTest extends TestCase
use TestToken;
#[Test]
- public function posting_instagram_url_saves_media_path(): void
+ public function postingInstagramUrlSavesMediaPath(): void
{
$response = $this->json(
'POST',
diff --git a/tests/Feature/ParseCachedWebMentionsTest.php b/tests/Feature/ParseCachedWebMentionsTest.php
index ab66c6ac..ae0e9b3c 100644
--- a/tests/Feature/ParseCachedWebMentionsTest.php
+++ b/tests/Feature/ParseCachedWebMentionsTest.php
@@ -27,7 +27,7 @@ class ParseCachedWebMentionsTest extends TestCase
}
#[Test]
- public function parse_webmention_html(): void
+ public function parseWebmentionHtml(): void
{
$webmentionAaron = WebMention::factory()->create([
'source' => 'https://aaronpk.localhost/reply/1',
diff --git a/tests/Feature/PlacesTest.php b/tests/Feature/PlacesTest.php
index 26e16957..82a3e280 100644
--- a/tests/Feature/PlacesTest.php
+++ b/tests/Feature/PlacesTest.php
@@ -17,7 +17,7 @@ class PlacesTest extends TestCase
* Test the `/places` page for OK response.
*/
#[Test]
- public function places_page_loads(): void
+ public function placesPageLoads(): void
{
$response = $this->get('/places');
$response->assertStatus(200);
@@ -27,15 +27,15 @@ class PlacesTest extends TestCase
* Test a specific place.
*/
#[Test]
- public function single_place_page_loads(): void
+ public function singlePlacePageLoads(): void
{
$place = Place::factory()->create();
- $response = $this->get($place->uri);
+ $response = $this->get($place->longurl);
$response->assertViewHas('place', $place);
}
#[Test]
- public function unknown_place_gives404()
+ public function unknownPlaceGives404()
{
$response = $this->get('/places/unknown');
$response->assertNotFound();
diff --git a/tests/Feature/ReDownloadWebMentionsTest.php b/tests/Feature/ReDownloadWebMentionsTest.php
index 09fa1192..f3ea0b6f 100644
--- a/tests/Feature/ReDownloadWebMentionsTest.php
+++ b/tests/Feature/ReDownloadWebMentionsTest.php
@@ -17,7 +17,7 @@ class ReDownloadWebMentionsTest extends TestCase
use RefreshDatabase;
#[Test]
- public function download_job_gets_queued(): void
+ public function downloadJobGetsQueued(): void
{
Queue::fake();
diff --git a/tests/Feature/SearchTest.php b/tests/Feature/SearchTest.php
index eea6a9e0..582e8042 100644
--- a/tests/Feature/SearchTest.php
+++ b/tests/Feature/SearchTest.php
@@ -11,7 +11,7 @@ use Tests\TestCase;
class SearchTest extends TestCase
{
#[Test]
- public function search_endpoint_returns_results(): void
+ public function searchEndpointReturnsResults(): void
{
Note::factory(10)->create();
Note::Factory()->create(['note' => 'hello world']);
diff --git a/tests/Feature/ShortURLsControllerTest.php b/tests/Feature/ShortURLsControllerTest.php
new file mode 100644
index 00000000..989f3b5b
--- /dev/null
+++ b/tests/Feature/ShortURLsControllerTest.php
@@ -0,0 +1,39 @@
+get('https://' . config('url.shorturl'));
+ $response->assertRedirect(config('app.url'));
+ }
+
+ #[Test]
+ public function shortDomainSlashAtRedirectsToTwitter(): void
+ {
+ $response = $this->get('https://' . config('url.shorturl') . '/@');
+ $response->assertRedirect('https://twitter.com/jonnybarnes');
+ }
+
+ #[Test]
+ public function shortDomainSlashTRedirectsToLongDomainSlashNotes(): void
+ {
+ $response = $this->get('https://' . config('url.shorturl') . '/t/E');
+ $response->assertRedirect(config('app.url') . '/notes/E');
+ }
+
+ #[Test]
+ public function shortDomainSlashBRedirectsToLongDomainSlashBlog(): void
+ {
+ $response = $this->get('https://' . config('url.shorturl') . '/b/1');
+ $response->assertRedirect(config('app.url') . '/blog/s/1');
+ }
+}
diff --git a/tests/Feature/SwarmTest.php b/tests/Feature/SwarmTest.php
index 76caa962..84642009 100644
--- a/tests/Feature/SwarmTest.php
+++ b/tests/Feature/SwarmTest.php
@@ -21,7 +21,7 @@ class SwarmTest extends TestCase
* Given a check in to Foursquare, this is the content Ownyourswarm will post to us.
*/
#[Test]
- public function mocked_ownyourswarm_request_with_foursquare(): void
+ public function mockedOwnyourswarmRequestWithFoursquare(): void
{
Queue::fake();
@@ -68,7 +68,7 @@ class SwarmTest extends TestCase
* OpenStreetMap data.
*/
#[Test]
- public function mocked_ownyourswarm_request_with_osm(): void
+ public function mockedOwnyourswarmRequestWithOsm(): void
{
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
*/
#[Test]
- public function mocked_ownyourswarm_request_without_known_external_url(): void
+ public function mockedOwnyourswarmRequestWithoutKnownExternalUrl(): void
{
Queue::fake();
@@ -149,7 +149,7 @@ class SwarmTest extends TestCase
}
#[Test]
- public function mocked_ownyourswarm_request_with_no_text_content(): void
+ public function mockedOwnyourswarmRequestWithNoTextContent(): void
{
$response = $this->json(
'POST',
@@ -186,7 +186,7 @@ class SwarmTest extends TestCase
}
#[Test]
- public function mocked_ownyourswarm_request_saves_just_the_post_when_an_error_occurs_in_the_checkin_data(): void
+ public function mockedOwnyourswarmRequestSavesJustThePostWhenAnErrorOccursInTheCheckinData(): void
{
Queue::fake();
@@ -224,7 +224,7 @@ class SwarmTest extends TestCase
}
#[Test]
- public function mocked_ownyourswarm_request_with_h_adr_location(): void
+ public function mockedOwnyourswarmRequestWithHAdrLocation(): void
{
Queue::fake();
@@ -270,7 +270,7 @@ class SwarmTest extends TestCase
}
#[Test]
- public function ownyourswarm_checkin_test_using_real_data(): void
+ public function ownyourswarmCheckinTestUsingRealData(): void
{
$response = $this->json(
'POST',
diff --git a/tests/Feature/TokenServiceTest.php b/tests/Feature/TokenServiceTest.php
index 55024adf..24f581b3 100644
--- a/tests/Feature/TokenServiceTest.php
+++ b/tests/Feature/TokenServiceTest.php
@@ -19,7 +19,7 @@ class TokenServiceTest extends TestCase
* the APP_KEY, to test, we shall create a token, and then verify it.
*/
#[Test]
- public function tokenservice_creates_and_validates_tokens(): void
+ public function tokenserviceCreatesAndValidatesTokens(): void
{
$tokenService = new TokenService;
$data = [
@@ -38,7 +38,7 @@ class TokenServiceTest extends TestCase
}
#[Test]
- public function tokens_with_different_signing_key_throws_exception(): void
+ public function tokensWithDifferentSigningKeyThrowsException(): void
{
$this->expectException(RequiredConstraintsViolated::class);
diff --git a/tests/Feature/WebMentionsControllerTest.php b/tests/Feature/WebMentionsControllerTest.php
index 184b5a9c..d9482450 100644
--- a/tests/Feature/WebMentionsControllerTest.php
+++ b/tests/Feature/WebMentionsControllerTest.php
@@ -16,7 +16,7 @@ class WebMentionsControllerTest extends TestCase
use RefreshDatabase;
#[Test]
- public function webmention_endpoint_can_serve_browser_request(): void
+ public function webmentionEndpointCanServeBrowserRequest(): void
{
$response = $this->get('/webmention');
$response->assertViewIs('webmention-endpoint');
@@ -26,7 +26,7 @@ class WebMentionsControllerTest extends TestCase
* Test webmentions without source and target are rejected.
*/
#[Test]
- public function webmentions_without_source_and_target_are_rejected(): void
+ public function webmentionsWithoutSourceAndTargetAreRejected(): void
{
$response = $this->call('POST', '/webmention', ['source' => 'https://example.org/post/123']);
$response->assertStatus(400);
@@ -38,7 +38,7 @@ class WebMentionsControllerTest extends TestCase
* In this case an invalid target is a URL that doesn’t exist on our domain.
*/
#[Test]
- public function invalid_target_returns_error_response(): void
+ public function invalidTargetReturnsErrorResponse(): void
{
$response = $this->call('POST', '/webmention', [
'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]
- public function blog_target_returns501_response(): void
+ public function blogTargetReturns501Response(): void
{
$response = $this->call('POST', '/webmention', [
'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]
- public function nonexistent_note_returns_error_response(): void
+ public function nonexistentNoteReturnsErrorResponse(): void
{
$response = $this->call('POST', '/webmention', [
'source' => 'https://example.org/post/123',
@@ -74,7 +74,7 @@ class WebMentionsControllerTest extends TestCase
}
#[Test]
- public function legitimate_webmention_triggers_process_webmention_job(): void
+ public function legitimateWebmentionTriggersProcessWebmentionJob(): void
{
Queue::fake();
@@ -82,7 +82,7 @@ class WebMentionsControllerTest extends TestCase
$response = $this->call('POST', '/webmention', [
'source' => 'https://example.org/post/123',
- 'target' => $note->uri,
+ 'target' => $note->longurl,
]);
$response->assertStatus(202);
diff --git a/tests/Unit/ArticlesTest.php b/tests/Unit/ArticlesTest.php
index 9bb1dff1..a43a7006 100644
--- a/tests/Unit/ArticlesTest.php
+++ b/tests/Unit/ArticlesTest.php
@@ -15,7 +15,7 @@ class ArticlesTest extends TestCase
use RefreshDatabase;
#[Test]
- public function title_slug_is_generated_automatically(): void
+ public function titleSlugIsGeneratedAutomatically(): void
{
$article = new Article;
$article->title = 'My Title';
@@ -26,7 +26,7 @@ class ArticlesTest extends TestCase
}
#[Test]
- public function markdown_content_is_converted(): void
+ public function markdownContentIsConverted(): void
{
$article = new Article;
$article->main = 'Some *markdown*';
@@ -35,7 +35,7 @@ class ArticlesTest extends TestCase
}
#[Test]
- public function we_generate_the_different_time_attributes(): void
+ public function weGenerateTheDifferentTimeAttributes(): void
{
$article = Article::create([
'title' => 'Test',
@@ -49,7 +49,7 @@ class ArticlesTest extends TestCase
}
#[Test]
- public function we_generate_the_article_link_from_the_slug(): void
+ public function weGenerateTheArticleLinkFromTheSlug(): void
{
$article = Article::create([
'title' => 'Test',
@@ -64,7 +64,7 @@ class ArticlesTest extends TestCase
}
#[Test]
- public function date_scope_returns_expected_articles(): void
+ public function dateScopeReturnsExpectedArticles(): void
{
Article::factory()->create([
'created_at' => Carbon::now()->subYear()->toDateTimeString(),
@@ -83,7 +83,7 @@ class ArticlesTest extends TestCase
}
#[Test]
- public function date_scope_returns_expected_articles_for_december(): void
+ public function dateScopeReturnsExpectedArticlesForDecember(): void
{
Article::factory()->create([
'created_at' => Carbon::now()->setDay(11)->setMonth(11)->toDateTimeString(),
diff --git a/tests/Unit/BookmarksTest.php b/tests/Unit/BookmarksTest.php
index ce64848c..0f30267b 100644
--- a/tests/Unit/BookmarksTest.php
+++ b/tests/Unit/BookmarksTest.php
@@ -27,7 +27,7 @@ class BookmarksTest extends TestCase
}*/
#[Test]
- public function archive_link_method_calls_archive_service(): void
+ public function archiveLinkMethodCallsArchiveService(): void
{
$mock = new MockHandler([
new Response(200, ['Content-Location' => '/web/1234/example.org']),
@@ -40,7 +40,7 @@ class BookmarksTest extends TestCase
}
#[Test]
- public function archive_link_method_throws_an_exception_on_error(): void
+ public function archiveLinkMethodThrowsAnExceptionOnError(): void
{
$this->expectException(InternetArchiveException::class);
@@ -54,7 +54,7 @@ class BookmarksTest extends TestCase
}
#[Test]
- public function archive_link_method_throws_an_exception_if_no_location_returned(): void
+ public function archiveLinkMethodThrowsAnExceptionIfNoLocationReturned(): void
{
$this->expectException(InternetArchiveException::class);
diff --git a/tests/Unit/HelpersTest.php b/tests/Unit/HelpersTest.php
index 2da28a7d..601296ff 100644
--- a/tests/Unit/HelpersTest.php
+++ b/tests/Unit/HelpersTest.php
@@ -11,7 +11,7 @@ use Tests\TestCase;
class HelpersTest extends TestCase
{
#[Test]
- public function normalize_url_is_idempotent(): void
+ public function normalizeUrlIsIdempotent(): 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 normalize_url_on_data_provider(string $input, string $output): void
+ public function normalizeUrlOnDataProvider(string $input, string $output): void
{
$this->assertEquals($output, normalize_url($input));
}
#[Test]
- public function pretty_print_json(): void
+ public function prettyPrintJson(): void
{
// phpcs:disable Generic.Files.LineLength.TooLong
$json = <<<'JSON'
diff --git a/tests/Unit/Jobs/AddClientToDatabaseJobTest.php b/tests/Unit/Jobs/AddClientToDatabaseJobTest.php
index 3ed4d3d3..af07901b 100644
--- a/tests/Unit/Jobs/AddClientToDatabaseJobTest.php
+++ b/tests/Unit/Jobs/AddClientToDatabaseJobTest.php
@@ -14,7 +14,7 @@ class AddClientToDatabaseJobTest extends TestCase
use RefreshDatabase;
#[Test]
- public function client_is_added_to_database_by_job(): void
+ public function clientIsAddedToDatabaseByJob(): void
{
$job = new AddClientToDatabase('https://example.org/client');
$job->handle();
diff --git a/tests/Unit/Jobs/DownloadWebMentionJobTest.php b/tests/Unit/Jobs/DownloadWebMentionJobTest.php
index 3aee7810..6e11a49c 100644
--- a/tests/Unit/Jobs/DownloadWebMentionJobTest.php
+++ b/tests/Unit/Jobs/DownloadWebMentionJobTest.php
@@ -25,7 +25,7 @@ class DownloadWebMentionJobTest extends TestCase
}
#[Test]
- public function html_is_saved_by_job(): void
+ public function htmlIsSavedByJob(): void
{
$this->assertFileDoesNotExist(storage_path('HTML/https'));
$source = 'https://example.org/reply/1';
@@ -53,7 +53,7 @@ class DownloadWebMentionJobTest extends TestCase
}
#[Test]
- public function html_and_backup_saved_by_job(): void
+ public function htmlAndBackupSavedByJob(): void
{
$this->assertFileDoesNotExist(storage_path('HTML/https'));
$source = 'https://example.org/reply/1';
@@ -88,7 +88,7 @@ class DownloadWebMentionJobTest extends TestCase
}
#[Test]
- public function index_html_file_is_saved_by_job_for_urls_ending_with_slash(): void
+ public function indexHtmlFileIsSavedByJobForUrlsEndingWithSlash(): void
{
$this->assertFileDoesNotExist(storage_path('HTML/https'));
$source = 'https://example.org/reply-one/';
diff --git a/tests/Unit/Jobs/ProcessBookmarkJobTest.php b/tests/Unit/Jobs/ProcessBookmarkJobTest.php
index 5be0dd40..f433270b 100644
--- a/tests/Unit/Jobs/ProcessBookmarkJobTest.php
+++ b/tests/Unit/Jobs/ProcessBookmarkJobTest.php
@@ -19,7 +19,7 @@ class ProcessBookmarkJobTest extends TestCase
use RefreshDatabase;
#[Test]
- public function archive_link_is_saved_by_job_and_screenshot_job_is_queued(): void
+ public function archiveLinkIsSavedByJobAndScreenshotJobIsQueued(): void
{
Queue::fake();
@@ -40,7 +40,7 @@ class ProcessBookmarkJobTest extends TestCase
}
#[Test]
- public function archive_link_saved_as_null_when_exception_thrown(): void
+ public function archiveLinkSavedAsNullWhenExceptionThrown(): void
{
Queue::fake();
diff --git a/tests/Unit/Jobs/ProcessMediaJobTest.php b/tests/Unit/Jobs/ProcessMediaJobTest.php
index e3fa2059..daecc00e 100644
--- a/tests/Unit/Jobs/ProcessMediaJobTest.php
+++ b/tests/Unit/Jobs/ProcessMediaJobTest.php
@@ -13,7 +13,7 @@ use Tests\TestCase;
class ProcessMediaJobTest extends TestCase
{
#[Test]
- public function non_media_files_are_not_saved(): void
+ public function nonMediaFilesAreNotSaved(): 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 small_images_are_not_resized(): void
+ public function smallImagesAreNotResized(): 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 large_images_have_smaller_images_created(): void
+ public function largeImagesHaveSmallerImagesCreated(): void
{
$manager = app()->make(ImageManager::class);
Storage::disk('local')->put('media/test-image.jpg', file_get_contents(__DIR__.'/../../test-image.jpg'));
diff --git a/tests/Unit/Jobs/ProcessWebMentionJobTest.php b/tests/Unit/Jobs/ProcessWebMentionJobTest.php
index e3754b86..1bf56621 100644
--- a/tests/Unit/Jobs/ProcessWebMentionJobTest.php
+++ b/tests/Unit/Jobs/ProcessWebMentionJobTest.php
@@ -34,7 +34,7 @@ class ProcessWebMentionJobTest extends TestCase
}
#[Test]
- public function failure_getting_webmention_throws_an_exception(): void
+ public function failureGettingWebmentionThrowsAnException(): void
{
$this->expectException(RemoteContentNotFoundException::class);
@@ -53,7 +53,7 @@ class ProcessWebMentionJobTest extends TestCase
}
#[Test]
- public function new_webmention_gets_saved_by_job(): void
+ public function newWebmentionGetsSavedByJob(): void
{
Queue::fake();
@@ -85,7 +85,7 @@ class ProcessWebMentionJobTest extends TestCase
}
#[Test]
- public function existing_webmention_gets_updated_by_job(): void
+ public function existingWebmentionGetsUpdatedByJob(): void
{
Queue::fake();
@@ -94,12 +94,12 @@ class ProcessWebMentionJobTest extends TestCase
$source = 'https://aaronpk.localhost/reply/1';
WebMention::factory()->create([
'source' => $source,
- 'target' => $note->uri,
+ 'target' => $note->longurl,
]);
$html = <<
-
In reply to a note
+
In reply to a note
Updated reply
HTML;
@@ -117,12 +117,12 @@ class ProcessWebMentionJobTest extends TestCase
'source' => $source,
'type' => 'in-reply-to',
// phpcs:ignore Generic.Files.LineLength.TooLong
- 'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"content": [{"html": "Updated reply", "value": "Updated reply"}], "in-reply-to": ["' . $note->uri . '"]}}], "rel-urls": []}',
+ 'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"content": [{"html": "Updated reply", "value": "Updated reply"}], "in-reply-to": ["' . $note->longurl . '"]}}], "rel-urls": []}',
]);
}
#[Test]
- public function webmention_reply_gets_deleted_when_reply_to_value_changes(): void
+ public function webmentionReplyGetsDeletedWhenReplyToValueChanges(): void
{
$parser = new Parser;
@@ -159,7 +159,7 @@ class ProcessWebMentionJobTest extends TestCase
}
#[Test]
- public function webmention_like_gets_deleted_when_like_of_value_changes(): void
+ public function webmentionLikeGetsDeletedWhenLikeOfValueChanges(): void
{
$parser = new Parser;
@@ -196,7 +196,7 @@ class ProcessWebMentionJobTest extends TestCase
}
#[Test]
- public function webmention_repost_gets_deleted_when_repost_of_value_changes(): void
+ public function webmentionRepostGetsDeletedWhenRepostOfValueChanges(): void
{
$parser = new Parser;
diff --git a/tests/Unit/Jobs/SaveProfileImageJobTest.php b/tests/Unit/Jobs/SaveProfileImageJobTest.php
index 67d441fa..3c418a7a 100644
--- a/tests/Unit/Jobs/SaveProfileImageJobTest.php
+++ b/tests/Unit/Jobs/SaveProfileImageJobTest.php
@@ -26,7 +26,7 @@ class SaveProfileImageJobTest extends TestCase
}
#[Test]
- public function authorship_algorithm_returns_null_on_exception(): void
+ public function authorshipAlgorithmReturnsNullOnException(): void
{
$mf = ['items' => []];
$authorship = $this->createMock(Authorship::class);
@@ -38,7 +38,7 @@ class SaveProfileImageJobTest extends TestCase
}
#[Test]
- public function we_do_not_process_twitter_images(): void
+ public function weDoNotProcessTwitterImages(): void
{
$mf = ['items' => []];
$author = [
@@ -56,7 +56,7 @@ class SaveProfileImageJobTest extends TestCase
}
#[Test]
- public function remote_author_images_are_saved_locally(): void
+ public function remoteAuthorImagesAreSavedLocally(): 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 local_default_author_image_is_used_as_fallback(): void
+ public function localDefaultAuthorImageIsUsedAsFallback(): void
{
$mock = new MockHandler([
new Response(404),
@@ -109,7 +109,7 @@ class SaveProfileImageJobTest extends TestCase
}
#[Test]
- public function we_get_url_from_photo_object_if_alt_text_is_provided(): void
+ public function weGetUrlFromPhotoObjectIfAltTextIsProvided(): 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 use_first_url_if_multiple_homepages_are_provided(): void
+ public function useFirstUrlIfMultipleHomepagesAreProvided(): void
{
$mock = new MockHandler([
new Response(200, ['Content-Type' => 'image/jpeg'], 'fake jpeg image'),
diff --git a/tests/Unit/Jobs/SaveScreenshotJobTest.php b/tests/Unit/Jobs/SaveScreenshotJobTest.php
index f8066bbd..b2c3ef15 100644
--- a/tests/Unit/Jobs/SaveScreenshotJobTest.php
+++ b/tests/Unit/Jobs/SaveScreenshotJobTest.php
@@ -21,7 +21,7 @@ class SaveScreenshotJobTest extends TestCase
use RefreshDatabase;
#[Test]
- public function screenshot_is_saved_by_job(): void
+ public function screenshotIsSavedByJob(): void
{
Storage::fake('public');
$guzzleMock = new MockHandler([
@@ -86,7 +86,7 @@ class SaveScreenshotJobTest extends TestCase
}
#[Test]
- public function screenshot_job_handles_unfinished_tasks(): void
+ public function screenshotJobHandlesUnfinishedTasks(): void
{
Storage::fake('public');
$guzzleMock = new MockHandler([
diff --git a/tests/Unit/Jobs/SendWebMentionJobTest.php b/tests/Unit/Jobs/SendWebMentionJobTest.php
index 7bfd24a1..9eef719b 100644
--- a/tests/Unit/Jobs/SendWebMentionJobTest.php
+++ b/tests/Unit/Jobs/SendWebMentionJobTest.php
@@ -16,7 +16,7 @@ use Tests\TestCase;
class SendWebMentionJobTest extends TestCase
{
#[Test]
- public function discover_webmention_endpoint_on_own_domain(): void
+ public function discoverWebmentionEndpointOnOwnDomain(): void
{
$note = new Note;
$job = new SendWebMentions($note);
@@ -25,7 +25,7 @@ class SendWebMentionJobTest extends TestCase
}
#[Test]
- public function discover_webmention_endpoint_from_header_links(): void
+ public function discoverWebmentionEndpointFromHeaderLinks(): void
{
$url = 'https://example.org/webmention';
$mock = new MockHandler([
@@ -40,7 +40,7 @@ class SendWebMentionJobTest extends TestCase
}
#[Test]
- public function discover_webmention_endpoint_from_html_link_tags(): void
+ public function discoverWebmentionEndpointFromHtmlLinkTags(): void
{
$html = '
';
$mock = new MockHandler([
@@ -58,7 +58,7 @@ class SendWebMentionJobTest extends TestCase
}
#[Test]
- public function discover_webmention_endpoint_from_legacy_html_markup(): void
+ public function discoverWebmentionEndpointFromLegacyHtmlMarkup(): void
{
$html = '
';
$mock = new MockHandler([
@@ -76,14 +76,14 @@ class SendWebMentionJobTest extends TestCase
}
#[Test]
- public function ensure_empty_note_does_not_trigger_any_actions(): void
+ public function ensureEmptyNoteDoesNotTriggerAnyActions(): void
{
$job = new SendWebMentions(new Note);
$this->assertNull($job->handle());
}
#[Test]
- public function we_resolve_relative_uris(): void
+ public function weResolveRelativeUris(): void
{
$uri = '/blog/post';
$base = 'https://example.org/';
@@ -92,7 +92,7 @@ class SendWebMentionJobTest extends TestCase
}
#[Test]
- public function we_send_a_webmention_for_a_note(): void
+ public function weSendAWebmentionForANote(): void
{
$html = '
';
$mock = new MockHandler([
@@ -112,7 +112,7 @@ class SendWebMentionJobTest extends TestCase
}
#[Test]
- public function links_in_notes_can_not_support_webmentions(): void
+ public function linksInNotesCanNotSupportWebmentions(): void
{
$mock = new MockHandler([
// URLs with commas currently break the parse function I’m using
diff --git a/tests/Unit/Jobs/SyndicateNoteToBlueskyJobTest.php b/tests/Unit/Jobs/SyndicateNoteToBlueskyJobTest.php
index e225cbf2..2dbae153 100644
--- a/tests/Unit/Jobs/SyndicateNoteToBlueskyJobTest.php
+++ b/tests/Unit/Jobs/SyndicateNoteToBlueskyJobTest.php
@@ -19,7 +19,7 @@ class SyndicateNoteToBlueskyJobTest extends TestCase
use RefreshDatabase;
#[Test]
- public function we_syndicate_notes_to_bluesky(): void
+ public function weSyndicateNotesToBluesky(): void
{
config(['bridgy.bluesky_token' => 'test']);
$faker = Factory::create();
@@ -40,7 +40,7 @@ class SyndicateNoteToBlueskyJobTest extends TestCase
}
#[Test]
- public function we_syndicate_the_original_markdown_to_bluesky(): void
+ public function weSyndicateTheOriginalMarkdownToBluesky(): void
{
config(['bridgy.bluesky_token' => 'test']);
$faker = Factory::create();
diff --git a/tests/Unit/Jobs/SyndicateNoteToMastodonJobTest.php b/tests/Unit/Jobs/SyndicateNoteToMastodonJobTest.php
index 47ecdd97..d7215223 100644
--- a/tests/Unit/Jobs/SyndicateNoteToMastodonJobTest.php
+++ b/tests/Unit/Jobs/SyndicateNoteToMastodonJobTest.php
@@ -19,7 +19,7 @@ class SyndicateNoteToMastodonJobTest extends TestCase
use RefreshDatabase;
#[Test]
- public function we_syndicate_notes_to_mastodon(): void
+ public function weSyndicateNotesToMastodon(): void
{
config(['bridgy.mastodon_token' => 'test']);
$faker = Factory::create();
@@ -40,7 +40,7 @@ class SyndicateNoteToMastodonJobTest extends TestCase
}
#[Test]
- public function we_syndicate_the_original_markdown(): void
+ public function weSyndicateTheOriginalMarkdown(): void
{
config(['bridgy.mastodon_token' => 'test']);
$faker = Factory::create();
diff --git a/tests/Unit/LikesTest.php b/tests/Unit/LikesTest.php
index 74412833..073d1ca4 100644
--- a/tests/Unit/LikesTest.php
+++ b/tests/Unit/LikesTest.php
@@ -14,7 +14,7 @@ class LikesTest extends TestCase
use RefreshDatabase;
#[Test]
- public function we_can_set_the_author_url(): void
+ public function weCanSetTheAuthorUrl(): void
{
$like = new Like;
$like->author_url = 'https://joe.bloggs/';
@@ -22,7 +22,7 @@ class LikesTest extends TestCase
}
#[Test]
- public function we_do_not_modify_plain_text_content(): void
+ public function weDoNotModifyPlainTextContent(): void
{
$like = new Like;
$like->url = 'https://example.org/post/123';
@@ -33,7 +33,7 @@ class LikesTest extends TestCase
}
#[Test]
- public function we_can_handle_blank_content(): void
+ public function weCanHandleBlankContent(): void
{
$like = new Like;
$like->url = 'https://example.org/post/123';
@@ -44,7 +44,7 @@ class LikesTest extends TestCase
}
#[Test]
- public function html_like_content_is_filtered(): void
+ public function htmlLikeContentIsFiltered(): void
{
$htmlEvil = <<<'HTML'
diff --git a/tests/Unit/MediaTest.php b/tests/Unit/MediaTest.php
index 642d797f..4dd4c256 100644
--- a/tests/Unit/MediaTest.php
+++ b/tests/Unit/MediaTest.php
@@ -15,7 +15,7 @@ class MediaTest extends TestCase
use RefreshDatabase;
#[Test]
- public function get_the_note_that_media_instance_belongs_to(): void
+ public function getTheNoteThatMediaInstanceBelongsTo(): void
{
$media = Media::factory()->for(Note::factory())->create();
@@ -23,7 +23,7 @@ class MediaTest extends TestCase
}
#[Test]
- public function absolute_urls_are_returned_unmodified(): void
+ public function absoluteUrlsAreReturnedUnmodified(): void
{
$absoluteUrl = 'https://instagram-cdn.com/image/uuid';
$media = new Media;
diff --git a/tests/Unit/MicropubClientsTest.php b/tests/Unit/MicropubClientsTest.php
index c6c2d322..d3bc0e01 100644
--- a/tests/Unit/MicropubClientsTest.php
+++ b/tests/Unit/MicropubClientsTest.php
@@ -15,7 +15,7 @@ class MicropubClientsTest extends TestCase
use RefreshDatabase;
#[Test]
- public function we_can_get_notes_relating_to_client(): void
+ public function weCanGetNotesRelatingToClient(): void
{
$client = MicropubClient::factory()->make();
diff --git a/tests/Unit/NotesTest.php b/tests/Unit/NotesTest.php
index e71f513a..2f157c8a 100644
--- a/tests/Unit/NotesTest.php
+++ b/tests/Unit/NotesTest.php
@@ -28,7 +28,7 @@ class NotesTest extends TestCase
* relevant sub-methods.
*/
#[Test]
- public function get_note_attribute_method_calls_sub_methods(): void
+ public function getNoteAttributeMethodCallsSubMethods(): void
{
// phpcs:ignore
$expected = '
Having a #beer at the local. 🍺
' . PHP_EOL;
@@ -42,7 +42,7 @@ class NotesTest extends TestCase
* Look for a default image in the contact’s h-card for the makeHCards method.
*/
#[Test]
- public function default_image_used_as_fallback_in_makehcards_method(): void
+ public function defaultImageUsedAsFallbackInMakehcardsMethod(): void
{
// phpcs:ignore
$expected = '
Hi
@@ -71,7 +71,7 @@ class NotesTest extends TestCase
* Look for a specific profile image in the contact’s h-card.
*/
#[Test]
- public function specific_profile_image_used_in_makehcards_method(): void
+ public function specificProfileImageUsedInMakehcardsMethod(): void
{
Contact::factory()->create([
'nick' => 'aaron',
@@ -106,7 +106,7 @@ class NotesTest extends TestCase
* Look for twitter URL when there’s no associated contact.
*/
#[Test]
- public function twitter_link_is_created_when_no_contact_found(): void
+ public function twitterLinkIsCreatedWhenNoContactFound(): void
{
$expected = 'Hi @bob
' . PHP_EOL;
$note = Note::factory()->create([
@@ -116,7 +116,15 @@ class NotesTest extends TestCase
}
#[Test]
- public function we_get_latitude_longitude_values_of_associated_place_of_note(): void
+ public function shorturlMethodReturnsExpectedValue(): void
+ {
+ $note = Note::factory()->make();
+ $note->id = 14;
+ $this->assertEquals(config('url.shorturl') . '/notes/E', $note->shorturl);
+ }
+
+ #[Test]
+ public function weGetLatitudeLongitudeValuesOfAssociatedPlaceOfNote(): void
{
$place = Place::factory()->create([
'latitude' => '53.4983',
@@ -130,7 +138,7 @@ class NotesTest extends TestCase
}
#[Test]
- public function when_no_associated_place_we_get_null_for_latitude_longitude_values(): void
+ public function whenNoAssociatedPlaceWeGetNullForLatitudeLongitudeValues(): void
{
$note = Note::factory()->create();
$this->assertNull($note->latitude);
@@ -138,7 +146,7 @@ class NotesTest extends TestCase
}
#[Test]
- public function we_can_get_address_attribute_for_associated_place(): void
+ public function weCanGetAddressAttributeForAssociatedPlace(): void
{
$place = Place::factory()->create([
'name' => 'The Bridgewater Pub',
@@ -152,7 +160,7 @@ class NotesTest extends TestCase
}
#[Test]
- public function deleting_notes_also_deletes_tags_via_the_event_observer(): void
+ public function deletingNotesAlsoDeletesTagsViaTheEventObserver(): void
{
// first we’ll create a temporary note to delete
$note = Note::create(['note' => 'temporary #temp']);
@@ -167,7 +175,7 @@ class NotesTest extends TestCase
}
#[Test]
- public function save_blank_notes_as_null(): void
+ public function saveBlankNotesAsNull(): void
{
$note = new Note(['note' => '']);
@@ -175,7 +183,7 @@ class NotesTest extends TestCase
}
#[Test]
- public function reverse_geocode_an_attraction(): void
+ public function reverseGeocodeAnAttraction(): void
{
// phpcs:disable Generic.Files.LineLength.TooLong
$json = <<create([
'type' => 'image',
@@ -317,7 +325,7 @@ class NotesTest extends TestCase
}
#[Test]
- public function add_video_element_to_note_content_when_media_associated(): void
+ public function addVideoElementToNoteContentWhenMediaAssociated(): void
{
$media = Media::factory()->create([
'type' => 'video',
@@ -334,7 +342,7 @@ class NotesTest extends TestCase
}
#[Test]
- public function add_audio_element_to_note_content_when_media_associated(): void
+ public function addAudioElementToNoteContentWhenMediaAssociated(): void
{
$media = Media::factory()->create([
'type' => 'audio',
@@ -354,7 +362,7 @@ class NotesTest extends TestCase
* @todo Why do we need to provide text?
*/
#[Test]
- public function provide_text_for_blank_content(): void
+ public function provideTextForBlankContent(): void
{
$note = new Note;
@@ -374,11 +382,11 @@ class NotesTest extends TestCase
public function markdown_content_gets_converted(): void
{
$note = Note::factory()->create([
- 'note' => 'The best search engine? https://kagi.com',
+ 'note' => 'The best search engine? https://duckduckgo.com',
]);
$this->assertSame(
- 'The best search engine? https://kagi.com
' . PHP_EOL,
+ 'The best search engine? https://duckduckgo.com
' . PHP_EOL,
$note->note
);
}
@@ -387,7 +395,7 @@ class NotesTest extends TestCase
* For now, just reply on a cached object instead of actually querying Twitter.
*/
#[Test]
- public function check_in_reply_to_is_twitter_link(): void
+ public function checkInReplyToIsTwitterLink(): void
{
$tempContent = (object) [
'html' => 'something random',
@@ -402,7 +410,7 @@ class NotesTest extends TestCase
}
#[Test]
- public function latitude_and_longitude_can_be_parsed_from_plain_location(): void
+ public function latitudeAndLongitudeCanBeParsedFromPlainLocation(): void
{
$note = Note::factory()->create([
'location' => '1.23,4.56',
@@ -413,7 +421,7 @@ class NotesTest extends TestCase
}
#[Test]
- public function address_attribute_can_be_retrieved_from_plain_location(): void
+ public function addressAttributeCanBeRetrievedFromPlainLocation(): void
{
Cache::put('1.23,4.56', 'Antarctica');
@@ -425,7 +433,7 @@ class NotesTest extends TestCase
}
#[Test]
- public function mastodon_usernames_are_parsed_correctly(): void
+ public function mastodonUsernamesAreParsedCorrectly(): void
{
$expected = 'Hi @freekmurze@phpc.social how are you?
' . PHP_EOL;
$note = Note::factory()->create([
diff --git a/tests/Unit/PlacesTest.php b/tests/Unit/PlacesTest.php
index cb100ee1..b3f0ed37 100644
--- a/tests/Unit/PlacesTest.php
+++ b/tests/Unit/PlacesTest.php
@@ -18,7 +18,7 @@ class PlacesTest extends TestCase
use RefreshDatabase;
#[Test]
- public function can_retrieve_associated_notes(): void
+ public function canRetrieveAssociatedNotes(): void
{
$place = Place::factory()->create();
Note::factory(5)->create([
@@ -29,7 +29,7 @@ class PlacesTest extends TestCase
}
#[Test]
- public function near_method_returns_collection(): void
+ public function nearMethodReturnsCollection(): void
{
Place::factory()->create([
'name' => 'The Bridgewater Pub',
@@ -41,7 +41,25 @@ class PlacesTest extends TestCase
}
#[Test]
- public function get_uri(): void
+ public function getLongurl(): void
+ {
+ $place = Place::factory()->create([
+ 'name' => 'The Bridgewater Pub',
+ ]);
+ $this->assertEquals(config('app.url') . '/places/the-bridgewater-pub', $place->longurl);
+ }
+
+ #[Test]
+ public function getShorturl()
+ {
+ $place = Place::factory()->create([
+ 'name' => 'The Bridgewater Pub',
+ ]);
+ $this->assertEquals(config('url.shorturl') . '/places/the-bridgewater-pub', $place->shorturl);
+ }
+
+ #[Test]
+ public function getUri(): void
{
$place = Place::factory()->create([
'name' => 'The Bridgewater Pub',
@@ -50,7 +68,7 @@ class PlacesTest extends TestCase
}
#[Test]
- public function place_service_returns_existing_place_based_on_external_urls_search(): void
+ public function placeServiceReturnsExistingPlaceBasedOnExternalUrlsSearch(): void
{
Place::factory(10)->create();
@@ -70,7 +88,7 @@ class PlacesTest extends TestCase
}
#[Test]
- public function place_service_requires_name_when_creating_new_place(): void
+ public function placeServiceRequiresNameWhenCreatingNewPlace(): void
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Missing required name');
@@ -80,7 +98,7 @@ class PlacesTest extends TestCase
}
#[Test]
- public function place_service_requires_latitude_when_creating_new_place(): void
+ public function placeServiceRequiresLatitudeWhenCreatingNewPlace(): void
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Missing required longitude/latitude');
@@ -90,7 +108,7 @@ class PlacesTest extends TestCase
}
#[Test]
- public function place_service_can_update_external_urls(): void
+ public function placeServiceCanUpdateExternalUrls(): void
{
$place = Place::factory()->create([
'name' => 'The Bridgewater Pub',
diff --git a/tests/Unit/TagsTest.php b/tests/Unit/TagsTest.php
index 2dd76911..4d9dcdd0 100644
--- a/tests/Unit/TagsTest.php
+++ b/tests/Unit/TagsTest.php
@@ -17,7 +17,7 @@ class TagsTest extends TestCase
use RefreshDatabase;
#[Test]
- public function can_get_associated_notes(): void
+ public function canGetAssociatedNotes(): void
{
$note = Note::factory()->create();
$tag = Tag::factory()->create();
@@ -26,7 +26,7 @@ class TagsTest extends TestCase
}
#[Test]
- public function can_get_associated_bookmarks(): void
+ public function canGetAssociatedBookmarks(): void
{
$bookmark = Bookmark::factory()->create();
$tag = Tag::factory()->create();
@@ -36,7 +36,7 @@ class TagsTest extends TestCase
#[Test]
#[DataProvider('tagsProvider')]
- public function can_normalize(string $input, string $expected): void
+ public function canNormalize(string $input, string $expected): void
{
$this->assertSame($expected, Tag::normalize($input));
}
diff --git a/tests/Unit/WebMentionTest.php b/tests/Unit/WebMentionTest.php
index edfd4026..7a6ce471 100644
--- a/tests/Unit/WebMentionTest.php
+++ b/tests/Unit/WebMentionTest.php
@@ -18,7 +18,7 @@ class WebMentionTest extends TestCase
use RefreshDatabase;
#[Test]
- public function commentable_method_links_to_notes(): void
+ public function commentableMethodLinksToNotes(): void
{
$note = Note::factory()->create();
$webmention = WebMention::factory()->make([
@@ -29,7 +29,7 @@ class WebMentionTest extends TestCase
}
#[Test]
- public function published_attribute_uses_updated_at_when_no_relevant_mf2_data(): void
+ public function publishedAttributeUsesUpdatedAtWhenNoRelevantMf2Data(): void
{
$webmention = new WebMention;
$updated_at = Carbon::now();
@@ -38,7 +38,7 @@ class WebMentionTest extends TestCase
}
#[Test]
- public function published_attribute_uses_updated_at_when_error_parsing_mf2_data(): void
+ public function publishedAttributeUsesUpdatedAtWhenErrorParsingMf2Data(): void
{
$webmention = new WebMention;
$updated_at = Carbon::now();
@@ -56,7 +56,7 @@ class WebMentionTest extends TestCase
}
#[Test]
- public function create_photo_link_does_nothing_with_generic_url_and_no_locally_saved_image(): void
+ public function createPhotoLinkDoesNothingWithGenericUrlAndNoLocallySavedImage(): void
{
$webmention = new WebMention;
$homepage = 'https://example.org/profile.png';
@@ -65,7 +65,7 @@ class WebMentionTest extends TestCase
}
#[Test]
- public function create_photo_link_returns_locally_saved_image_url_if_it_exists(): void
+ public function createPhotoLinkReturnsLocallySavedImageUrlIfItExists(): void
{
$webmention = new WebMention;
$homepage = 'https://aaronparecki.com/profile.png';
@@ -74,7 +74,7 @@ class WebMentionTest extends TestCase
}
#[Test]
- public function create_photo_link_deals_with_special_case_of_direct_twitter_photo_links(): void
+ public function createPhotoLinkDealsWithSpecialCaseOfDirectTwitterPhotoLinks(): void
{
$webmention = new WebMention;
$twitterProfileImage = 'http://pbs.twimg.com/1234';
@@ -83,7 +83,7 @@ class WebMentionTest extends TestCase
}
#[Test]
- public function create_photo_link_returns_cached_twitter_photo_links(): void
+ public function createPhotoLinkReturnsCachedTwitterPhotoLinks(): void
{
$webmention = new WebMention;
$twitterURL = 'https://twitter.com/example';
@@ -93,7 +93,7 @@ class WebMentionTest extends TestCase
}
#[Test]
- public function create_photo_link_resolves_twitter_photo_links(): void
+ public function createPhotoLinkResolvesTwitterPhotoLinks(): 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 get_reply_attribute_defaults_to_null(): void
+ public function getReplyAttributeDefaultsToNull(): void
{
$webmention = new WebMention;
$this->assertNull($webmention->reply);
}
#[Test]
- public function get_reply_attribute_with_mf2_without_html_returns_null(): void
+ public function getReplyAttributeWithMf2WithoutHtmlReturnsNull(): void
{
$webmention = new WebMention;
$webmention->mf2 = json_encode(['no_html' => 'found_here']);