mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Adds the `@covers` tag to the test DocBlock. Adds missing `public` visibility to the test method. Follow-up to [25002]. Props pbearne, jrf, hellofromTonya. See #39265. git-svn-id: https://develop.svn.wordpress.org/trunk@51994 602fd350-edb4-49c9-b593-d223f7449a82
31 lines
980 B
PHP
31 lines
980 B
PHP
<?php
|
|
|
|
/**
|
|
* @group admin
|
|
*/
|
|
class Tests_Admin_IncludesMisc extends WP_UnitTestCase {
|
|
|
|
/**
|
|
* @covers ::url_shorten
|
|
*/
|
|
public function test_shorten_url() {
|
|
$tests = array(
|
|
'wordpress\.org/about/philosophy'
|
|
=> 'wordpress\.org/about/philosophy', // No longer strips slashes.
|
|
'wordpress.org/about/philosophy'
|
|
=> 'wordpress.org/about/philosophy',
|
|
'http://wordpress.org/about/philosophy/'
|
|
=> 'wordpress.org/about/philosophy', // Remove http, trailing slash.
|
|
'http://www.wordpress.org/about/philosophy/'
|
|
=> 'wordpress.org/about/philosophy', // Remove http, www.
|
|
'http://wordpress.org/about/philosophy/#box'
|
|
=> 'wordpress.org/about/philosophy/#box', // Don't shorten 35 characters.
|
|
'http://wordpress.org/about/philosophy/#decisions'
|
|
=> 'wordpress.org/about/philosophy/#…', // Shorten to 32 if > 35 after cleaning.
|
|
);
|
|
foreach ( $tests as $k => $v ) {
|
|
$this->assertSame( $v, url_shorten( $k ) );
|
|
}
|
|
}
|
|
}
|