$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>php - Wordpress and Wordpress-test-lib not getting added to tmp folder|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

php - Wordpress and Wordpress-test-lib not getting added to tmp folder

matteradmin8PV0评论

I’ve installed the wpcli and php unit testing to my imac and the wordpress and wordpress-test-lib files were added to my tmp folder as they should have. I used this to install the setup.

bash bin/install-wp-tests.sh wordpress_test root <mypassword> localhost latest

I wanted to reinstall everything to make sure I had the process down so I could show others. However, after deleting the files from the tmp folder and reinstalling using the terminal command bash bin/install-wp-tests.sh wordpress_test root <mypassword> localhost latest wordpress and wordpress-test-lib folders are getting added to my /var/folders/xq/zdm3rwn.... folder, but the wp-latest.php file is installing in the tmp directory correctly.

How can I correct this problem with the other folders not being placed in the tmp directory or is there another work around I'm missing? Or is this not a problem and I just need to adjust another file to point to the right directory now.

Here is the return info from terminal after running the install...

  • install_wp
  • '[' -d /var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress/ ']'
  • return
  • install_test_suite ++ uname -s
  • [[ Darwin == \D\a\r\w\i\n ]]
  • local ioption=-i.bak
  • '[' '!' -d /var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress-tests-lib ']'
  • '[' '!' -f wp-tests-config.php ']'
  • download .0.3/wp-tests-config-sample.php /var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress-tests-lib/wp-tests-config.php ++ which curl
  • '[' /usr/bin/curl ']'
  • curl -s .0.3/wp-tests-config-sample.php ++ echo /var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress/ ++ sed 's:/+$::'
  • WP_CORE_DIR=/var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress/
  • sed -i.bak 's:dirname( FILE ) . '\''/src/'\'':'\''/var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress//'\'':' /var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress-tests-lib/wp-tests-config.php
  • sed -i.bak s/youremptytestdbnamehere/wordpress_test/ /var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress-tests-lib/wp-tests-config.php
  • sed -i.bak s/yourusernamehere/root/ /var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress-tests-lib/wp-tests-config.php
  • sed -i.bak s/yourpasswordhere/mypassword/ /var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress-tests-lib/wp-tests-config.php
  • sed -i.bak 's|localhost|localhost|' /var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress-tests-lib/wp-tests-config.php
  • install_db
  • '[' false = true ']'
  • PARTS=(${DB_HOST//:/ })
  • local PARTS
  • local DB_HOSTNAME=localhost
  • local DB_SOCK_OR_PORT=
  • local EXTRA=
  • '[' -z localhost ']' ++ echo ++ grep -e '^[0-9]{1,}$'
  • '[' ']'
  • '[' -z ']'
  • '[' -z localhost ']'
  • EXTRA=' --host=localhost --protocol=tcp'
  • mysqladmin create wordpress_test --user=root --password=mypassword --host=localhost --protocol=tcp mysqladmin: [Warning] Using a password on the command line interface can be insecure.

I’ve installed the wpcli and php unit testing to my imac and the wordpress and wordpress-test-lib files were added to my tmp folder as they should have. I used this to install the setup.

bash bin/install-wp-tests.sh wordpress_test root <mypassword> localhost latest

I wanted to reinstall everything to make sure I had the process down so I could show others. However, after deleting the files from the tmp folder and reinstalling using the terminal command bash bin/install-wp-tests.sh wordpress_test root <mypassword> localhost latest wordpress and wordpress-test-lib folders are getting added to my /var/folders/xq/zdm3rwn.... folder, but the wp-latest.php file is installing in the tmp directory correctly.

How can I correct this problem with the other folders not being placed in the tmp directory or is there another work around I'm missing? Or is this not a problem and I just need to adjust another file to point to the right directory now.

Here is the return info from terminal after running the install...

  • install_wp
  • '[' -d /var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress/ ']'
  • return
  • install_test_suite ++ uname -s
  • [[ Darwin == \D\a\r\w\i\n ]]
  • local ioption=-i.bak
  • '[' '!' -d /var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress-tests-lib ']'
  • '[' '!' -f wp-tests-config.php ']'
  • download https://develop.svn.wordpress/tags/5.0.3/wp-tests-config-sample.php /var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress-tests-lib/wp-tests-config.php ++ which curl
  • '[' /usr/bin/curl ']'
  • curl -s https://develop.svn.wordpress/tags/5.0.3/wp-tests-config-sample.php ++ echo /var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress/ ++ sed 's:/+$::'
  • WP_CORE_DIR=/var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress/
  • sed -i.bak 's:dirname( FILE ) . '\''/src/'\'':'\''/var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress//'\'':' /var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress-tests-lib/wp-tests-config.php
  • sed -i.bak s/youremptytestdbnamehere/wordpress_test/ /var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress-tests-lib/wp-tests-config.php
  • sed -i.bak s/yourusernamehere/root/ /var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress-tests-lib/wp-tests-config.php
  • sed -i.bak s/yourpasswordhere/mypassword/ /var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress-tests-lib/wp-tests-config.php
  • sed -i.bak 's|localhost|localhost|' /var/folders/xq/zdmw3rwn5cn9_b9z05vs355c0000gn/T/wordpress-tests-lib/wp-tests-config.php
  • install_db
  • '[' false = true ']'
  • PARTS=(${DB_HOST//:/ })
  • local PARTS
  • local DB_HOSTNAME=localhost
  • local DB_SOCK_OR_PORT=
  • local EXTRA=
  • '[' -z localhost ']' ++ echo ++ grep -e '^[0-9]{1,}$'
  • '[' ']'
  • '[' -z ']'
  • '[' -z localhost ']'
  • EXTRA=' --host=localhost --protocol=tcp'
  • mysqladmin create wordpress_test --user=root --password=mypassword --host=localhost --protocol=tcp mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Share Improve this question edited Feb 19, 2019 at 18:24 Spencer Labadie asked Feb 19, 2019 at 16:35 Spencer LabadieSpencer Labadie 611 silver badge3 bronze badges 1
  • 1 Can you be more specific about how you're doing this at the moment? – Tom J Nowell Commented Feb 19, 2019 at 17:02
Add a comment  | 

1 Answer 1

Reset to default 0

enter code hereActually come to find out after further testing, these new set of folders, wordpress and wordpress-test-lib, that are now in the new directory /var/folders/xq/zdm3rwn.... do indeed still work properly for the unit testing.

Hope that helps someone else wondering about this same issue. In all the docs for these installs that I have seen they all mention the /tmp/ directory which seems to work the first time you install, but if you delete those file (which after more research I found I should not have done) then on my imac the installs went to this new tmp folder as I mentioned.

Post a comment

comment list (0)

  1. No comments so far