|
| 1 | +Feature: Manage WordPress font collections |
| 2 | + |
| 3 | + Background: |
| 4 | + Given a WP install |
| 5 | + |
| 6 | + @require-wp-6.5 |
| 7 | + Scenario: Listing font collections |
| 8 | + When I try `wp font collection list` |
| 9 | + Then STDOUT should be a table containing rows: |
| 10 | + | slug | name | description | categories | |
| 11 | + | google-fonts | Google Fonts | Install from Google Fonts. Fonts are copied to and served from your site. | Sans Serif (sans-serif), Display (display), Serif (serif), Handwriting (handwriting), Monospace (monospace) | |
| 12 | + |
| 13 | + @require-wp-6.5 |
| 14 | + Scenario: Getting a non-existent font collection |
| 15 | + When I try `wp font collection get nonexistent-collection` |
| 16 | + Then the return code should be 1 |
| 17 | + And STDERR should contain: |
| 18 | + """ |
| 19 | + doesn't exist |
| 20 | + """ |
| 21 | + |
| 22 | + @require-wp-6.5 |
| 23 | + Scenario: Checking whether a font collection is registered |
| 24 | + When I try `wp font collection is-registered nonexistent-collection` |
| 25 | + Then the return code should be 1 |
| 26 | + |
| 27 | + When I run `wp font collection is-registered google-fonts` |
| 28 | + Then the return code should be 0 |
| 29 | + |
| 30 | + @require-wp-6.5 |
| 31 | + Scenario: Listing font families in a collection |
| 32 | + When I run `wp font collection list-families google-fonts --format=count` |
| 33 | + Then STDOUT should be a number |
| 34 | + |
| 35 | + @require-wp-6.5 |
| 36 | + Scenario: Listing font families in a collection with fields |
| 37 | + When I run `wp font collection list-families google-fonts --fields=slug,name --format=csv` |
| 38 | + Then STDOUT should contain: |
| 39 | + """ |
| 40 | + slug,name |
| 41 | + """ |
| 42 | + |
| 43 | + @require-wp-6.5 |
| 44 | + Scenario: Filtering font families by category |
| 45 | + When I run `wp font collection list-families google-fonts --category=sans-serif --format=count` |
| 46 | + Then STDOUT should be a number |
| 47 | + |
| 48 | + @require-wp-6.5 |
| 49 | + Scenario: Listing categories in a collection |
| 50 | + When I run `wp font collection list-categories google-fonts --format=csv` |
| 51 | + Then STDOUT should contain: |
| 52 | + """ |
| 53 | + slug,name |
| 54 | + """ |
| 55 | + |
| 56 | + @require-wp-6.5 |
| 57 | + Scenario: Getting a non-existent collection for list-families |
| 58 | + When I try `wp font collection list-families nonexistent-collection` |
| 59 | + Then the return code should be 1 |
| 60 | + And STDERR should contain: |
| 61 | + """ |
| 62 | + doesn't exist |
| 63 | + """ |
| 64 | + |
| 65 | + @require-wp-6.5 |
| 66 | + Scenario: Getting a non-existent collection for list-categories |
| 67 | + When I try `wp font collection list-categories nonexistent-collection` |
| 68 | + Then the return code should be 1 |
| 69 | + And STDERR should contain: |
| 70 | + """ |
| 71 | + doesn't exist |
| 72 | + """ |
| 73 | + |
| 74 | + @less-than-wp-6.5 |
| 75 | + Scenario: Font collection commands fail on WordPress < 6.5 |
| 76 | + Given a WP install |
| 77 | + When I try `wp font collection list` |
| 78 | + Then the return code should be 1 |
| 79 | + And STDERR should contain: |
| 80 | + """ |
| 81 | + Requires WordPress 6.5 or greater |
| 82 | + """ |
0 commit comments