304 Commits

Author SHA1 Message Date
Harald Eilertsen
bb303ebc4c Some cleanup in Hook API's and tests
Clean up duplicated code in include/plugin.php and Zotlabs\Extend\Hook,
making the former just wrappers calling the latter. Also removed the
unnecessary serialization of arrays in Hook::insert, and cleaned up and
expaned the tests a bit.
2026-06-12 21:19:59 +02:00
Harald Eilertsen
bf57bd34f9 Add AVIF support for PhotoImagick
It seems AVIF support was added to the GD photo driver, but not
ImageMagick. This patch adds it to ImageMagick as well, if supported by
the underlying library.

I also added pecl imagick extension to CI so that we can test it.
2026-05-28 19:42:01 +02:00
Mario
1553bc708f Merge branch 'tests-for-LDSignatures' into 'dev'
Tests for LDSignatures::verify

See merge request hubzilla/core!2281
2026-05-05 07:15:05 +00:00
Harald Eilertsen
965e643c71 tests: Tests for opengraph meta tags
Also fixed a minor whitespace issue in include/opengraph.php, and added
braces so the logic is clearer.
2026-05-02 23:19:18 +02:00
Harald Eilertsen
8d283e0be5 tests: Use minimal channel for LDSignature tests
Move the channel keypair and other fields needed by the
LDSignature::verify function to the test case itself. This makes the
test case independent on any potential future changes to the fixtures.
2026-05-02 11:54:42 +02:00
Harald Eilertsen
0cd682d85e tests: Add basic test for LDSignature::verify 2026-05-02 11:41:54 +02:00
Harald Eilertsen
9aff1d4024 tests: Fix invalid keypair for channel fixture 2026-05-02 11:38:37 +02:00
Mario
b0a2bf47c8 fix wording 2026-04-29 14:27:58 +00:00
Mario
3d29c498e9 move unparse_url() to Url class, also move tests 2026-04-29 14:16:15 +00:00
Mario
fdeab5b2d1 add same host test and get rid of the www subdomain 2026-04-28 13:10:25 +02:00
Mario
fa7c8e93f1 merge dev 2026-04-28 12:54:40 +02:00
Mario
fd6b252b36 refactor zid() and add tests 2026-04-28 12:50:38 +02:00
Harald Eilertsen
de9e2c27ea Drop cleaning empty f query param from links 2026-04-27 12:40:45 +02:00
Harald Eilertsen
a574c79f9e Clean up detection of naked URL's in posts
Fix detecting naked IPv6 URL's in posts, and clean up a bit how we deal
with zid parameters. Also drops the `nakedoembed` function which no
longer had anything to do with oembed handling. This also means we no
longer need to scan the body twice for the same regex.
2026-04-26 16:22:18 +02:00
Harald Eilertsen
7fc1d58b10 Remove bookmark prefix from naked URLs
See discussion here:
https://hubzilla.org/channel/adminsforum?mid=00a360a1-6281-52aa-b4de-65493b8899f5
2026-04-22 13:22:32 +02:00
Mario Vavti
231384a58f messageFilter: make sure we do not choke if we expect a string but an array is given 2026-03-27 22:42:59 +01:00
Mario
3dd9559d9f fix spdx info and remove superfluous use statements 2026-03-17 06:24:03 +00:00
Mario Vavti
51ac502d97 refactor drop_query_params() to deal with array params and add test 2026-03-16 10:32:59 +01:00
Harald Eilertsen
33c95c810a tests: Make loadFixtures public
Some tests will need to load their own database fixtures. By making this
API public we make it easy for them to do so.

This change is needed by the tests for the Superblock addon.

Project......: Improve Superblock Addon
Sponsored-by.: NLnet NGI0 Commons Fund
2026-03-11 11:40:31 +01:00
Mario Vavti
86d58065b3 deal with leading or missing @ and add more tests 2026-03-04 10:25:32 +01:00
Mario
1f265cc6d5 fix tests (hopefully) 2026-03-04 08:44:09 +00:00
Mario
4474fdd4f9 introduce parse_webbie() with basic tests 2026-03-04 08:34:45 +00:00
Harald Eilertsen
ccd6d1a38c Move db stats to separate classes for each db type
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
2026-02-26 16:19:17 +01:00
Mario
5a6a7386a8 Merge branch 'more-xchan-tests' into 'dev'
tests: A few more xchan tests

