skip to Main Content

I have a windows system and wanted to test a wordpress plugin that is already existing.

i follwed this link and installed cygwin to run the bash command.

https://www.smashingmagazine.com/2017/12/automated-testing-wordpress-plugins-phpunit/

qa-test is the plugin name

when I ran the bash command in cmd prompt like below

C:xampphtdocsmywebsite-wordpresswordpresswp-contentpluginsqa-test>bash bin/install-wp-tests.sh wordpress_test root '' localhost latest
+ install_wp
+ '[' -d /tmp/wordpress/ ']'
+ mkdir -p /tmp/wordpress/
+ [[ latest == nightly ]]
+ [[ latest == trunk ]]
+ '[' latest == latest ']'
+ local ARCHIVE_NAME=latest
+ download https://wordpress.org/latest.tar.gz /tmp/wordpress.tar.gz
++ which curl
+ '[' /cygdrive/c/Windows/system32/curl ']'
+ curl -s https://wordpress.org/latest.tar.gz
+ tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C /tmp/wordpress/
tar.exe: Error opening archive: Failed to open '/tmp/wordpress.tar.gz'

it says the above error message. don’t know if it is a permission error or something. please direct me on how to fix this error. thanks!

2

Answers


  1. Chosen as BEST ANSWER

    Maybe I didn't specific with my question, hence didn't get any reply from experts.

    I have a wordpress plugin that name is qa-test. I am trying to do automated testing on that plugin.

    I ran the command

    wp scaffold plugin-tests qa-test

    that generated test files successfully.

    Now, I need to run the below command

    bin/install-wp-tests.sh wordpress_test root '' localhost latest

    inorder to stat the phpunit. Since I have that windows system and not ubuntu

    I have installed cygwin software and started running the

    bin/install-wp-tests.sh wordpress_test root '' localhost latest

    in command prompt. it says "Error opening archive: Failed to open '/tmp/wordpress.tar.gz'"

    wh is that. if you need some additional info , please let me know what details are you looking for. thanks for your time helping on this :)


  2. After I have installed wget.exe, which resolved the problem and ran the

    bin/install-wp-tests.sh wordpress_test root ” localhost latest

    without any error.

    so right now at this point the bin/install-wp-tests.sh got created.

    in the command prompt, when I run

    phpunit it says

    Could not find C:UserspriAppDataLocalTemp/wordpress-tests-lib/includes/functions.php, have you run bin/install-wp-tests.sh?

    I am not sure why is the slashes half of them with / and other half with . where can I go and correct this issue to rectify this error, please

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search