From 78bb5877c42270741541c9113c0e1948627e7354 Mon Sep 17 00:00:00 2001 From: Siddharth Thevaril Date: Thu, 12 May 2022 02:00:46 +0530 Subject: [PATCH] add behat test --- features/media-regenerate.feature | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/features/media-regenerate.feature b/features/media-regenerate.feature index 944f0c07..2ff21fa1 100644 --- a/features/media-regenerate.feature +++ b/features/media-regenerate.feature @@ -30,6 +30,23 @@ Feature: Regenerate WordPress attachments And the wp-content/uploads/large-image-1024x768.jpg file should exist And the wp-content/uploads/large-image-2048x1536.jpg file should exist + When I run `wp option update medium_size_w 256` + And I run `wp option update medium_size_h 256` + And I run `wp media regenerate {LARGE_ATTACHMENT_ID} --image_size=medium --skip-delete --only-missing` + And I run `wp post meta get {LARGE_ATTACHMENT_ID} _wp_attachment_metadata` + Then STDOUT should contain: + """ + 'medium' + """ + And STDOUT should contain: + """ + 'large' + """ + And STDOUT should contain: + """ + 'thumbnail' + """ + When I run `wp media import {CACHE_DIR}/canola.jpg --title="My imported medium attachment" --porcelain` Then save STDOUT as {MEDIUM_ATTACHMENT_ID} And the wp-content/uploads/canola.jpg file should exist