Commit Graph

1077 Commits

Author SHA1 Message Date
Andreas Gohr ed46af861c disable RemoveUnusedConstructorParamRector
At least until rectorphp/rector#8580 is fixed
2024-03-27 13:21:16 +01:00
Andreas Gohr dfaf0747ed Support b and x variants for bcrypt hashes
Prompted by https://forum.dokuwiki.org/d/22108-authpdo-with-postgres-and-lemmy/3

As stated on https://stackoverflow.com/a/36225192

> there is no difference between 2, 2a, 2x, 2y, and 2b. If you wrote your
> implementation correctly, they all output the same result.
2024-03-13 15:44:23 +01:00
FailedCode 2a113f4663 Tests: The at() matcher has been deprecated
fixes #3811

Replaces at() with withConsecutive() in these tests:

- TestOfLexer::testSinglePattern
- TestOfLexer::testMultiplePattern
- TestOfLexerModes::testIsolatedPattern
- TestOfLexerModes::testModeChange
- TestOfLexerModes::testNesting
- TestOfLexerModes::testSingular
- TestOfLexerModes::testUnwindTooFar
- TestOfLexerHandlers::testModeMapping
- TestOfLexerByteIndices::testIndex
- TestOfLexerByteIndices::testIndexLookaheadEqual
- TestOfLexerByteIndices::testIndexLookaheadNotEqual
- TestOfLexerByteIndices::testIndexLookbehindEqual
- TestOfLexerByteIndices::testIndexLookbehindNotEqual
2024-03-09 17:47:38 +01:00
Andreas Gohr e860a4fbf1 fix is_ssl() check
There was a global statement missing? This seems to have to been
broken in one of the recent merges.

Tests have been cleaned up but not changes in logic.
2024-01-26 14:59:53 +01:00
Andreas Gohr 754eefa383
Merge pull request #4156 from dokuwiki/feedrefactor
Feed creation refactoring
2024-01-26 14:43:14 +01:00
Andreas Gohr 482bf1d581 fix FeedPageProcessorTest on Github
It seems that the dataProvider generator runs before the rest of the
test suite, resulting in a wrong modification timestamp being read.

It's unclear why this happens on Github only.
2024-01-26 12:41:38 +01:00
Andreas Gohr 2d1b030690 check feed validity at w3c validator 2024-01-26 11:33:48 +01:00
Andreas Gohr 6e2ee56d21
Merge pull request #4104 from m-martin-78/xfhsupport
Add support for X-Forwarded-Host proxy header
2024-01-26 09:52:29 +01:00
Andreas Gohr 33b3315418 Update rector and the used class namespace
Seems like the class alias for Rector\Core is removed in 19.2 This
should fix the rector runs on github.
2024-01-25 10:45:55 +01:00
Andreas Gohr fe9d054b30 Feed creation refactoring
This breaks up the humongous functions from feed.php into multiple
classes. To keep compatibility with existing Plugin events, the basic
principle of how the feed is assembled has not been changed:

* depending on the given mode and other options lose arrays of items are
  gathered
* these items are then converted (again based on the various options)
  into proper FeedItems
* the FeedItems are then added to the Feed

The conversion from loosely typed item data to something more structured
is now done by the FeedItemProcessor classes. Some very basic tests have
been added. It does not cover erverything but covers more than before
(which was nothing).

Manual testing before merging this is highly recommended. I am not
confident that I ported over everything correctly.

