2853 Commits

Author SHA1 Message Date
John Paul E. Balandan, CPA
1ecae2f73a
Merge pull request #5265 from paulbalandan/ordered_class_elements
Enable `ordered_class_elements` rule
2021-11-01 13:05:39 +08:00
kenjis
4671341063
Merge pull request #5258 from paulbalandan/common-single-service
Speed up `CommonSingleServiceTest`
2021-11-01 10:38:17 +09:00
kenjis
dbbdd2d421
Merge pull request #5249 from kenjis/remove-curl-headers-sharing
Fix: remove CURLRequest headers sharing from $_SERVER
2021-11-01 09:38:53 +09:00
John Paul E. Balandan, CPA
6a689bf976
Enable ordered_class_elements rule 2021-10-31 20:36:38 +08:00
kenjis
f53a1da13b
refactor: move Config\App::$CURLRequestShareOptions to Config\CURLRequest::$shareOptions 2021-10-30 09:22:54 +09:00
kenjis
a6c06cc990
refactor: remove unnecessary second param 2021-10-30 08:58:11 +09:00
John Paul E. Balandan, CPA
ec303bf1ca
Replace explicit calls to Services::reset() in tests 2021-10-29 19:35:37 +08:00
John Paul E. Balandan, CPA
d7364cdd1d
Speed up CommonSingleServiceTest 2021-10-29 19:25:03 +08:00
kenjis
9e88ec4a41
test: add tests for sharing options 2021-10-29 19:02:03 +09:00
kenjis
436013e118
test: add tests for $CURLRequestShareOptions = false 2021-10-29 18:42:50 +09:00
kenjis
aed89d9119
fix: add config $CURLRequestShareOptions for the CURLRequest
If $CURLRequestShareOptions is false, reset all config after sending a request.
If true, keep the all config (the same as before).
2021-10-29 17:44:10 +09:00
kenjis
741d4886e6
Merge pull request #5244 from kenjis/fix-test-CreateDatabaseTest
Fix CreateDatabaseTest::testCreateDatabase()
2021-10-29 16:53:00 +09:00
kenjis
c9bac5f99a
fix: reset $unsharedHeaders after sending request
If user setHeader() that is defined in $unsharedHeaders, the header will be removed
before sending request, and there is no way to send the header.

The reason I didn't do the reset after sending is because a test failed.
This time I modify the test, too.
2021-10-29 11:16:39 +09:00
kenjis
0b18ab8447
style: change global_namespace_import to true in php-cs-fixer
https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/2.19/doc/rules/import/global_namespace_import.rst
2021-10-28 17:10:54 +09:00
kenjis
7ae9a8b2e0
Merge pull request #5246 from paulbalandan/helper-loading
Fix wrong helper path resolution
2021-10-28 14:13:59 +09:00
kenjis
e307ef566c
fix: remove populateHeaders() not to share request headers form browser between CURL requests 2021-10-28 13:29:33 +09:00
John Paul E. Balandan, CPA
d263558af1
Update tests/system/CommonHelperTest.php 2021-10-28 12:16:52 +08:00
kenjis
5ca28c0956
Merge pull request #5245 from kenjis/fix-test-TimeTest
Fix TimeTest::testToFormattedDateString()
2021-10-28 12:57:39 +09:00
John Paul E. Balandan, CPA
120a56a718
Update tests/system/CommonHelperTest.php 2021-10-28 10:52:58 +08:00
John Paul E. Balandan, CPA
f758702531
Apply suggestions from code review 2021-10-28 10:51:13 +08:00
kenjis
d7c9ad2ce6
test: fix setUp()
Ensure the database exists.
2021-10-27 13:27:22 +09:00
John Paul E. Balandan, CPA
ee2b89481b
Fix wrong helper path resolution 2021-10-27 11:57:21 +08:00
kenjis
f1a9f3bb19
test: fix setUp()
Drop database for non-SQLite connections.
2021-10-27 11:28:12 +09:00
kenjis
6550690863
Merge pull request #5236 from kenjis/fix-csrf-tests
Add CSRF test
2021-10-27 08:48:24 +09:00
kenjis
0923134ec7
test: fix failed test
2) CodeIgniter\I18n\TimeTest::testToFormattedDateString
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'May 10, 2017'
+'5月 10, 2017'

.../CodeIgniter4/tests/system/I18n/TimeTest.php:643
2021-10-27 08:42:45 +09:00
kenjis
4de18315b9
test: fix failed test
1) CodeIgniter\Commands\CreateDatabaseTest::testCreateDatabase
Failed asserting that 'Database ".../CodeIgniter4/writable/foobar.db" already exists.\n
\n
' contains "successfully created.".

