wp-cli-fixtures/features/nav_menu.feature
Ian Jenkins f843191a1b Fix issue where delete would error due to wrong entity name.
`PHP Fatal error:  Uncaught Error: Class
'Hellonico\Fixtures\Entity\Nav_menu_item' not found`

This corrects that by fixing the naming within the valid types array in
the delete command, but also adds delete commands to NavMenu and
NavMenuItem. It adds tests as well.
2021-03-18 16:55:07 +00:00

44 lines
907 B
Gherkin

Feature: Nav menus fixtures
Scenario: Generate nav menus
Given a WP install
And a fixtures.yml file:
"""
Hellonico\Fixtures\Entity\NavMenu:
header:
name: header
locations:
- header
- footer
"""
When I run `wp fixtures load`
Then STDOUT should contain:
"""
1 navmenu have been successfully created
"""
When I run `wp menu list --format=count`
Then STDOUT should be:
"""
1
"""
Scenario: Delete nav menus
Given a WP install
And a fixtures.yml file:
"""
Hellonico\Fixtures\Entity\NavMenu:
header:
name: header
locations:
- header
- footer
"""
When I run `wp fixtures load`
When I run `wp fixtures delete navMenu --yes`
Then STDOUT should contain:
"""
1 navmenu have been successfully deleted
"""