mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 20:24:26 +00:00
Move PHPUnit tests into a tests/phpunit directory.
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
This commit is contained in:
38
tests/phpunit/tests/admin/includesFile.php
Normal file
38
tests/phpunit/tests/admin/includesFile.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @group file
|
||||
* @group admin
|
||||
*/
|
||||
class Tests_Admin_includesFile extends WP_UnitTestCase {
|
||||
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 20449
|
||||
*/
|
||||
function test_get_home_path() {
|
||||
$home = get_option( 'home' );
|
||||
$siteurl = get_option( 'siteurl' );
|
||||
$sfn = $_SERVER['SCRIPT_FILENAME'];
|
||||
$this->assertEquals( str_replace( '\\', '/', ABSPATH ), get_home_path() );
|
||||
|
||||
update_option( 'home', 'http://localhost' );
|
||||
update_option( 'siteurl', 'http://localhost/wp' );
|
||||
|
||||
$_SERVER['SCRIPT_FILENAME'] = 'D:\root\vhosts\site\httpdocs\wp\wp-admin\options-permalink.php';
|
||||
$this->assertEquals( 'D:/root/vhosts/site/httpdocs/', get_home_path() );
|
||||
|
||||
$_SERVER['SCRIPT_FILENAME'] = '/Users/foo/public_html/trunk/wp/wp-admin/options-permalink.php';
|
||||
$this->assertEquals( '/Users/foo/public_html/trunk/', get_home_path() );
|
||||
|
||||
$_SERVER['SCRIPT_FILENAME'] = 'S:/home/wordpress/trunk/wp/wp-admin/options-permalink.php';
|
||||
$this->assertEquals( 'S:/home/wordpress/trunk/', get_home_path() );
|
||||
|
||||
update_option( 'home', $home );
|
||||
update_option( 'siteurl', $siteurl );
|
||||
$_SERVER['SCRIPT_FILENAME'] = $sfn;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user