[wp-trac] [WordPress Trac] #57774: Add some initial PHPUnit tests for `WP_Filesystem_Direct`

WordPress Trac noreply at wordpress.org
Mon Mar 18 08:56:27 UTC 2024


#57774: Add some initial PHPUnit tests for `WP_Filesystem_Direct`
---------------------------------------------+-----------------------------
 Reporter:  costdev                          |       Owner:  hellofromTonya
     Type:  task (blessed)                   |      Status:  reopened
 Priority:  normal                           |   Milestone:  6.5
Component:  Build/Test Tools                 |     Version:  2.5
 Severity:  normal                           |  Resolution:
 Keywords:  has-patch has-unit-tests commit  |     Focuses:
---------------------------------------------+-----------------------------

Comment (by swissspidy):

 I was able to reproduce the issues locally as well.

 **Operation not permitted**

 The issue seems to be the line:

 `$expected_group = $this->is_windows() ? $original_owner : $original_owner
 + 1;`

 `$original_owner` is the result of `fileowner()`, which is the user ID of
 the current owner).

 On my system there is no such user with ID+1, hence the operation is not
 permitted.

 I think that's an easy thing to solve, just don't use another user ID.

 **Directory not empty**

 The tests seem to pass when run in isolation, so it's probably some
 missing cleanup elsewhere.

 In my quick testing, fixing the `Operation not permitted` issue actually
 seemed to solve these ones here. So two birds with one stone.

 Here's a PR: https://github.com/WordPress/wordpress-develop/pull/6286

 If it passes we can commit this and then see how the hosting tests are
 afterwards.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57774#comment:29>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list