-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9d87ad
commit bd91b81
Showing
4 changed files
with
52 additions
and
55 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
/** | ||
* Test WP_Fonts_Library::get_fonts_dir(). | ||
* | ||
* @package WordPress | ||
* @subpackage Fonts Library | ||
* | ||
* @group fonts | ||
* @group fonts-library | ||
* | ||
* @covers WP_Fonts_Library::get_fonts_dir | ||
*/ | ||
class Tests_Fonts_WpFontsLibrary_GetFontsDir extends WP_UnitTestCase { | ||
|
||
public function test_get_fonts_dir() { | ||
$this->assertStringEndsWith( '/wp-content/uploads/fonts', WP_Fonts_Library::get_fonts_dir() ); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
phpunit/fonts-library/wpFontsLibrary/setUploadDir-test.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* Test WP_Fonts_Library::set_upload_dir(). | ||
* | ||
* @package WordPress | ||
* @subpackage Fonts Library | ||
* | ||
* @group fonts | ||
* @group fonts-library | ||
* | ||
* @covers WP_Fonts_Library::set_upload_dir | ||
*/ | ||
class Tests_Fonts_WpFontsLibrary_SetUploadDir extends WP_UnitTestCase { | ||
|
||
public function test_should_set_fonts_upload_dir() { | ||
$defaults = array( | ||
'subdir' => '/abc', | ||
'basedir' => '/var/www/html/wp-content/uploads', | ||
'baseurl' => 'http://example.com/wp-content/uploads', | ||
); | ||
$expected = array( | ||
'subdir' => '/fonts', | ||
'basedir' => '/var/www/html/wp-content/uploads', | ||
'baseurl' => 'http://example.com/wp-content/uploads', | ||
'path' => '/var/www/html/wp-content/uploads/fonts', | ||
'url' => 'http://example.com/wp-content/uploads/fonts', | ||
); | ||
$this->assertSame( $expected, WP_Fonts_Library::set_upload_dir( $defaults ) ); | ||
} | ||
} |