Changeset 56124
- Timestamp:
- 07/02/2023 10:33:18 AM (20 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-automatic-updater.php
r55988 r56124 149 149 150 150 $check_dirs = array_unique( $check_dirs ); 151 $checkout = false; 151 152 152 153 // Search all directories we've found for evidence of version control. -
trunk/tests/phpunit/tests/admin/wpAutomaticUpdater.php
r55425 r56124 707 707 ); 708 708 } 709 710 /** 711 * Tests that `WP_Automatic_Updater::is_vcs_checkout()` returns `false` 712 * when none of the checked directories are allowed. 713 * 714 * @ticket 58563 715 * 716 * @covers WP_Automatic_Updater::is_vcs_checkout 717 */ 718 public function test_is_vcs_checkout_should_return_false_when_no_directories_are_allowed() { 719 $updater_mock = $this->getMockBuilder( 'WP_Automatic_Updater' ) 720 // Note: setMethods() is deprecated in PHPUnit 9, but still supported. 721 ->setMethods( array( 'is_allowed_dir' ) ) 722 ->getMock(); 723 724 /* 725 * As none of the directories should be allowed, simply mocking `WP_Automatic_Updater` 726 * and forcing `::is_allowed_dir()` to return `false` removes the need to run the test 727 * in a separate process due to setting the `open_basedir` PHP directive. 728 */ 729 $updater_mock->expects( $this->any() )->method( 'is_allowed_dir' )->willReturn( false ); 730 731 $this->assertFalse( $updater_mock->is_vcs_checkout( get_temp_dir() ) ); 732 } 709 733 }
Note: See TracChangeset
for help on using the changeset viewer.