mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
wp-tests-config.php can/should reside in the root of a develop checkout. `phpunit` should be run from the root. see #25088. git-svn-id: https://develop.svn.wordpress.org/trunk@25165 602fd350-edb4-49c9-b593-d223f7449a82
26 lines
908 B
PHP
26 lines
908 B
PHP
<?php
|
|
|
|
/**
|
|
* @group admin
|
|
*/
|
|
class Tests_Admin_includesMisc extends WP_UnitTestCase {
|
|
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->assertEquals( $v, url_shorten( $k ) );
|
|
}
|
|
}
|