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
Harald Eilertsen
f3d8838256
Fix deprecation notice in MessageWidgetTest
...
Creating dynamic properties in an object is deprecated in PHP 8.2.
Reference: https://www.php.net/manual/en/migration82.deprecated.php
2025-10-29 10:33:06 +01:00
Mario Vavti
a570ef4691
add test for ASCache::isCacheable()
2025-10-26 19:19:36 +01:00
Harald Eilertsen
7a7ff97e63
Unbreak test failure in Helpindex test
...
We need to mock the call to `is_readable`, since the file requested in
the test does not actually exist in the file system.
2025-10-20 10:54:12 +02:00
Mario Vavti
63e41c233f
the correct mime type for .jpg images is image/jpeg
2025-10-15 07:55:08 +02:00
Harald Eilertsen
3c89c7d4f4
Add ImageQuality class to hold quality values
2025-10-13 18:43:13 +02:00
Harald Eilertsen
87c62db41e
tests: Dataproviders should be static
2025-10-05 20:27:08 +02:00
Mario Vavti
ffce0a705b
added test for Activity::pasteQuote()
2025-10-05 15:43:42 +02:00
Harald Eilertsen
c064cfde91
Look for unit tests for extensions as well as core
2025-09-02 08:38:50 +02:00
Harald Eilertsen
2826d030f4
Remove obsolete phpunit configurations
...
These are not in use, probably outdated, and just confusing.
2025-09-02 08:38:50 +02:00
Mario
9f99e401bc
Merge branch 'fix-markdown-mentions' into 'dev'
...
Prevent mentions from mangling by markdown parser
See merge request hubzilla/core!2211
2025-07-10 11:43:10 +00:00
Mario
08b7eb52c7
remove unneeded code from test
2025-07-09 08:00:27 +00:00
Mario Vavti
525594d529
update to phpseclib3 which is now a requirement for the http signer library
2025-07-08 11:35:56 +02:00
Mario Vavti
2054359f6c
testing and fixes
2025-07-06 22:41:02 +02:00
Mario
9a3735cd37
tests for Activity::get_actor_protocols()
2025-07-06 18:32:08 +00:00
Harald Eilertsen
cb491c53f7
Prevent mentions from mangling by markdown parser
...
Mentioning people whose handles include valid markdown would not survive
markdown to bbcode conversion wihout being mangled. An example that
brought this to my attention was a handle similar to this:
_someuser_@testsite.example
The underscores would be interpreted as emphasis in markdown, and
converted to:
[i]someuser[/i]@testsite.example
This patch should fix this, and hopefully any other issue with mentions
being mangled.
2025-06-28 13:35:05 +02:00
Mario
0e31d61868
Merge branch 'some-account-cleanup' into 'dev'
...
A bit of cleanup for account functions
See merge request hubzilla/core!2210
2025-06-24 07:53:43 +00:00
Harald Eilertsen
66e02c5e3a
A bit of cleanup for account functions
2025-06-24 07:53:42 +00:00
Mario
7320149fd8
only show the pin if we display the label and fix the test
2025-06-19 08:26:31 +00:00
Mario Vavti
18016ab36a
remove some redundant spaces in bbcode to html conversion and fix tests
2025-06-18 11:55:47 +02:00
Mario
d788233bd7
handle naked geo URIs and add tests
2025-06-18 09:18:11 +00:00
Harald Eilertsen
0c41265613
Throw if channel keys missing in JcsEddsa2022::sign
2025-06-05 15:45:46 +00:00
Mario Vavti
6a2748724c
guess_image_type(): fix minor issue and add some tests (guessing from getimagesize() and Imagick is not tested)
2025-05-20 22:10:52 +02:00
Harald Eilertsen
1eb3357584
Add a couple of tests for Widget\Messages
...
Just a couple of basic tests around listing file tags, to make sure the
code runs without any warnings.
2025-05-19 10:24:13 +02:00
Harald Eilertsen
456a741809
Replace english docs with pepecyb's docs
2025-05-18 18:42:45 +00:00
Harald Eilertsen
7cb8a56b6a
Don't access APP:$observer directly in core
...
Introduce helper functions to access the various fields of the xchan
stored in `App::$observer'. This removes direct access to the attribute
from core, with the aim of allowing further refactoring later.
We can not yet make the `App::$observer` attribute private, though, as
it is also accessed directly by some addons.
2025-05-09 15:15:35 +02:00