.../CodeIgniter4/tests/system/Commands/CreateDatabaseTest.php:68
2021-10-27 08:38:40 +09:00
Abdul Malik Ikhsan
6953587413
Merge pull request #5211 from kenjis/fix-publisher-macos
Fix Publisher test failures on macOS
2021-10-26 18:12:32 +07:00
kenjis
4b51e01b5b
test: fix test method names 2021-10-25 20:51:27 +09:00
kenjis
fa3620b24a
test: add test for CURLRequest unshared headers 2021-10-25 20:51:26 +09:00
Abdul Malik Ikhsan
7634d3a7a7
[Rector] Using LevelSetList::UP_TO_PHP_73 2021-10-25 14:35:29 +07:00
kenjis
6af9fc56ba
test: add a test case 2021-10-25 10:41:16 +09:00
kenjis
54d4ed1fe7
Merge pull request #5217 from kenjis/fix-BaseConnectionTest
Remove invalid @runTestsInSeparateProcesses
2021-10-24 19:35:09 +09:00
kenjis
11b5c265ae
test: fix tests
Security object should be created after setting super globals.
2021-10-23 14:38:33 +09:00
kenjis
fa78859639
test: fix tests
Request object should be created after setting super globals.
2021-10-23 14:38:33 +09:00
kenjis
f44ceba98c
test: fix test
CLIRequest should be used when CLI testing
2021-10-23 14:38:33 +09:00
kenjis
d67de2017e
feat: protect CSRF for PUT/PATCH/DELETE
Fixes #2913
2021-10-23 14:38:32 +09:00
kenjis
22634300eb
feat: add Session based CSRF protection 2021-10-21 15:14:47 +09:00
kenjis
9a87de8f47
Merge pull request #5221 from kenjis/fix-tests-readme
Improve tests/README.md
2021-10-21 10:50:18 +09:00
kenjis
5e03647d34
test: fix @var classname typo 2021-10-20 23:35:05 +08:00
kenjis
7a1cf38eeb
docs: change the version of PHPUnit to major version only
Co-authored-by: MGatner <mgatner@icloud.com>
2021-10-20 21:46:42 +09:00
kenjis
9718fa0abb
docs: improve tests/README.md 2021-10-20 09:20:24 +09:00
kenjis
24196f9316
test: remove invalid @runTestsInSeparateProcesses
It must be in the class PHPdoc.
2021-10-19 11:34:07 +09:00
kenjis
a2309e6c8b
fix: add fallbacks for realpath() so VFS is supported 2021-10-18 20:56:48 +09:00
kenjis
59ae985f9d
Add @group CacheLive to tests
* test: add `@group CacheLive`

* docs: add about CacheLive
2021-10-17 21:55:21 +08:00
kenjis
59c79d9a19
fix: test failures on macOS
`var` is a symlink to `private/var` on macOS
2021-10-17 17:59:56 +09:00
kenjis
26e0025df9
Fix CSRF filter does not work when set it to only post
* refactor: case the existence of config files with if statements

To make it easier to know which parts to delete in the future.

* docs: fix PHPDoc explanation

* fix: bug that CSRF cookie is not sent just by calling csrf_hash()

When the CSRF filter was set to POST method, it did not work.

* refactor: replace deprecated method getHeader()

* refactor: extract method

* refactor: extract method

* refactor: extract method

* refactor: use $this->hash instead of $_COOKIE

* test: fix the timing for setting superglobals

* test: fix Cannot modify header information

ErrorException: Cannot modify header information - headers already sent by ...

* style: vendor/bin/rector process

* refactor: ensure instance

It becomes clear that it is `SecurityConfig`.

Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>

* refactor: ensure instance

It becomes clear that it is `CookieConfig`.

Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>

* refactor: when $cookie is null, Cookie::setDefaults($cookie) does nothing

* refactor: extract method

* fix: make private extracted methods

* fix: make private added property

* fix: fallback to the local properties

Takes care when a user removes properties in config classes.

* refactor: use $request instead of $_POST

Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
2021-10-16 23:11:01 +08:00
Alex Schmitz
2007d6434d
[Debug] Improve keyword highlighting and escaping of query strings
* Sort highlighted keywords alphabetically.

* Add new composite keywords.

* Deconstruct composite keywords.

* Add basic test for query highlighting in toolbar.

* Ignore keywords in string values of queries.

* Use generic table and column names for tests.

* Add credits for regex pattern.

* Escape HTML entities when formatting query string.

* Use esc() for escaping query string.
2021-10-16 23:04:50 +08:00
Lonnie Ezell
0045a6f5f2
Merge pull request #5171 from ytetsuro/fix/#5164_add_dropKey_method
Add `dropKey` method to `Forge`
2021-10-15 08:46:22 -05:00
kenjis
125052ade2
docs: Github -> GitHub 2021-10-14 01:11:05 +08:00
John Paul E. Balandan, CPA
cb714b5b0c
Change behavior of class_attributes_separation rule 2021-10-11 17:03:05 +08:00