Commit graph jonnybarnes.uk/tests/Unit
Author SHA1 Message Date
31c49ac3fc
Adopt Laravel's Image facade for media processing, upgrade Intervention to v4
Laravel 13's Image facade wraps Intervention Image v4 internally, so
switching our upload width probe and resize job/command to it required
bumping intervention/image ^3 -> ^4 (and its intervention/gif ^5
dependency). Removes our own ImageManager container binding and
config/image.php in favour of Laravel's built-in driver resolution.

Also fixes a latent filename mismatch in ProcessMediaJobTest that Pint's
stricter typing on the new Image API turned into a hard TypeError, and
tidies config/flare.php to use imported class names instead of FQCNs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Sorsgn85nw7uQyRMNvzyD
2026-08-01 17:07:38 +01:00
e08763c526
Migrate outbound HTTP calls from Guzzle to the Http facade
Replaces every raw GuzzleHttp\Client usage (Nominatim, web.archive.org,
webmention fetch/discover/send, Bridgy syndication, IndieAuth client_id
lookup, contact avatar/h-card fetch, profile image download, and the
CloudConvert screenshot pipeline) with Illuminate\Support\Facades\Http,
and enables Http::preventStrayRequests() globally in tests so any
un-faked outbound call now fails loudly instead of silently hitting the
network.

The CloudConvert retry-until-finished middleware in AppServiceProvider
is replaced by a plain polling loop in SaveScreenshot, which also fixes
a latent bug where the old middleware decoded a response object instead
of its body. Bridgy syndication jobs keep their tries=1/no-retry
semantics unchanged to avoid duplicate publishes. Guzzle's PSR-7 helpers
(Header, UriResolver, Utils) stay in SendWebMentions since Http has no
equivalent for them.

Every affected test file's Guzzle MockHandler/HandlerStack boilerplate
is replaced with Http::fake()/Http::sequence().

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P8j7cJhCiYDsGUgB7obKNQ
2026-07-26 09:12:01 +01:00
db09718a96
Switch Bridgy syndication from Micropub to webmention
Bridgy's Micropub endpoint required per-silo access tokens and posted
raw markdown content directly. Switch to Bridgy's webmention publish
endpoint instead: POST source/target to /publish/webmention and let
Bridgy re-fetch the note page, which now carries hidden verification
links for silos not yet syndicated. Removes the now-unused
config/bridgy.php and BRIDGY_MASTODON_TOKEN env var, and caps both
jobs to a single try since retries would send Bridgy a duplicate
publish webmention.
2026-07-14 17:36:25 +01:00
9f012b01e4
Upgrade to Laravel 13 2026-04-07 09:01:19 +01:00
0a13d27d6f
Expand webmentions source and target columns to text
Long brid.gy Bluesky source URLs exceed 255 characters, causing
SQLSTATE[22001] errors. Changed source and target from varchar(255)
to text (no performance impact in PostgreSQL).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 16:32:22 +00:00
51780523b4
Fix unit tests 2026-01-04 10:22:32 +00:00
9e788e0fe8
Images can be uploaded with alt text
This means associating images to notes via a pivot table, we also finish
off the migration of medai from S3.
2026-01-04 10:07:25 +00:00
76db869af5
Allow files to be added to notes
This is specifically when a Micropub client is using the JSON syntax and
initially uploads the photo via the media endpoint
2025-12-27 17:58:43 +00:00
126bb29ae2
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
2025-04-06 17:25:06 +01:00
7a58287b34
Remove references to short domain 2025-04-06 17:22:36 +01:00
1dfa17abca
Update Laravel to v12
Some checks failed
PHP Unit / PHPUnit test suite (pull_request) Has been cancelled
Laravel Pint / Laravel Pint (pull_request) Has been cancelled
2025-04-01 21:10:30 +01:00
43447ac47b
Fix tests after we corrected the media URLs
Some checks failed
PHP Unit / PHPUnit test suite (pull_request) Has been cancelled
Laravel Pint / Laravel Pint (pull_request) Has been cancelled
The media URLs have a path that starts `/storage/`.
2024-10-26 12:52:43 +01:00
d7da42b626
Host images locally
Some checks failed
PHP Unit / PHPUnit test suite (pull_request) Has been cancelled
Laravel Pint / Laravel Pint (pull_request) Has been cancelled
We don’t need the complexity of S3. Sepcifically the complexity of
managing my own AWS account, flysystem made the Laravel side easy.

