mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
The theme and plugin editors now list all files in the selected theme or plugin, recursing through subdirectories as necessary. Props WraithKenny, schlessera, chsxf, MikeHansenMe, Daedalon, valendesigns, westonruter, pento. Fixes #6531. git-svn-id: https://develop.svn.wordpress.org/trunk@41806 602fd350-edb4-49c9-b593-d223f7449a82
21 lines
626 B
PHP
21 lines
626 B
PHP
<?php
|
|
|
|
/**
|
|
* Test list_files().
|
|
*
|
|
* @group functions.php
|
|
*/
|
|
class Tests_Functions_ListFiles extends WP_UnitTestCase {
|
|
public function test_list_files_returns_a_list_of_files() {
|
|
$admin_files = list_files( ABSPATH . 'wp-admin/' );
|
|
$this->assertInternalType( 'array', $admin_files );
|
|
$this->assertNotEmpty( $admin_files );
|
|
$this->assertContains( ABSPATH . 'wp-admin/index.php', $admin_files );
|
|
}
|
|
|
|
public function test_list_files_can_exclude_files() {
|
|
$admin_files = list_files( ABSPATH . 'wp-admin/', 100, array( 'index.php' ) );
|
|
$this->assertNotContains( ABSPATH . 'wp-admin/index.php', $admin_files );
|
|
}
|
|
}
|