No new features have been added, but especially media support could and
should be improved in the future.
2024-01-17 19:32:10 +01:00
Andreas Gohr ac56bec8fe fall back to empty (root) dir for base dir detection
When a basedir could not be detected, the default previously was '.'
resulting in a valid but weird URL (http://example.com/./doku.php). We
now default to an empty dir, resulting in a more sensible URL of
http://example.com/doku.php

This should not matter in real web server setups but will be in effect
while testing.
2024-01-17 19:04:39 +01:00
Andreas Gohr e33e723e8b
Merge pull request #4134 from dokuwiki/betterapi
Complete API Refactoring
2024-01-12 19:24:11 +01:00
Andreas Gohr 06216d5e8b add (failing) compability test for AES encryption 2024-01-12 19:05:45 +01:00
Andreas Gohr 462a56017f tune parallel tasks in rector
The default options for running paralell rector tasks changed in 0.19
resulting in failures on github runners.

See also https://github.com/rectorphp/rector/issues/8396
2024-01-10 10:50:00 +01:00
Andreas Gohr 05fd0e839b update rector 2024-01-10 09:07:44 +01:00
Andreas Gohr 5e47e6df3b API added simple JSONRPC tests 2024-01-07 13:41:19 +01:00
Andreas Gohr 12b9975326 fix XMLRPC server tests
We test against the MockAPICore now since the tests are meant to ensure
the general functionality of accepting XML and correctly calling
APICalls works, not that the API returns the right things (this is
tested in the ApiCore tests).
Since we no longer use dates but always integers, we no longer need to
handle that.
2024-01-07 13:41:19 +01:00
Andreas Gohr 801ecc14bc Fix Api Tests 2024-01-07 13:41:19 +01:00
Andreas Gohr 6e1ddc6494 fix ApiCoreAclCheckTest
This is mostly syntactic fix. I did not check how sensible these tests
are and did not switch from positional to named arguments
2024-01-07 13:41:19 +01:00
Andreas Gohr cad27e80a9 API: move user related tests to usermanager plugin 2024-01-07 13:41:19 +01:00
Andreas Gohr d1f06eb4f0 API: ApiCore tests fixed and extended 2024-01-07 13:41:19 +01:00
Andreas Gohr 7de5ac5588 Another argument parsing fix for ApiCall
When using named parameters, you can expect to be able to leave out any
optional parameter and have it take it's default, even when you specify
another "later" parameter. Luckily we already know all the defaults from
reflection anyway.
2024-01-07 13:41:19 +01:00
Andreas Gohr b209907b0d Clean up APICall tests
No need to retest all the docblock parsing when that is tested elsewhere
already.
2024-01-07 13:41:19 +01:00
Andreas Gohr 04acbb6fa7 API: fix named parameter handling in APICall
We cannot set missing paramerers to null. We need to make sure they are
not set at all.
2024-01-07 13:41:19 +01:00
Andreas Gohr 8ddd9b6918 OpenAPI Generator. Better DocBlock parsing [WIP]
This introduces a new DocBlock parser to properly generate API
specifications. It also introduces the concept of Response classes to
better specify the response format.

This is still very much in progress.
2024-01-07 13:41:19 +01:00
Andreas Gohr d0749387d4 fix ApiCall test 2024-01-07 13:41:19 +01:00
Andreas Gohr b05603ab33 fix type parsing for more complex types 2024-01-07 13:41:19 +01:00
Andreas Gohr 5b379b5045 fix ApiCall test on PHP7.4
Since PHP7.4 has no primitive type hints and PHP native methods have no
accessible docblocks, we can not use a native function for testing
(types always come back as string).
2024-01-07 13:41:19 +01:00
Andreas Gohr d95846aa88 final set of API tests refactored 2024-01-07 13:41:19 +01:00
Andreas Gohr 285c73a173 More adjusted API tests 2024-01-07 13:41:19 +01:00
Andreas Gohr 535851891f another set of api tests 2024-01-07 13:41:19 +01:00
Andreas Gohr 1468a1289a Fix first set of API tests 2024-01-07 13:41:19 +01:00
Andreas Gohr 42e66c7a3a First go at refactoring the API mechanisms
This introduces an ApiCall class that wraps around the actual method
that produces the result. This replaces various loose array structures
that provided the meta information before.

The ApiCall streamlines the aggregation of meta information between core
and plugin methods. Now all data is produced by Reflection based
introspection. Certain aspects can be overridden if needed. See
ApiCore::getRemoteInfo() for examples

This change removes the _getMethods() method from remote plugins and
introduces a getMethods() method. The two are NOT compatible as the
latter now returns a list of ApiCalls. However when looking at the
existing plugins, it seems that _getMethods() was nearly 100% obsolete
with the Reflection based default implementation. So most plugins will
not be affected at all. Some might now export one or two more methods
than before because of poor visibility settings (eg. not declaring
private/protected methods as such).

This change removes the RPC_CALL_ADD hook. Only a single plugin ever
implemented it. I'm not sure what this hook was supposed to do anyway.
Being able to declare arbitrarily named API endpoints seems wrong to me
anyway.

The new ApiCall now also supports passing named instead of positional
parameters. This will open up a new opportunity to get a proper openapi
spec running.

Next step is fixing the tests.
2024-01-07 13:41:19 +01:00
Andreas Gohr cd89aff0a8 fix IP tests
to accommodate the change introduced in e6d2a179db
2024-01-07 13:40:37 +01:00
Andreas Gohr e6d2a179db use private IP addresses in tests 2024-01-06 17:28:47 +01:00
Anna Dabrowska 9b944650bd Upgrade rector to 0.18.12
Two classes in DokuWiki's skip rules were removed from rector in 0.18.12
2023-12-07 12:55:15 +01:00
m-martin-78 c46f56cc7c
Update init_checkssl.test.php 2023-11-30 13:58:02 +01:00
Andreas Gohr 748000183b
Merge pull request #2432 from dokuwiki/tokenauth
Implement Token Authentication
2023-11-28 14:21:26 +01:00
m-martin-78 3e383dbb92
update tests to match new is_ssl behaviour 2023-11-28 10:33:17 +01:00
Andreas Gohr 108f17cf39 updated devel dependencies 2023-11-13 16:53:47 +01:00
Andreas Gohr 9bfc127bb8
Merge pull request #4065 from dokuwiki/composerdev
implement composer dev dependencies as suggested in #4058
2023-11-13 16:46:19 +01:00
Andreas Gohr 1fc5061d2b skip CompleteMissingIfElseBracketRector
We like our one-line guardians.

See discussion in
https://github.com/dokuwiki/dokuwiki/pull/4097#issuecomment-1788608355
https://github.com/dokuwiki/dokuwiki/pull/4097#issuecomment-1789826392
2023-11-02 09:08:14 +01:00
Andreas Gohr 403d6a9f4c added tests for auth token handling 2023-10-12 15:21:21 +02:00
Andreas Gohr 2f624be6e5
Merge pull request #4074 from dokuwiki/issue4072
strip any trailing dots when resolving IDs
2023-10-12 14:23:23 +02:00
Andreas Gohr d87b66457e removed obsolete tests
These tests have been moved to the File namespace.
2023-09-30 20:46:00 +02:00
Andreas Gohr 42411fe918 strip any trailing dots when resolving IDs
fixes #4072
2023-09-30 20:35:21 +02:00
Gerrit Uitslag 72d8810b2b Fix unit test, little refactor 2023-09-25 01:23:25 +02:00
Gerrit Uitslag 719518410a deprecate parseChangelogLine()
It was already replace in code, replaced in unit test as well.
2023-09-25 01:22:54 +02:00
Andreas Gohr 9420a794ec updated the _test/README 2023-09-18 19:33:20 +02:00
Andreas Gohr 2924990419 remove obsolete fetchphpunit script
It's now installed via composer
2023-09-18 19:19:20 +02:00