From 9df36c9b26167638d4ca3a28e4e8eaffc7457a54 Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Thu, 21 Oct 2021 10:24:41 +0300 Subject: [PATCH] Fix some failing tests --- .../webfonts-api/wpWebfontsSchemaValidator.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/tests/webfonts-api/wpWebfontsSchemaValidator.php b/tests/phpunit/tests/webfonts-api/wpWebfontsSchemaValidator.php index 9c3a447dc3127..681dc248b558b 100644 --- a/tests/phpunit/tests/webfonts-api/wpWebfontsSchemaValidator.php +++ b/tests/phpunit/tests/webfonts-api/wpWebfontsSchemaValidator.php @@ -119,19 +119,28 @@ public function data_is_valid_schema_with_invalid() { 'font-style' => 'normal', 'font-weight' => '400', ), - 'expected_message' => 'Webfont provider must be a non-empty string.', + 'expected_message' => array( + 'Webfont provider must be a non-empty string.', ), - 'font-family: not defined' => array( + 'provider: not registered' => array( 'webfont' => array( 'provider' => 'some-provider', 'font-style' => 'normal', 'font-weight' => '400', ), + 'expected_message' => 'Webfont provider is not registered.', + ), + 'font-family: not defined' => array( + 'webfont' => array( + 'provider' => 'local', + 'font-style' => 'normal', + 'font-weight' => '400', + ), 'expected_message' => 'Webfont font family must be a non-empty string.', ), 'font-family: empty string' => array( 'webfont' => array( - 'provider' => 'some-provider', + 'provider' => 'local', 'font-family' => '', 'font-style' => 'normal', 'font-weight' => '400', @@ -140,7 +149,7 @@ public function data_is_valid_schema_with_invalid() { ), 'font-family: not a string' => array( 'webfont' => array( - 'provider' => 'some-provider', + 'provider' => 'local', 'font-family' => null, 'font-style' => 'normal', 'font-weight' => '400',