mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
`$wp_plugin_paths` contains normalized paths, see `wp_register_plugin_realpath()`. Props jdgrimes, voldemortensen, flyingdr, ocean90. Fixes #29154. git-svn-id: https://develop.svn.wordpress.org/trunk@37332 602fd350-edb4-49c9-b593-d223f7449a82
28 lines
606 B
PHP
28 lines
606 B
PHP
<?php
|
|
|
|
/**
|
|
* Tests for plugin_basename()
|
|
*
|
|
* @group functions.php
|
|
* @group plugins
|
|
*/
|
|
class Tests_Plugin_Basename extends WP_UnitTestCase {
|
|
|
|
/**
|
|
* @ticket 29154
|
|
*/
|
|
function test_should_return_correct_basename_for_symlinked_plugins() {
|
|
global $wp_plugin_paths;
|
|
|
|
$old_wp_plugin_paths = $wp_plugin_paths;
|
|
|
|
$wp_plugin_paths[ WP_PLUGIN_DIR . '/a-symlinked-plugin' ] = 'C:/www/path/plugins/a-plugin';
|
|
|
|
$basename = plugin_basename( 'c:\www\path\plugins\a-plugin\plugin.php' );
|
|
|
|
$wp_plugin_paths = $old_wp_plugin_paths;
|
|
|
|
$this->assertSame( 'a-symlinked-plugin/plugin.php', $basename );
|
|
}
|
|
}
|