Files
wordpress-develop/tests/phpunit/tests/formatting/wpBasename.php
Sergey Biryukov 18f244c440 Tests: Move some @covers tags in the formatting group to the class DocBlock.
This aims to bring more consistency, as these test classes typically cover a single function, unless noted otherwise.

Follow-up to [53562], [53571], [54051].

See #56793.

git-svn-id: https://develop.svn.wordpress.org/trunk@54728 602fd350-edb4-49c9-b593-d223f7449a82
2022-10-31 13:54:00 +00:00

44 lines
772 B
PHP

<?php
/**
* @group formatting
*
* @covers ::wp_basename
*/
class Tests_Formatting_wpBasename extends WP_UnitTestCase {
public function test_wp_basename_unix() {
$this->assertSame(
'file',
wp_basename( '/home/test/file' )
);
}
public function test_wp_basename_unix_utf8_support() {
$this->assertSame(
'žluťoučký kůň.txt',
wp_basename( '/test/žluťoučký kůň.txt' )
);
}
/**
* @ticket 22138
*/
public function test_wp_basename_windows() {
$this->assertSame(
'file.txt',
wp_basename( 'C:\Documents and Settings\User\file.txt' )
);
}
/**
* @ticket 22138
*/
public function test_wp_basename_windows_utf8_support() {
$this->assertSame(
'щипцы.txt',
wp_basename( 'C:\test\щипцы.txt' )
);
}
}