Commit Graph

11217 Commits

Author SHA1 Message Date
Gerrit Uitslag 94e5059ec9
Merge pull request #3431 from dregad/js-syntax-error
Add missing `;` causing syntax error in js.php
2021-03-06 14:09:18 +01:00
Damien Regad c8241b3ba7 Add missing `;` causing syntax error in js.php 2021-03-06 11:08:27 +01:00
Andreas Gohr 86491c6cdd
Merge pull request #3368 from splitbrain/fix3363
do not repeat successful security checks. fixes #3363
2021-03-04 12:48:36 +01:00
Andreas Gohr a8b6eaa91e
Merge pull request #3404 from splitbrain/phpunit8
Switch to phpunit 8 (fixes #2693)
2021-03-04 12:47:36 +01:00
Andreas Gohr a417911a65 Run tests on PHP 8.0 now 2021-03-04 12:39:49 +01:00
Andreas Gohr 5fb65df18e
Merge pull request #3412 from splitbrain/fixLastPHPUnit8Tests
fix remaining failing tests for PHP 8
2021-03-04 12:36:53 +01:00
Henry Pan 9306b7bfa0
Merge pull request #3419 from dokuwiki-translate/lang_update_260_1614162959
Translation update (de-informal)
2021-02-25 09:01:53 -05:00
MaWi 3e5559951f translation update 2021-02-24 11:41:11 +01:00
Andreas Gohr d7ecb9e573
Merge pull request #3416 from dokuwiki-translate/lang_update_256_1614057254
Translation update (ru)
2021-02-23 08:41:39 +01:00
Nikita b7fa23a389 translation update 2021-02-23 06:16:12 +01:00
Michael Große 9dcfcc1513
test: run test in separate process in case of error
If there is an error when executing the method under test, then this
test caused the downstream test \remoteapicore_test::test_getBacklinks
to unexpectedly fail. Probably, because the global plugin controller
would not have been reset to its original value.

Running this test in its own process ensures that it won't affect any
other test, even if it messes with the global state and doesn't clean up.
2021-02-20 15:48:01 +01:00
Michael Große e855b7ed6a
test: fix two tests on PHP8
On PHP8 trying to access a non-existing array key leads to a warning,
which we might treat as errors?

This incidentally also fixes another test downstream which broke because
this rendering test changes the global plugin controller, but doesn't
clean it up that if the test errors.

-9000 is used as the position to make it obvious that this number is
meaningless for this test.
2021-02-20 15:47:08 +01:00
Michael Große 5805f15af0
style: fix test code style
This makes all the basic phpcs style fixes and adds visibility to the
class methods.
2021-02-20 15:24:11 +01:00
Andreas Gohr f7acdb5eaf fix method handling for RPC_CALL_ADD
This event seems not to be used by any plugin, which explains why this
bug hasn't surfaced yet. Access is always checked against a full method
name in the form of plugin.<pluginname>.<method> Such a full method was
not passed when using an event as described in the documentation.
2021-02-16 23:21:48 +01:00
Andreas Gohr dfe72b68b7 Merge branch 'master' into phpunit8
* master:
  dwpage: output meta data as JSON
  dwpage: rename gmeta into getmeta
  translation update
  Make it easier to remove h1 around logo
  fix: better max-width for images in tables
  dwpage.php: add an option to get metadata
  rename namespace Media to File
  use SVG icons for media file links
  readded $jump mechanism, removed unused functions
  fix use of $rev parameter
  fix entity definition
  reenable the option to display a relative namespace for media files
  simplified the media_searchlist tests
  make use of the new media file classes
  SVG based file icons
  first go a refactoring the media manager
  lazy load images
2021-02-16 22:55:26 +01:00
Andreas Gohr 01c53a6541 destroy the JPEGMeta object after use
On windows systems a file can not be deleted while processes still have
a handle on them. JPEGMeta seems not to close its file handle correctly.
Usually thats not a problem in short lived processes where everything is
garbage collected at the end, however within a test request the object
may live on a little longer causing problems.
2021-02-16 22:40:49 +01:00
Andreas Gohr c85f645e12 upgrade simplepie to 1.5.6 2021-02-16 21:54:02 +01:00
Andreas Gohr ec1cd64c2c Merge branch 'lazyload'
* lazyload:
  lazy load images
2021-02-16 21:45:25 +01:00
Andreas Gohr 8004d999f1
Merge pull request #3390 from splitbrain/imageInTable
fix: better max-width for images in tables
2021-02-16 21:41:15 +01:00
Andreas Gohr c2bbc4b490 Merge branch 'pr/3386'
* pr/3386:
  dwpage: output meta data as JSON
  dwpage: rename gmeta into getmeta
  dwpage.php: add an option to get metadata
2021-02-16 21:38:33 +01:00
Andreas Gohr 8d670f35f5 dwpage: output meta data as JSON
json shows the same nested data but is easier to process by other tools
2021-02-16 21:37:20 +01:00
Andreas Gohr 3fe0184449 dwpage: rename gmeta into getmeta 2021-02-16 21:12:03 +01:00
Andreas Gohr c4faa1ad31
Merge pull request #3372 from splitbrain/mediaitems
Media Manager Refactoring
2021-02-16 21:02:20 +01:00
Henry Pan e7d0243eb9
Merge pull request #3410 from dokuwiki-translate/lang_update_255_1613213919
Translation update (it)
2021-02-13 14:13:49 -05:00
Dario d51dacaa5e translation update 2021-02-13 12:01:39 +01:00
Andreas Gohr 7566f8035a
Merge pull request #3406 from dregad/phpunit8
PHPUnit 8 fixes
2021-02-08 09:56:06 +01:00
Andreas Gohr d868eed241
Merge pull request #3408 from splitbrain/help-removing-logo-h1
Make it easier to remove h1 around logo
2021-02-08 00:02:47 +01:00
Anika Henke b1ed87eb60 Make it easier to remove h1 around logo
This adds a class to the h1 around the logo
and changes the CSS to reference that class
instead of the h1.
That way it's easier to change the h1 to a div
if someone prefers to have not more than one h1 per page.
2021-02-07 22:50:57 +00:00
Damien Regad 66b64c2aa3 Address Scrutinizer inspection failure
The variable ``$port`` seems only to be defined at a later point.
As such the call to ``isset()`` seems to always evaluate to ``false``.
2021-02-07 00:23:03 +01:00
Damien Regad 012c7cdc1e Fix Constant DOKU_MEDIADETAIL already defined
This error only occurs when PHPUnit runs both the `testScripts` and the
`test_Validity` suites [1], because all tests are running in the same
PHP process.

Adding an `if(!defined` check to avoid the problem.

[1]: ./phpunit.phar --filter 'testScripts|test_Validity'
2021-02-06 01:41:36 +01:00
Damien Regad 6d3d9dba29 Improve remote_test::test_notExistingCall()
There are actually 2 distinct test cases of invalid methods:

1. Not following the definition in Api class's PHPDoc block
   - core methods begin by a 'dokuwiki' or 'wiki' followed by a . and
     the method name itself.
   - plugin methods are formed like 'plugin.<plugin name>.<method name>'
2. Method "type" does not begin with 'dokuwiki', 'wiki' or 'plugin'

A new check was added so both are now covered.

Test was modified to make use of PHPUnit expectException() method,
instead of relying on a try/catch block.
2021-02-06 01:35:34 +01:00
Damien Regad 868550d4c0 Fix incorrect assertion in input_test::test_set()
$INPUT is set to 'test2', but the $_POST checks for 'test'.
2021-02-06 01:25:50 +01:00
Damien Regad 63f13cad5e Fixed typos 2021-02-06 01:21:34 +01:00
Damien Regad 056bf31f71 Fix various errors in PHPUnit tests on PHP 8 2021-02-06 01:19:58 +01:00
Damien Regad 049a05cf60 .gitignore: exclude PHPUnit tests related files
The following files should not be checked in:
- phpunit.phar: per documentation [1], it is PHP version-specific
- PHPUnit's cache file
- data files generated during tests execution

[1]: https://www.dokuwiki.org/devel:unittesting
2021-02-06 01:10:37 +01:00
Damien Regad fa3a5b869c Reorganize .gitignore
- Add comment to regroup editor/IDE and temp files
- Move config-related excludes together with other DokuWiki ones
2021-02-06 01:03:53 +01:00
Andreas Gohr a5bc54e333 fix version comparison in phpunit downloader 2021-02-04 23:14:57 +01:00
Andreas Gohr 57538c4b14 fix deprecated phpunit assertions 2021-02-04 23:09:21 +01:00
Andreas Gohr f1d70d1276 remove old DokuCLI class
This has been deprecated in 2017. Removing it instead of fixing tests
and PHP8 compatibility
2021-02-04 22:02:10 +01:00
Andreas Gohr 1eadd9e86a fix global access on detail.php and avoid null loading
Another problem surfaced in the tests
2021-02-04 21:51:22 +01:00
Andreas Gohr 5afd9580ed fix undefined array warning in fulltext indexer
This was surfaced on PHP8 and might actually have been a bug before.
2021-02-04 21:50:34 +01:00
Andreas Gohr 3366d07123 fix PHP8 errors in tests
These were problems within the tests itself. There are many more
problems in the actual code.
2021-02-04 21:11:45 +01:00
Andreas Gohr 1c33cec372 add needed type hints for phpunit8
This will break a lot of plugin tests, but can't be avoided
2021-02-04 20:58:17 +01:00
Andreas Gohr bd9dab32db remove unnamespaced php unit wrapper 2021-02-04 20:58:17 +01:00
Andreas Gohr 34c8d5baca default to phpunit8 now 2021-02-04 20:58:17 +01:00
Andreas Gohr 8eb6b2dc77
Merge pull request #3395 from dregad/php8-warnings
Fix a series of warnings on PHP 8
2021-02-04 20:05:22 +01:00
Henry Pan 3e60bacc90
Merge pull request #3400 from dokuwiki-translate/lang_update_251_1612291542
Translation update (cs)
2021-02-02 17:51:35 -05:00
Petr Kajzar 5d8c2b091b translation update 2021-02-02 19:51:37 +01:00
Anika Henke a9e0708e35
Merge pull request #3397 from splitbrain/fixes-for-html-export
Fixes for HTML export mode
2021-01-31 20:09:54 +00:00
Anika Henke e12277d1ff Fix TOC being cut off in `export_xhtml` mode 2021-01-29 12:27:01 +00:00