@@ -736,52 +736,36 @@ Feature: Export content.
736736
737737 Scenario : Export individual post with attachments
738738 Given a WP install
739-
740- When I run `wp plugin install wordpress-importer --activate`
741- Then STDOUT should contain:
742- """
743- Success:
744- """
739+ And I run `wp plugin install wordpress-importer --activate`
740+ And I run `wp site empty --yes`
745741
746742 When I run `wp post generate --count=10`
747743 And I run `wp post list --format=count`
748744 Then STDOUT should be:
749745 """
750- 11
746+ 10
751747 """
752748
753749 When I run `wp post create --post_title='Post with attachment to export' --porcelain`
754750 Then STDOUT should be a number
755751 And save STDOUT as {EXPORT_ATTACHMENT_POST_ID}
756752
757- When I run `wp post create --post_type=attachment --porcelain`
753+ When I run `wp media import 'http://wp-cli.org/behat-data/codeispoetry.png' --post_id={EXPORT_ATTACHMENT_POST_ID} --porcelain`
758754 Then STDOUT should be a number
759755 And save STDOUT as {EXPORT_ATTACHMENT_ID}
760756
761- When I run `wp post update {EXPORT_ATTACHMENT_ID} --post_parent={EXPORT_ATTACHMENT_POST_ID} --porcelain`
762- Then STDOUT should contain:
763- """
764- Success: Updated post {EXPORT_ATTACHMENT_ID}
765- """
766-
767757 When I run `wp post create --post_title='Post with attachment to ignore' --porcelain`
768758 Then STDOUT should be a number
769759 And save STDOUT as {IGNORE_ATTACHMENT_POST_ID}
770760
771- When I run `wp post create --post_type=attachment --porcelain`
761+ When I run `wp media import 'http://wp-cli.org/behat-data/white-150-square.jpg' --post_id={IGNORE_ATTACHMENT_POST_ID} --porcelain`
772762 Then STDOUT should be a number
773763 And save STDOUT as {IGNORE_ATTACHMENT_ID}
774764
775- When I run `wp post update {IGNORE_ATTACHMENT_ID} --post_parent={IGNORE_ATTACHMENT_POST_ID} --porcelain`
776- Then STDOUT should contain:
777- """
778- Success: Updated post {IGNORE_ATTACHMENT_ID}
779- """
780-
781765 When I run `wp post list --post_type=post --format=count`
782766 Then STDOUT should be:
783767 """
784- 13
768+ 12
785769 """
786770
787771 When I run `wp post list --post_type=attachment --format=count`
@@ -804,6 +788,26 @@ Feature: Export content.
804788 """
805789 <wp:post_id>{EXPORT_ATTACHMENT_ID}</wp:post_id>
806790 """
791+ And the {EXPORT_FILE} file should contain:
792+ """
793+ <wp:meta_key>_wp_attachment_metadata</wp:meta_key>
794+ """
795+ And the {EXPORT_FILE} file should contain:
796+ """
797+ codeispoetry.png";s:5:"sizes"
798+ """
799+ And the {EXPORT_FILE} file should contain:
800+ """
801+ <wp:meta_key>_wp_attached_file</wp:meta_key>
802+ """
803+ And the {EXPORT_FILE} file should contain:
804+ """
805+ codeispoetry.png]]></wp:meta_value>
806+ """
807+ And the {EXPORT_FILE} file should not contain:
808+ """
809+ <wp:meta_key>_edit_lock</wp:meta_key>
810+ """
807811 And the {EXPORT_FILE} file should not contain:
808812 """
809813 <wp:post_id>{IGNORE_ATTACHMENT_POST_ID}</wp:post_id>
@@ -812,6 +816,14 @@ Feature: Export content.
812816 """
813817 <wp:post_id>{IGNORE_ATTACHMENT_ID}</wp:post_id>
814818 """
819+ And the {EXPORT_FILE} file should not contain:
820+ """
821+ white-150-square.jpg]]></wp:meta_value>
822+ """
823+ And the {EXPORT_FILE} file should not contain:
824+ """
825+ white-150-square.jpg";s:5:"sizes"
826+ """
815827
816828 Scenario : Export categories, tags and terms
817829 Given a WP install
0 commit comments