Skip to content

Commit

Permalink
Group checks & enable font-weight check
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Oct 15, 2021
1 parent 9f99deb commit 5ca9d8d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/phpunit/tests/webfonts-api/wpWebfontsRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public function data_register_with_invalid_schema() {
'webfont' => array(),
'expected_message' => 'Webfont provider must be a non-empty string.',
),

// Provider checks.
'provider: not set' => array(
'webfont' => array(
'fontFamily' => 'Open Sans',
Expand All @@ -73,6 +75,8 @@ public function data_register_with_invalid_schema() {
),
'expected_message' => 'Webfont provider must be a non-empty string.',
),

// Font-family checks.
'font family: not set' => array(
'webfont' => array(
'provider' => 'local',
Expand All @@ -99,6 +103,8 @@ public function data_register_with_invalid_schema() {
),
'expected_message' => 'Webfont font family must be a non-empty string.',
),

// Font-style checks.
'font style: empty string' => array(
'webfont' => array(
'provider' => 'local',
Expand Down Expand Up @@ -126,6 +132,8 @@ public function data_register_with_invalid_schema() {
),
'expected_message' => 'Webfont font style must be normal, italic, oblique, or oblique <angle>. Given: invalid.',
),

// Font-weight checks.
'font weight: empty string' => array(
'webfont' => array(
'provider' => 'local',
Expand All @@ -144,8 +152,6 @@ public function data_register_with_invalid_schema() {
),
'expected_message' => 'Webfont font weight must be a non-empty string.',
),
// @todo uncomment once value validation is added.
/*
'font weight: invalid value' => array(
'webfont' => array(
'provider' => 'local',
Expand All @@ -155,7 +161,6 @@ public function data_register_with_invalid_schema() {
),
'expected_message' => 'Webfont font weight must be a non-empty string.',
),
*/
);
}

Expand Down

0 comments on commit 5ca9d8d

Please sign in to comment.