Skip to content

Commit dfefa2a

Browse files
committed
update for more recent "fixes" for single file plugin
1 parent 3ac4f6b commit dfefa2a

3 files changed

Lines changed: 2 additions & 9 deletions

File tree

src/wp-includes/class-wp-plugin-dependencies.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -870,9 +870,6 @@ protected static function check_for_circular_dependencies( $dependents, $depende
870870
* @return string The plugin's slug.
871871
*/
872872
protected static function convert_to_slug( $plugin_file ) {
873-
if ( 'hello.php' === $plugin_file ) {
874-
return 'hello-dolly';
875-
}
876873
return str_contains( $plugin_file, '/' ) ? dirname( $plugin_file ) : str_replace( '.php', '', $plugin_file );
877874
}
878875
}

tests/phpunit/tests/admin/plugin-dependencies/hasDependents.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ public function test_should_return_false_when_a_plugin_has_no_dependents() {
5353
*/
5454
public function test_should_convert_hellophp_to_hello_dolly() {
5555
$this->set_property_value( 'dependency_slugs', array( 'hello-dolly' ) );
56-
$this->assertTrue( self::$instance::has_dependents( 'hello.php' ) );
56+
$this->assertTrue( self::$instance::has_dependents( 'hello-dolly/hello.php' ) );
5757
}
5858
}

tests/phpunit/tests/admin/plugin-dependencies/initialize.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,7 @@ public function test_should_slugify_dependent_files() {
281281
$expected_slugs = array();
282282
foreach ( $plugins as $plugin_file => &$headers ) {
283283
// Create the expected slugs.
284-
if ( 'hello.php' === $plugin_file ) {
285-
$slug = 'hello-dolly';
286-
} else {
287-
$slug = str_replace( '.php', '', explode( '/', $plugin_file )[0] );
288-
}
284+
$slug = str_replace( '.php', '', explode( '/', $plugin_file )[0] );
289285

290286
$expected_slugs[ $plugin_file ] = $slug;
291287

0 commit comments

Comments
 (0)