mirror of
https://gh.wpcy.net/https://github.com/nlemoine/wp-cli-fixtures.git
synced 2026-05-24 22:37:18 +08:00
`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.
44 lines
907 B
Gherkin
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
|
|
"""
|