See merge request hubzilla/core!2261
2026-01-29 10:38:35 +00:00
Harald Eilertsen
9fb5cd12be tests: A few more xchan tests 2026-01-27 09:43:44 +01:00
Harald Eilertsen
d85c737db7 tests: Add ajax request helper to module test case
This is a bit crude, but serves the purpose for now. To emulate an AJAX
request we set the `Content-Type` header to `application/json`, and json
encode the params in the body of the request.
2026-01-26 23:03:07 +01:00
Mario
38f040f9b5 Merge branch 'minor-test-improvements' into 'dev'
tests: Make addonname/tests base addon tests dir

See merge request hubzilla/core!2250
2026-01-15 10:53:57 +00:00
Harald Eilertsen
cedc6c4230 Escape args in xchan_fetch 2026-01-04 14:55:03 +01:00
Harald Eilertsen
c051c4d0aa tests: Make addonname/tests base addon tests dir
This makes it easier to treat anything under tests/ as namespaced for
PSR-4 autoloading.
2025-12-21 11:05:37 +01:00
Harald Eilertsen
e289078f82 tests: Fix content-type/length in Module\TestCase 2025-12-21 11:04:25 +01:00
Mario
87f79381d9 MessageFilter: move decoding to the caller and also check the summary field 2025-12-19 08:24:22 +00:00
Mario
e5d0ef79ef GD imagedestroy() is deprected and noop since PHP version 8.0 2025-12-16 11:16:28 +00:00
Mario Vavti
2eb51233f6 fix hashtag and mentions count after fixing encoding and add tests 2025-12-12 19:15:28 +01:00
Mario Vavti
5432819788 add test for encoded filter entry 2025-12-12 18:51:53 +01:00
Mario Vavti
48dbba2f4d implement new version of MessageFilter derived from forte and add some more tests 2025-12-12 12:42:01 +01:00
Harald Eilertsen
4eb7e29bab Improve test isolation
To ensure tests don't step on each others toes, make sure we back up
the static properties of the global App class before running tests that
modify any of these properties.
2025-12-02 19:58:41 +01:00
Mario
57c22f4d0f fix test 2025-11-21 10:45:45 +00:00
Mario
f25ac63f18 Merge branch 'fix-warnings-in-owatest' into 'dev'
Set content type/length for module test requests

See merge request hubzilla/core!2244
2025-11-20 21:20:27 +00:00
Harald Eilertsen
ddf7fad82f Set content type/length for module test requests
Just use default values of 'text/html' and 0 for now. Should probably be
set to more realistic values at some point, but for now it seems to
work.

This fixes warnings in the OwaTest.
2025-11-20 21:48:53 +01:00
Harald Eilertsen
6f8b7f177d Replace use of create_identity in MagicTest
Use db fixtures instead. Make the test much snappier.
2025-11-19 22:01:42 +01:00
Harald Eilertsen
7a2a621309 Add hubloc test db fixture
Added entries in the hubloc table to correspond to the channel entries
in channel.yml. These would normally be created by `create_identity`, so
some code expects them to be there.
2025-11-19 21:59:45 +01:00
Harald Eilertsen
fe25bab3a7 Stub crypto calls from CreateIdentityTest
This speeds up the test runs significantly.
2025-11-19 16:58:08 +01:00
Harald Eilertsen
3abd764512 Drop create_identity from Zotfinger test 2025-11-16 22:14:33 +01:00
Harald Eilertsen
dc255a4ecf Begin tests for Profiles module 2025-11-15 11:26:23 +01:00
Harald Eilertsen
39f4a56348 Begin tests for Zotfinger module 2025-11-15 11:26:11 +01:00
Harald Eilertsen
8e35ef2faa Add test db fixtures for channel table
Add the system user and a test user to the table for use by tests.
2025-11-13 19:51:39 +01:00
Harald Eilertsen
b74a2dff9e Reload test fixtures from db
Reload inserted rows from the DB when loading the test fixtures. This
ensures that we get all default fields and id columns initialized and
validated. Some code under test will require this to work as expected.
2025-11-13 19:51:39 +01:00
Harald Eilertsen
6400bcc81f Set logged in shannel for delete account test
If the logged in account is not set, it triggers a warning.
2025-11-13 19:51:39 +01:00
Harald Eilertsen
4abe0703d7 tests: Use root passwd to set up MySQL test db 2025-11-13 19:51:39 +01:00
Harald Eilertsen
1e92aeb7f9 Improve dba_pdo::insert function 2025-11-13 16:14:05 +00:00