? ? Pending

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
17 Mar 2021

Summary of Changes

Add new unit test to cover b/c and security fixes in 3.9.25/26

THIS TEST IS DESIGNED TO PASS BASED ON THE CURRENT STATE OF STAGING. This is AFTER 3.9.25 was released and BEFORE @richard67 fixes to b/c therefore MORE tuning might be required to the rules after the b/c issues are resolved.

Testing Instructions

Its a unit test. Run the unit tests and see if they pass :)

Actual result BEFORE applying this Pull Request

No test.

Expected result AFTER applying this Pull Request

A test that passes.

Documentation Changes Required

none.

avatar PhilETaylor PhilETaylor - open - 17 Mar 2021
avatar PhilETaylor PhilETaylor - change - 17 Mar 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 17 Mar 2021
Category Unit Tests
avatar PhilETaylor PhilETaylor - change - 17 Mar 2021
Labels Added: ? ?
avatar PhilETaylor PhilETaylor - change - 17 Mar 2021
Title
[3] Add unit test for FilePathRule
[3] Add passing unit test for FilePathRule
avatar PhilETaylor PhilETaylor - edited - 17 Mar 2021
avatar PhilETaylor PhilETaylor - change - 17 Mar 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 17 Mar 2021
avatar PhilETaylor PhilETaylor - change - 17 Mar 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 17 Mar 2021
avatar PhilETaylor
PhilETaylor - comment - 17 Mar 2021

looks like Drones link to composer is broken again - not related to this PR though

[Composer\Downloader\TransportException]
--
55 | Could not authenticate against github.com

avatar richard67
richard67 - comment - 17 Mar 2021

@PhilETaylor Would it make sense to add some test cases for e.g. Cyrillic or Greece names, e.g. Изображений and Εικόνες?

avatar richard67
richard67 - comment - 17 Mar 2021

And regarding numbers I am missing some with a number as first character. Your examples with numbers all start with /.

avatar PhilETaylor PhilETaylor - change - 17 Mar 2021
Labels Added: ?
Removed: ?
avatar PhilETaylor
PhilETaylor - comment - 17 Mar 2021
			array(false, $xml, '.images'),
			array(false, $xml, './images'),
			array(false, $xml, '.\images'),
			array(false, $xml, '../images'),
			array(false, $xml, '.../images'),
			array(true, $xml, 'c:\images'),
			array(false, $xml, '\\images'), // Means \images
			array(true, $xml, 'ftp://images'),
			array(true, $xml, 'http://images'),
			array(false, $xml, '/media'),
			array(false, $xml, '/administrator'),
			array(false, $xml, '/4711images'),
			array(false, $xml, '4711images'),
			array(false, $xml, '1'),
			array(false, $xml, '_'),
			array(false, $xml, '*'),
			array(false, $xml, '%'),
			array(false, $xml, '://foo'),
			array(false, $xml, '/4711i/images'),
			array(false, $xml, '../4711i/images'),
			array(false, $xml, 'Εικόνες'),
			array(false, $xml, 'Изображений'),
PHPUnit 4.8.36 by Sebastian Bergmann and contributors.
Warning:	The Xdebug extension is not loaded
		No code coverage will be generated.

......................

Time: 67 ms, Memory: 8.00MB

OK (22 tests, 22 assertions)
avatar richard67
richard67 - comment - 17 Mar 2021

@PhilETaylor On Linux test are passing:

richard@vmkubu02:~/lamp/public_html/joomla-cms$ ./libraries/vendor/phpunit/phpunit/phpunit tests/unit/suites/libraries/cms/form/rule/FilePathRuleTest.php
PHPUnit 4.8.36 by Sebastian Bergmann and contributors.
Warning:        The Xdebug extension is not loaded
                No code coverage will be generated.

.......................

Time: 59 ms, Memory: 8.00MB

OK (23 tests, 23 assertions)

User deprecation notices (138)

JError::setErrorHandling() is deprecated: 138x
    69x in FilePathRuleTest::setUp
    69x in FilePathRuleTest::tearDown

richard@vmkubu02:~/lamp/public_html/joomla-cms$

Windows I haven't tested (yet).

avatar PhilETaylor
PhilETaylor - comment - 17 Mar 2021

Windows I haven't tested (yet).

Well I dont have windows anywhere here but isn't this why we have Drone and AppVeyor?

https://ci.appveyor.com/project/release-joomla/joomla-cms/builds/38276109/job/lpq1nwygs34vr7qk?fullLog=true

Thats windows, and the tests are passing there.

avatar richard67
richard67 - comment - 17 Mar 2021

https://ci.appveyor.com/project/release-joomla/joomla-cms/builds/38276109/job/lpq1nwygs34vr7qk?fullLog=true

Thats windows, and the tests are passing there.

@PhilETaylor You are right, thanks for pointing me to it. I think I need sleep soon ;-)

avatar richard67 richard67 - test_item - 17 Mar 2021 - Tested successfully
avatar richard67
richard67 - comment - 17 Mar 2021

I have tested this item successfully on b470537

Unit tests pass on Linux (drone) and Windows (appveyor).

I've successfully checked the complete loge files in drone and appveyor to verify that the new tests have been run.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32723.

avatar rdeutz
rdeutz - comment - 18 Mar 2021

I am meging this on review. The PR #32718 need some ajustments so that the test covers the b/c break as Phil pointed out, I will make a comment on the other PR how to test.

avatar rdeutz rdeutz - change - 18 Mar 2021
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-03-18 06:16:06
Closed_By rdeutz
Labels Added: ?
Removed: ?
avatar rdeutz rdeutz - close - 18 Mar 2021
avatar rdeutz rdeutz - merge - 18 Mar 2021

Add a Comment

Login with GitHub to post a comment