wordpress-develop/tests/phpunit/tests/category/getCatName.php
Sergey Biryukov 1118e37f48 Coding Standards: Remove superfluous blank lines at the end of various functions.
Note: This is enforced by WPCS 3.0.0.

Follow-up to [56536], [56547].

Props jrf.
See #59161, #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56548 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-08 10:01:14 +00:00

29 lines
600 B
PHP

<?php
/**
* @group taxonomy
* @group category.php
*
* @covers ::get_cat_name
*/
class Tests_Category_GetCatName extends WP_UnitTestCase {
/**
* Validate get_cat_name function
*/
public function test_get_cat_name() {
// Create test category.
$testcat = self::factory()->category->create_and_get(
array(
'slug' => 'testcat',
'name' => 'Test Category 1',
)
);
// Validate.
$this->assertSame( $testcat->name, get_cat_name( $testcat->term_id ) );
$this->assertSame( '', get_cat_name( -1 ) );
$this->assertSame( '', get_cat_name( $testcat->term_id + 100 ) );
}
}