Commit Graph

92 Commits

Author SHA1 Message Date
William Desportes
8a9a376fd9
Fix #17009 - Implement Permissions-Policy security header
Signed-off-by: William Desportes <williamdes@wdes.fr>
2023-07-14 19:49:51 +02:00
Maurício Meneghini Fauth
3f2c53ef1d
Replace PHPUnit annotations with attributes
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-06-07 11:44:01 -03:00
Maurício Meneghini Fauth
b11d81b40c
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-05-31 00:50:54 -03:00
Maurício Meneghini Fauth
3f587ccce4
Improve unit test for ResponseRenderer::setAjax()
Also tests the setAjax() method of Header, Footer and Console classes.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-05-31 00:26:48 -03:00
Maurício Meneghini Fauth
6a2c12bdc8
Add missing traversable type hints
Replace array type hint with mixed[] type hint, since it means the same.
This way it's possible to require traversable type hint for new code.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-04-02 01:32:12 -03:00
Kamil Tekiela
276577ca2a
Remove $GLOBALS['PMA_PHP_SELF'] (#18149)
* Remove $GLOBALS['PMA_PHP_SELF']

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove $GLOBALS['PMA_PHP_SELF'] from tests

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Moved cleanupPathInfo to Routing

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove parse_url from getRootPath

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Update baselines

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove invalid tests

Surely, we never expect PATH to be backslash delimited. The code is not designed to handle this and the tests for this don't make much sense.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Fix trailing slash in path

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

---------

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-27 17:56:27 -03:00
Maurício Meneghini Fauth
f9c8035768
Add native parameter types to test classes
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-27 01:54:03 -03:00
Maurício Meneghini Fauth
556594b4cd
Fix coding standard spacing issues
- Fixes one line doc comments
- Fixes parent call spacing
- Fixes constant spacing

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-24 21:06:17 -03:00
Maurício Meneghini Fauth
77957a69a5
Add trailing comma for multi-line functions
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-24 20:48:46 -03:00
Maurício Meneghini Fauth
cb67fa306d
Remove Reflection's setAccessible() method
This method is no-op since PHP 8.1.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-21 20:35:45 -03:00
Maurício Meneghini Fauth
4ff3724c3f
Use union with null instead of short nullable type
Since union type are now possible, using union with null makes more
clear that it is a union type.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-20 21:48:19 -03:00
Maurício Meneghini Fauth
0ab9e4ac77
Change PHPUnit data providers to use static methods
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-14 12:42:16 -03:00
Maurício Meneghini Fauth
ab96edf359
Extract Navigation object dependency from CommonParams
This removes a circular dependency.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-12-14 20:08:58 -03:00
Maurício Meneghini Fauth
9546a45e98
Revert "Move menuResizer related functions to menu-resizer.js"
That commit broke the onload and teardown calls.
Reverting fixes the tests.

This reverts commit 5e6541e08a.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-12-04 15:15:44 -03:00
Maurício Meneghini Fauth
5e6541e08a
Move menuResizer related functions to menu-resizer.js
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-12-01 23:17:33 -03:00
Maurício Meneghini Fauth
83e8ed59cc
Remove Config object from the Window global object
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-30 22:00:29 -03:00
Maurício Meneghini Fauth
49865fe647
Remove Indexes object from the Window global object
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-29 14:39:16 -03:00
Maurício Meneghini Fauth
b7a710e83f
Remove common.js from Header::addDefaultScripts()
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-29 14:17:04 -03:00
Maurício Meneghini Fauth
caf19897ac
Remove crossFramingProtection from the Window global
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-28 23:43:35 -03:00
Maurício Meneghini Fauth
332e27ad39
Remove KeyHandlerEvents from the Window global object
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-28 23:11:13 -03:00
Maurício Meneghini Fauth
479f10289f
Remove the Navigation object from the Window global
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-28 22:29:13 -03:00
Maurício Meneghini Fauth
2e001c186a
Remove PageSettings from the window object
Imports PageSettings in the main.js file instead of relying on the
global window object.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-24 22:00:56 -03:00
Maurício Meneghini Fauth
b2971d618f
Import the AJAX object where possible
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-24 15:21:18 -03:00
Maurício Meneghini Fauth
3ce84326f2
Import the Functions object where possible
Instead of using from the Window global object.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-24 14:43:25 -03:00
Maurício Meneghini Fauth
6f54621b41
Create a shared.js file for common JS dependencies
Instead of using the Webpack's dependOn setting, uses the splitChunks
setting to automatically generate the shared.js file.

As the contents of these shared dependencies are being moved to the
shared.js file, the generated file for each dependency is now empty.

Is probably safe to not generate them, but some adjustments are needed
for that first. For example, the AJAX's onload and teardown functions
expects that some of these files exists.

For now, only dependencies that are loaded for all pages should be added
in this shared.js file.

This will facilitate the refactoring of the JS files, but the trade off,
at least for now, is that will be a single large file instead of a few
medium ones.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-24 14:43:24 -03:00
Maurício Meneghini Fauth
80b5358bc0
Add an unit test for Header::addDefaultScripts()
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-24 14:34:10 -03:00
Maurício Meneghini Fauth
346923e20a
Set dbi only when the test needs it
Related to https://github.com/phpmyadmin/phpmyadmin/pull/17637

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-07-14 02:21:45 -03:00
Maurício Meneghini Fauth
7403cffab4
Assign CommonParams and CommonActions to the window object
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-06-22 15:04:03 -03:00
Maurício Meneghini Fauth
1438cb211e
Replace global keyword with $GLOBALS
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-03-07 17:31:11 -03:00
Maurício Meneghini Fauth
78104be8fb
Remove print view mode
- Removes the print.css file.
- Data ditionary now opens like other pages. Printing the page works
  like before.

Fixes #17169
Closes #17170

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-10-31 13:22:07 -03:00
Maurício Meneghini Fauth
355f6d9d20
Remove PhpMyAdmin\Config::enableBc method
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-07-09 13:59:04 -03:00
Maurício Meneghini Fauth
e8c28d1883
Remove some globals from Config::enableBc method
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-07-08 19:49:26 -03:00
Maurício Meneghini Fauth
c985faf9a1
Build response headers before sending them out
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-07-01 16:08:03 -03:00
Maurício Meneghini Fauth
f3b79d83c0
Add PHPUnit's Covers annotation on test classes
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-06-04 23:39:26 -03:00
Maurício Meneghini Fauth
33d711215d
Remove the PMA_VERSION constant
Uses the PhpMyAdmin\Version::VERSION constant instead.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-03-08 22:22:55 -03:00
Maurício Meneghini Fauth
7e33d227f5
Rename the PMA_Config global variable to config
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-03-08 15:03:12 -03:00
Maurício Meneghini Fauth
d83abf63e7
Use PSR-12 for control structures spacing
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-03-05 15:27:03 -03:00
Maurício Meneghini Fauth
0b8edc5bde
Use PSR-12 for namespace use statements
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-03-05 14:18:35 -03:00
William Desportes
2df5ce0044
Ref #16429 - Fix undefined array keys
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-11-19 23:40:55 +01:00
William Desportes
6961d17659
Add a test for Header::testGetCspHeaders
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-11-08 23:13:35 +01:00
William Desportes
50e900a1bf
Remove all @test annotations
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-11-08 23:01:26 +01:00
Maurício Meneghini Fauth
db3da81056 Remove some useless comments
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-10-13 19:56:56 -03:00
Maurício Meneghini Fauth
ceac762e09 Remove pmaThemePath and pmaThemeImage PHP globals
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-09-02 10:57:57 -03:00
William Desportes
cce4bc993c
Fixes #16278 - Fix tests
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-08-06 15:48:08 +02:00
Maurício Meneghini Fauth
47f0960dce Add return type declaration to test methods
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-07-07 11:31:33 -03:00
Maurício Meneghini Fauth
3baad2eb1c Fix some coding standard issues
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-05-25 22:42:37 -03:00
Maurício Meneghini Fauth
9269d75fb4 Fix some coding standard issues
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-05-25 20:22:18 -03:00
William Desportes
49a6d6e8d0
Use AbstractTestCase instead of PmaTestCase for all tests not needing mockResponse
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-05-22 01:45:50 +02:00
William Desportes
ae575ffb14
Fix running tests in --process-isolation
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-05-21 16:21:20 +02:00
William Desportes
0964470643
Use parent::setGlobalConfig();
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-05-21 13:19:23 +02:00