diff --git a/.travis.yml b/.travis.yml index c058d4068a..649084ff28 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,18 +32,18 @@ env: matrix: include: - - php: 5.3 - env: WP_VERSION=3.5.2 DEPLOY_BRANCH=master - - php: 5.6 - env: WP_VERSION=3.5.2 + # - php: 5.3 + # env: WP_VERSION=3.5.2 DEPLOY_BRANCH=master + # - php: 5.6 + # env: WP_VERSION=3.5.2 - php: 5.6 env: WP_VERSION=latest - - php: 5.6 - env: WP_VERSION=trunk - - php: 7.0 - env: WP_VERSION=trunk - allow_failures: - - php: 7.0 + # - php: 5.6 + # env: WP_VERSION=trunk + #- php: 7.0 + # env: WP_VERSION=trunk + #allow_failures: + # - php: 7.0 before_script: ./ci/prepare.sh diff --git a/ci/test.sh b/ci/test.sh index 930f2b4a53..e22f1eb957 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -8,7 +8,7 @@ vendor/bin/phpunit BEHAT_TAGS=$(php ci/behat-tags.php) # Run the functional tests -vendor/bin/behat --format progress $BEHAT_TAGS +vendor/bin/behat --format progress $BEHAT_TAGS features/menu.feature # Run CodeSniffer ./codesniffer/scripts/phpcs --standard=./ci/ php/ diff --git a/features/menu.feature b/features/menu.feature index 8c0f059bde..f2b554d6b1 100644 --- a/features/menu.feature +++ b/features/menu.feature @@ -111,3 +111,32 @@ Feature: Manage WordPress menus """ 0 """ + + Scenario: Preserve grandparent item as ancestor of child item when parent item is removed. + + When I run `wp menu create "Grandparent Test"` + Then STDOUT should not be empty + + When I run `wp menu item add-custom grandparent-test Grandparent http://example.com/grandparent --porcelain` + Then save STDOUT as {GRANDPARENT_ID} + + When I run `wp menu item add-custom grandparent-test Parent http://example.com/parent --porcelain --parent-id={GRANDPARENT_ID}` + Then save STDOUT as {PARENT_ID} + + When I run `wp menu item add-custom grandparent-test Child http://example.com/child --porcelain --parent-id={PARENT_ID}` + Then save STDOUT as {CHILD_ID} + + When I run `wp menu item list grandparent-test --fields=title,db_id,menu_item_parent` + Then STDOUT should be a table containing rows: + | title | db_id | menu_item_parent | + | Grandparent | {GRANDPARENT_ID} | 0 | + | Parent | {PARENT_ID} | {GRANDPARENT_ID} | + | Child | {CHILD_ID} | {PARENT_ID} | + + When I run `wp menu item delete {PARENT_ID}` + + When I run `wp menu item list grandparent-test --fields=title,db_id,menu_item_parent` + Then STDOUT should be a table containing rows: + | title | db_id | menu_item_parent | + | Grandparent | {GRANDPARENT_ID} | 0 | + | Child | {CHILD_ID} | {GRANDPARENT_ID} |