Skip to content

Commit

Permalink
Fix failing test_generate_styles test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeyip committed Mar 14, 2022
1 parent f98852d commit be66425
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions phpunit/class-wp-webfonts-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,21 +311,21 @@ public function test_validate_font() {
* @covers WP_Webfonts::generate_styles
*/
public function test_generate_styles() {
$font = array(
'provider' => 'local',
'font-family' => 'Source Serif Pro',
'font-style' => 'normal',
'font-weight' => '200 900',
'font-stretch' => 'normal',
'src' => 'https://example.com/assets/fonts/source-serif-pro/SourceSerif4Variable-Roman.ttf.woff2',
'font-display' => 'fallback',
$webfonts = array(
array(
'provider' => 'local',
'font-family' => 'Source Serif Pro',
'font-style' => 'normal',
'font-weight' => '200 900',
'font-stretch' => 'normal',
'src' => 'https://example.com/assets/fonts/source-serif-pro/SourceSerif4Variable-Roman.ttf.woff2',
'font-display' => 'fallback',
),
);

wp_register_webfont( $font );

$this->assertEquals(
'@font-face{font-family:"Source Serif Pro";font-style:normal;font-weight:200 900;font-display:fallback;font-stretch:normal;src:local("Source Serif Pro"), url(\'https://example.com/assets/fonts/source-serif-pro/SourceSerif4Variable-Roman.ttf.woff2\') format(\'woff2\');}',
wp_webfonts()->generate_styles()
'@font-face{font-family:"Source Serif Pro";font-style:normal;font-weight:200 900;font-stretch:normal;src:local("Source Serif Pro"), url(\'https://example.com/assets/fonts/source-serif-pro/SourceSerif4Variable-Roman.ttf.woff2\') format(\'woff2\');font-display:fallback;}',
wp_webfonts()->generate_styles( $webfonts )
);
}

Expand Down

0 comments on commit be66425

Please sign in to comment.