From ad41fe40abbfe3316afe7833c0fbf74f7a224055 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Sun, 6 Dec 2015 12:41:29 -0500 Subject: [PATCH 01/16] Update test.sh --- ci/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/test.sh b/ci/test.sh index 930f2b4a53..5e563435c8 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 # Run CodeSniffer ./codesniffer/scripts/phpcs --standard=./ci/ php/ From af27902ef57f9ee048d3a35d666051e5d99bf8d5 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Sun, 6 Dec 2015 13:01:58 -0500 Subject: [PATCH 02/16] Update menu.feature --- features/menu.feature | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/features/menu.feature b/features/menu.feature index 8c0f059bde..62454e8e5a 100644 --- a/features/menu.feature +++ b/features/menu.feature @@ -111,3 +111,7 @@ Feature: Manage WordPress menus """ 0 """ + + Scenario: Preserve grandparent when parent is removed. + Fail + From 9fa0d9ab4a1ea34578874ba942d0b95322696971 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Sun, 6 Dec 2015 13:04:04 -0500 Subject: [PATCH 03/16] limiting travis matrix Rebase this commit out later before sending real PR --- .travis.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 From c8a6e42c224e2b5fdbd6b94c8ec0f2d13feb9c8c Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Sun, 6 Dec 2015 13:08:16 -0500 Subject: [PATCH 04/16] Update test.sh --- ci/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/test.sh b/ci/test.sh index 5e563435c8..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/ From 878158acf9eb63f44102ee9cd3c310182af4a880 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Sun, 6 Dec 2015 13:11:59 -0500 Subject: [PATCH 05/16] Update menu.feature --- features/menu.feature | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/features/menu.feature b/features/menu.feature index 62454e8e5a..ae16f0f337 100644 --- a/features/menu.feature +++ b/features/menu.feature @@ -113,5 +113,7 @@ Feature: Manage WordPress menus """ Scenario: Preserve grandparent when parent is removed. - Fail + Given a grandparent, parent and child menu item + When the parent is deleted + Then the grandparent becomes the parent of the child From 6cef47a512b37174a909deab8bf58848d2de0bf9 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Sun, 6 Dec 2015 13:53:52 -0500 Subject: [PATCH 06/16] Starting out the grandparent test --- features/menu.feature | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/features/menu.feature b/features/menu.feature index ae16f0f337..099ac3eb63 100644 --- a/features/menu.feature +++ b/features/menu.feature @@ -111,9 +111,28 @@ Feature: Manage WordPress menus """ 0 """ - + Scenario: Preserve grandparent when parent is removed. + + When I run `wp menu create "Grandparent Test"`` + Then STDOUT should not be empty + + When I run `wp menu item add-term grandparent-test Grandparent http://example.com/grandparent --porcelain` + Then save STDOUT as {GRANDPARENT_ID} + + When I run `wp menu item add-term 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-term 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=type,title,position,link,menu_item_parent` + Then STDOUT should be a table containing rows: + | type | title | position | link | menu_item_parent | + | custom | Grandparent | 1 | http://example.com/grandparent | 0 | + | custom | Parent | 2 | http://example.com/parent | {GRANDPARENT_ID} | + | custom | Child | 3 | http://example.com/child | {PARENT_ID} | + Given a grandparent, parent and child menu item When the parent is deleted Then the grandparent becomes the parent of the child - From 07f1c91c35bfce8f709d9e8d29bcc8d833f7449e Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Sun, 6 Dec 2015 14:02:04 -0500 Subject: [PATCH 07/16] more behatting --- features/menu.feature | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/features/menu.feature b/features/menu.feature index 099ac3eb63..db18a25195 100644 --- a/features/menu.feature +++ b/features/menu.feature @@ -133,6 +133,10 @@ Feature: Manage WordPress menus | custom | Parent | 2 | http://example.com/parent | {GRANDPARENT_ID} | | custom | Child | 3 | http://example.com/child | {PARENT_ID} | - Given a grandparent, parent and child menu item - When the parent is deleted - Then the grandparent becomes the parent of the child + When I run `wp menu item delete {PARENT_ID} + + When I run `wp menu item list grandparent-test --fields=type,title,position,link,menu_item_parent` + Then STDOUT should be a table containing rows: + | type | title | position | link | menu_item_parent | + | custom | Grandparent | 1 | http://example.com/grandparent | 0 | + | custom | Child | 3 | http://example.com/child | {GRANDPARENT_ID} | From b966ca4b60a1304ac2adc421fa636d2b1d35cabf Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Sun, 6 Dec 2015 14:04:58 -0500 Subject: [PATCH 08/16] Typo fix --- features/menu.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/menu.feature b/features/menu.feature index db18a25195..fc32b75cab 100644 --- a/features/menu.feature +++ b/features/menu.feature @@ -114,7 +114,7 @@ Feature: Manage WordPress menus Scenario: Preserve grandparent when parent is removed. - When I run `wp menu create "Grandparent Test"`` + When I run `wp menu create "Grandparent Test"` Then STDOUT should not be empty When I run `wp menu item add-term grandparent-test Grandparent http://example.com/grandparent --porcelain` From 9757f318d23feb60f5b66adb1d62d48b5c2327b8 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Sun, 6 Dec 2015 14:05:21 -0500 Subject: [PATCH 09/16] Typo fix --- features/menu.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/menu.feature b/features/menu.feature index fc32b75cab..43517d4d58 100644 --- a/features/menu.feature +++ b/features/menu.feature @@ -133,7 +133,7 @@ Feature: Manage WordPress menus | custom | Parent | 2 | http://example.com/parent | {GRANDPARENT_ID} | | custom | Child | 3 | http://example.com/child | {PARENT_ID} | - When I run `wp menu item delete {PARENT_ID} + When I run `wp menu item delete {PARENT_ID}` When I run `wp menu item list grandparent-test --fields=type,title,position,link,menu_item_parent` Then STDOUT should be a table containing rows: From dfb96f5217a3e07c073fce81f19e2f6a00257114 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Sun, 6 Dec 2015 14:16:29 -0500 Subject: [PATCH 10/16] Tweaking table in behat --- features/menu.feature | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/features/menu.feature b/features/menu.feature index 43517d4d58..601e3e5998 100644 --- a/features/menu.feature +++ b/features/menu.feature @@ -126,17 +126,17 @@ Feature: Manage WordPress menus When I run `wp menu item add-term 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=type,title,position,link,menu_item_parent` + When I run `wp menu item list grandparent-test --fields=type,title,position,link,menu_item_parent,db_id` Then STDOUT should be a table containing rows: - | type | title | position | link | menu_item_parent | - | custom | Grandparent | 1 | http://example.com/grandparent | 0 | - | custom | Parent | 2 | http://example.com/parent | {GRANDPARENT_ID} | - | custom | Child | 3 | http://example.com/child | {PARENT_ID} | + | type | title | position | link | menu_item_parent | db_id | + | custom | Grandparent | 1 | http://example.com/grandparent | 0 | {GRANDPARENT_ID} | + | custom | Parent | 2 | http://example.com/parent | {GRANDPARENT_ID} | {PARENT_ID} | + | custom | Child | 3 | http://example.com/child | {PARENT_ID} | {CHILD_ID} | When I run `wp menu item delete {PARENT_ID}` - When I run `wp menu item list grandparent-test --fields=type,title,position,link,menu_item_parent` + When I run `wp menu item list grandparent-test --fields=type,title,position,link,menu_item_parent,db_id` Then STDOUT should be a table containing rows: - | type | title | position | link | menu_item_parent | - | custom | Grandparent | 1 | http://example.com/grandparent | 0 | - | custom | Child | 3 | http://example.com/child | {GRANDPARENT_ID} | + | type | title | position | link | menu_item_parent | db_id | + | custom | Grandparent | 1 | http://example.com/grandparent | 0 | {GRANDPARENT_ID} | + | custom | Child | 3 | http://example.com/child | {GRANDPARENT_ID} | {CHILD_ID} | From ea51f6d583e546c0759ab5d1c0f9d77e929d3016 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Sun, 6 Dec 2015 14:19:32 -0500 Subject: [PATCH 11/16] Trying to fix odd fail on travis --- features/menu.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/menu.feature b/features/menu.feature index 601e3e5998..b9c6321124 100644 --- a/features/menu.feature +++ b/features/menu.feature @@ -117,7 +117,7 @@ Feature: Manage WordPress menus When I run `wp menu create "Grandparent Test"` Then STDOUT should not be empty - When I run `wp menu item add-term grandparent-test Grandparent http://example.com/grandparent --porcelain` + When I run `wp menu item add-term grandparent-test gp http://example.com/grandparent --porcelain` Then save STDOUT as {GRANDPARENT_ID} When I run `wp menu item add-term grandparent-test Parent http://example.com/parent --porcelain --parent-id={GRANDPARENT_ID}` From a25186a1624abf8bb669836b1bdc927e2b2bb613 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Sun, 6 Dec 2015 14:24:17 -0500 Subject: [PATCH 12/16] Trying to fix fail on travis --- features/menu.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/features/menu.feature b/features/menu.feature index b9c6321124..cbe282808b 100644 --- a/features/menu.feature +++ b/features/menu.feature @@ -117,13 +117,13 @@ Feature: Manage WordPress menus When I run `wp menu create "Grandparent Test"` Then STDOUT should not be empty - When I run `wp menu item add-term grandparent-test gp http://example.com/grandparent --porcelain` + 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-term grandparent-test Parent http://example.com/parent --porcelain --parent-id={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-term grandparent-test Child http://example.com/child --porcelain --parent-id={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=type,title,position,link,menu_item_parent,db_id` From b659027e1ba6bbd0a1ef354cac598306ea716e1e Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Sun, 6 Dec 2015 14:30:03 -0500 Subject: [PATCH 13/16] behat table cleanup --- features/menu.feature | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/features/menu.feature b/features/menu.feature index cbe282808b..2c19114b87 100644 --- a/features/menu.feature +++ b/features/menu.feature @@ -124,19 +124,19 @@ Feature: Manage WordPress menus 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} + Then save STDOUT as {CHILD_ID} - When I run `wp menu item list grandparent-test --fields=type,title,position,link,menu_item_parent,db_id` + When I run `wp menu item list grandparent-test --fields=title,position,link,menu_item_parent,db_id` Then STDOUT should be a table containing rows: - | type | title | position | link | menu_item_parent | db_id | - | custom | Grandparent | 1 | http://example.com/grandparent | 0 | {GRANDPARENT_ID} | - | custom | Parent | 2 | http://example.com/parent | {GRANDPARENT_ID} | {PARENT_ID} | - | custom | Child | 3 | http://example.com/child | {PARENT_ID} | {CHILD_ID} | + | title | position | link | menu_item_parent | db_id | + | Grandparent | 1 | http://example.com/grandparent | 0 | {GRANDPARENT_ID} | + | Parent | 2 | http://example.com/parent | {GRANDPARENT_ID} | {PARENT_ID} | + | Child | 3 | http://example.com/child | {PARENT_ID} | {CHILD_ID} | When I run `wp menu item delete {PARENT_ID}` When I run `wp menu item list grandparent-test --fields=type,title,position,link,menu_item_parent,db_id` Then STDOUT should be a table containing rows: - | type | title | position | link | menu_item_parent | db_id | - | custom | Grandparent | 1 | http://example.com/grandparent | 0 | {GRANDPARENT_ID} | - | custom | Child | 3 | http://example.com/child | {GRANDPARENT_ID} | {CHILD_ID} | + | title | position | link | menu_item_parent | db_id | + | Grandparent | 1 | http://example.com/grandparent | 0 | {GRANDPARENT_ID} | + | Child | 3 | http://example.com/child | {GRANDPARENT_ID} | {CHILD_ID} | From d97ba6306a823555df4d2246793c9642973c73f9 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Sun, 6 Dec 2015 14:35:10 -0500 Subject: [PATCH 14/16] table cleanup --- features/menu.feature | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/features/menu.feature b/features/menu.feature index 2c19114b87..aa814c1985 100644 --- a/features/menu.feature +++ b/features/menu.feature @@ -126,17 +126,17 @@ Feature: Manage WordPress menus 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,position,link,menu_item_parent,db_id` + When I run `wp menu item list grandparent-test --fields=db_id,menu_item_parent` Then STDOUT should be a table containing rows: - | title | position | link | menu_item_parent | db_id | - | Grandparent | 1 | http://example.com/grandparent | 0 | {GRANDPARENT_ID} | - | Parent | 2 | http://example.com/parent | {GRANDPARENT_ID} | {PARENT_ID} | - | Child | 3 | http://example.com/child | {PARENT_ID} | {CHILD_ID} | + | db_id | menu_item_parent | + | {GRANDPARENT_ID} | 0 | + | {PARENT_ID} | {GRANDPARENT_ID} | + | {CHILD_ID} | {PARENT_ID} | When I run `wp menu item delete {PARENT_ID}` - When I run `wp menu item list grandparent-test --fields=type,title,position,link,menu_item_parent,db_id` + When I run `wp menu item list grandparent-test --fields=db_id,menu_item_parent` Then STDOUT should be a table containing rows: - | title | position | link | menu_item_parent | db_id | - | Grandparent | 1 | http://example.com/grandparent | 0 | {GRANDPARENT_ID} | - | Child | 3 | http://example.com/child | {GRANDPARENT_ID} | {CHILD_ID} | + | db_id | menu_item_parent | + | {GRANDPARENT_ID} | 0 | + | {CHILD_ID} | {GRANDPARENT_ID} | From a7a55d5ac8d1aa7734f7c6a23e30c00e8ca99e74 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Sun, 6 Dec 2015 14:39:45 -0500 Subject: [PATCH 15/16] Behat cleanup --- features/menu.feature | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/features/menu.feature b/features/menu.feature index aa814c1985..f89fb1b309 100644 --- a/features/menu.feature +++ b/features/menu.feature @@ -112,7 +112,7 @@ Feature: Manage WordPress menus 0 """ - Scenario: Preserve grandparent when parent is removed. + 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 @@ -128,15 +128,15 @@ Feature: Manage WordPress menus When I run `wp menu item list grandparent-test --fields=db_id,menu_item_parent` Then STDOUT should be a table containing rows: - | db_id | menu_item_parent | - | {GRANDPARENT_ID} | 0 | - | {PARENT_ID} | {GRANDPARENT_ID} | - | {CHILD_ID} | {PARENT_ID} | + | 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=db_id,menu_item_parent` Then STDOUT should be a table containing rows: - | db_id | menu_item_parent | - | {GRANDPARENT_ID} | 0 | - | {CHILD_ID} | {GRANDPARENT_ID} | + | title | db_id | menu_item_parent | + | Grandparent | {GRANDPARENT_ID} | 0 | + | Child | {CHILD_ID} | {GRANDPARENT_ID} | From 312bec52f4e8e5ee882b98054467aa08526fd1e8 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Sun, 6 Dec 2015 14:43:13 -0500 Subject: [PATCH 16/16] Behat cleanup --- features/menu.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/menu.feature b/features/menu.feature index f89fb1b309..f2b554d6b1 100644 --- a/features/menu.feature +++ b/features/menu.feature @@ -126,7 +126,7 @@ Feature: Manage WordPress menus 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=db_id,menu_item_parent` + 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 | @@ -135,7 +135,7 @@ Feature: Manage WordPress menus When I run `wp menu item delete {PARENT_ID}` - When I run `wp menu item list grandparent-test --fields=db_id,menu_item_parent` + 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 |