wordpress-develop/tests/phpunit/tests/functions/listFiles.php
Sergey Biryukov 835e9c48a4 Tests: Add missing @covers tags for files in phpunit/tests/functions/.
Props pbearne, jrf.
See #39265.

git-svn-id: https://develop.svn.wordpress.org/trunk@49006 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-19 15:52:03 +00:00

23 lines
651 B
PHP

<?php
/**
* Test list_files().
*
* @group functions.php
* @covers ::list_files
*/
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 );
}
}