A command is added to copy the the S3 files over to local storage.
2024-10-25 20:40:52 +01:00
cbbe87e23c
Setup support for syndicating to Bluesky 2024-03-23 21:19:54 +00:00
659bc57e24
Fix issue discovering webmentions endpoints for some sites
The Guzzle provided Header::parse does not like commas in URLs
2024-03-02 10:16:05 +00:00
2aa60db548
Update JSON notes feed to version 1.1 2023-12-20 14:44:11 +00:00
10b51c654d
Fix unit tests 2023-11-27 22:20:40 +00:00
05c63b241d
feat: Refactor mention rendering and generator classes
- Add support for Mastodon username mentions
- Add test for parsing Mastodon usernames in notes
- Modify namespace and class imports for `MentionGenerator` and `MentionRenderer` in `Note.php`
- Rename `ContactMentionGenerator.php` to `MentionGenerator.php`
2023-11-19 17:22:02 +00:00
dabd03f556
refactor: Refactor and add tests for SaveProfileImage feature
- Add error handling checks for photo and home
- Add 3 new tests and modify an existing test for SaveProfileImageJob
- Test getting URL from photo object if alt text is provided
- Test using the first URL if multiple homepages are provided
2023-06-17 19:48:27 +01:00
bebbfec510
chore: Refactor configuration files based on Laravel 10 skeleton 2023-06-09 18:31:53 +01:00
7ee5bb00ba
Update Laravel Pint 2023-04-20 17:34:06 +01:00
bdb69df52d
Switch bio to be stored in database 2023-04-11 17:37:42 +01:00
88e1246f8b
Remove Twitter POSSE support 2023-04-08 13:25:36 +01:00
aedbb4b327
Make phpunit provider methods static 2023-04-07 15:39:49 +01:00
a0db33067c
2023 Redesign v1 2023-04-07 15:09:29 +01:00
6d6e719f52
Update Laravel Pint, fix files in codebase 2023-02-16 16:57:06 +00:00
447268b417
Fix original test 2023-02-04 10:41:08 +00:00
f38235561f
Add tests for screenshots 2023-02-04 10:22:00 +00:00
c410e344a0
Begin work on unit tests 2023-01-20 16:02:04 +00:00
45c71bbb47
Setup CloudConvert to take webpage screenshots 2023-01-02 09:39:23 +00:00
a8b3dffddb
Update Laravel Sail 2022-12-23 10:30:42 +00:00
6c43363c78
Make some tweaks around dealing with replies 2022-12-03 20:12:39 +00:00
47e847d100
Fix tests 2022-12-02 18:37:50 +00:00
cfca6a1de5
Refactor models to use new attribute cast 2022-11-26 10:55:58 +00:00
9fcd16ec16
Handle finding webmention targets better
If a site does not support webmentions, my code should not error
2022-11-09 19:32:22 +00:00
6f6abae258
When posting to Mastodon send the original markdown 2022-11-06 10:16:18 +00:00
72cb4fd7eb
Allow notes to be syndicated to Mastodon 2022-11-04 15:23:31 +00:00
e36f15d391
Fix files with Laravel Pint 2022-07-09 10:08:26 +01:00
48d1c9a00b Improve tests 2022-05-14 17:48:53 +01:00
738be80983 Fix a failing test due to changing year 2022-01-01 09:48:37 +00:00
e4dbbe2a58 Make sure aaron’s profile image exists for generating h-card 2021-08-31 13:08:19 +01:00
9f66d342d8 Switch all test to use RefreshDatabase trait 2021-08-31 12:48:43 +01:00
1abca77bdc Finish re-working tests to run on test database 2021-08-31 12:28:00 +01:00
0391cf80de Redo Notes a little, improve tests 2021-04-29 20:02:20 +01:00
d5bbed1eac Rename the tests to pass phpcs checks 2021-03-17 18:38:18 +00:00
ed54446f87 Follow laravel upgrade guide 2020-10-19 19:41:50 +01:00
3c3ad3e29d Remove the postgis stuff 2020-10-16 20:45:07 +01:00
9e3cc19098 Update dependencies, and fix some tests 2020-10-10 19:44:17 +01:00
0a4b803209 Use commonmark’s built in autolink extension 2020-06-19 21:39:02 +01:00
f52295fb21 Stop using deprecated assertFileNotExists test method 2020-06-19 21:01:09 +01:00