The tag has no usage guidance.

learn more… | top users | synonyms

5
votes
1answer
74 views

Unit tests - Dealing with dependencies

This might be seen as a corollary of Testing hooks callback. The issue: I want to test a class which creates a new instance of a My_Notice class defined outside the plugin (let's call it the "Main ...
7
votes
1answer
50 views

Writing test cases for a WordPress Plugin that has translations

What is my aim? I'm looking forward to write test cases for the available translations of a WordPress plugin. My approach: I have setup WordPress using VVV and my testing suite includes PHPUnit and ...
0
votes
1answer
12 views

Best way to move a site to a subfolder for testing purposes?

I have to make several changes to a website, and I'm willing to setup a copy of the current one on a subdirectory, on the same server. I.E. if my site is www.example.com, what I'm trying to do is to ...
-2
votes
0answers
18 views

A/B testing ads in a sidebar

I am new to WordPress. Could someone tell me how I can a/b test ads on blog posts on my personal blog site? Basically I have 1 ad space on the sidebar of my blog. I want to run Google ads and also ...
1
vote
1answer
306 views

How to add an image for unit testing?

I have to test the function where it calls wp_get_attachment_image_src. How do I add an image for testing, because right now if I call this method it returns false.
0
votes
1answer
20 views

Unable to find PHPUnit code coverage stats

Where should I check for the code coverage stats when using PHPUnit for WordPress? My WordPress setup: I have setup WordPress using VVV and my testing suite includes PHPUnit and WP-CLI. How I ...
0
votes
1answer
17 views

How to automate post update website check?

I maintain clients' Wordpress websites (~25 installations) as a part of my job. To do this quickly and efficiently I use Jetpack's "Manage" feature. In case something went wrong I have fully automated ...
1
vote
1answer
40 views

How to test drive WordPress on VPS with LEMP stack before going live?

I have example.com up and running on a VPS droplet running Ubuntu 16.04. The website was built with WordPress on LEMP stack (Linux EngineX MySql and PHP) which was done using EeasyEngine. EasyEngine ...
5
votes
1answer
73 views

Proper unit testing in WordPress

There are different threads available for Unit Testing in WordPress. As far as concern, there should be a proper unit testing for every piece of customization done in WordPress. I have checked couple ...
1
vote
3answers
2k views

Duplicate a Wordpress Install for Testing Purposes

I want to test some plugins on my Wordpress site. However, I do not want to mess anything up. Is there a way to duplicate my Wordpress site to a new directory so that I can test plugins there before I ...
1
vote
0answers
41 views

Can I check plugins and themes for PHP 5.6 ahead of global PHP server Update

My server is updating to PHP 5.6 next week. I manage about 30 WordPress websites. I looked for a plugin that would check if any of the code throughout the other plugins and theme would break with the ...
1
vote
0answers
14 views

Is there a way to mock update_option for unit testing?

I'm currently building some unit tests, and have just started playing around with WP_Mock. I'd like to test a function that fetches the site description; I want to test if it responds as expected when ...
8
votes
3answers
308 views

Vagrant script to setup all the common PHP / WordPress version combinations

I am looking for a way to quickly and repeatedly set up testing / debugging environment for our plugin, most probably using Vagrant. Projects like VVV focus on a single-environment setup (or, a couple ...
0
votes
1answer
51 views

A/B test options at the widget level [closed]

I am looking for a method to show 1 of 3 different widgets on my site's homepage. I could do this with javascript, but this would increase page weight and I would rather do it at time of render (...
1
vote
1answer
135 views

Unit testing in the WordPress backend (is_admin() is true)

I've asked this on IRC, Twitter, Slack — am utterly astonished by how difficult it is to locate the answer to this: I have a bunch of plugin code that only runs when is_admin() returns true, i.e., ...
0
votes
0answers
164 views

WP Unit tests error: WP_UnitTestCase not found

I installed PHPUnit, checked out the WordPress tests repository and set up the tests configuration. But when I try to run the unit tests on my test files (e.g: phpunit test-test.php), I get the ...
1
vote
0answers
72 views

How to run subversion and staging environments when running Wordpress

I come from a .NET world with custom solutions, where I am used to multiple staging environments and subversion for everything. I've been googling a lot, and have some questions on how handle highend ...
5
votes
2answers
7k views

Show different theme for admin?

I'd like to test some theme changes on my live site, but I obviously don't want regular users seeing any errors that may arise from it. I'd like to just duplicate my theme folder and if I'm logged in ...
0
votes
0answers
166 views

How to use Wordpress methods (themes, plugins, context) with Behat?

My Wordpress project is running with a composer inside my plugin folder, just to test Behat a little bit, i'm not using Bedrock Wordpress yet. I can run Behat to do some behavior tests using the ...
0
votes
1answer
179 views

pingbacks testing

I have a few questions regarding functionality testing of PBs in a new wp installation (3.0.4): Are pingbacks sent immediately when a post is published, or are they scheduled as a cron job? If the ...
0
votes
1answer
40 views

How to properly maintain a testing version of a site?

At my place of work we host many sites that almost all run Wordpress. Some of them are changed quite frequently, and emply e-commerce solutions such as WooCommerce. Consequently, these sites also use ...
1
vote
4answers
929 views

Load testing for WordPress functionality

Does anyone know of (or have) any scripts / processes they use for testing performance under load - especially of WordPress specific behaviours, like posting many comments nearly simultaneously, while ...
2
votes
1answer
31 views

Is there a way to activate different theme for specified users? [closed]

I'm looking to allow beta testing of a theme on WordPress site in production. I was thinking of a plugin to check if WordPress user has been selected for beta phase, and if this evaluates to true ...
0
votes
1answer
107 views

Duplicate WordPress site to subdirectory but use same db?

I have tried to just copy the whole root folder into a subdirectory. I understand the .htaccess file has to be changed. But can't get it to work right. Is it something more than changing the htaccess ...
0
votes
1answer
27 views

Available methods for a/b testing the content

I've been looking around for split testing solutions for wordpress and most answers point to the now-outdated shrimptest plugin. I'm not really interested in using a plugin anyway, unless I write it ...
2
votes
1answer
590 views

PHP logging framework to be used with WordPress

There are different PHP logging frameworks out there e.g. Log4php, KLogger. I want to choose one based on its experience with WordPress. Please suggest me one.
16
votes
1answer
2k views

Testing hooks callback

I'm developing a plugin using TDD and one thing that i completely fail to test are... hooks. I mean OK, i can test hook callback, but how could I test if a hook actually trigger (both custom hooks ...
1
vote
1answer
305 views

How to initialize something in unit test before the init hook being called?

I've a simple PHP Unit written for WordPress and want the initialize code before the main 'init' action being called from the plugin I want to test, e.g. class MyPlugin_Test_Example extends ...
1
vote
1answer
345 views

Activate different theme for temporary preview

I wanted that when i access my site with specific parameter, my site used a different theme at that moment (only temporarily, to show only to me as a preview). I want it for test purposes. Is there ...
0
votes
0answers
28 views

Unit Test ignores stubbed method second time around in a dataProvider

I am writing a sample unit test that checks a title of a post for a token and if it exists add the post to a category. https://gist.github.com/matstars/bebedbacedd7a85d8dc7 In my test for this I am ...
2
votes
1answer
355 views

How to properly test a method that is called by an action hook

The constructor in my class adds an action to the 'init' action hook: class My_Custom_Post_Type { function __construct( $type ) { $this->type = $type; add_action( 'init', ...
0
votes
0answers
23 views

What is a good way to test that plugin upgrades have completed properly?

I'm working to automate plugin upgrades across all my WordPress installs. Part of that process is making sure the plugins upgraded correctly, didn't introduce errors and don't cause new conflicts with ...
1
vote
0answers
86 views

How to split test a menu item

I have four links in my main navigation menu, which is displayed on every page of my site. Link 1 | Link 2 | Link 3 | Link 4 I have a form that once completed is a goal/conversion and redirects to a ...
10
votes
1answer
494 views

Developing, Testing and Releasing

How do you develop, test and deploy-to-live your Wordpress sites? Its always a bit of a faff I find, especially where databases are concerned - mainly due to the fact that having a testing site needs ...
1
vote
0answers
45 views

WordPress Automatic Testing Probelm

After much trial and error. I've managed to get the automatic testing setup and running. I'm running a test on a plugin that has no code. It's just the plugin header. Just to make sure everything is ...
2
votes
1answer
2k views

How can I debug my database connection for unit testing?

I've set up a wordpress environment on my Mac with MAMP and I'm running 3.5.1 locally (i.e. http://localhost:8888/blog works). I'm trying to run the unit test suit from wordpress.org and having ...
3
votes
1answer
1k views

PHPUnit testing WordPress Plugin

Using answers on this site and from other resources, I have started writing my next plugin using PHPUnit tests and the WordPress test environment. Distilling down what I have in my plugin's bootstrap....
13
votes
3answers
1k views

Unit testing for plugin development

I need to apply unit testing for one of my plugins. I recently re designed it into classes, so unit testing should be easier to apply now. What are some effective strategies to unit test my plugin? I ...
0
votes
1answer
69 views

How do you create a development site into a subdirectory of the live site?

I have a WordPress site at http://example.com and I want to create a clone development site at http://example.com/test. I want http://example.com/test to be its own root URL as well as the live one ...
3
votes
1answer
423 views

Can I get at WordPress code from inside a Selenium test?

I'm writing unit tests using PHPUnit and WP_UnitTestCase, and using Selenium for front-end testing. My Selenium test classes merrily click around my pages without trouble. What would be truly useful, ...
0
votes
1answer
34 views

Change post date for testing purposes

Is there a way I can change a post date to preferably a different month and a year for testing purposes?
4
votes
4answers
265 views

Is there an A/B testing plugin that lets you vary the heading, featured image, and content in a Wordpress post?

If not, are there alternate solutions that can let me accomplish this? Do I need to develop my own plugin?
1
vote
1answer
1k views

Theme Check gives: Required: This theme doesn't seem to display tags?

I am testing my theme with Theme Check plugin and it shows this message: Required: This theme doesn't seem to display tags? Picture: How can i fix this?
0
votes
2answers
780 views

Publishing Wordpress from stage to production server

I'm having trouble configuring wp-config.php correctly in a staged server environment. I'm being told that I should be working in my stage environment for Wordpress with an example address of http://...
3
votes
1answer
1k views

Why Can't PHPUnit UnitTest My Wordpress Website

I have been researching this issue for days and although many people ask this question I never found a clear and concise answer. I am running: PHP Unit: Version 3.7.21 WordPress: Version 3.5.1 OS: ...
0
votes
1answer
77 views

can I run the test suite without a web server?

I'm trying to set up a Test Driven Development environment and I was wondering if it's possible to run the WordPress test suite without a web server. I'm on a mac (10.7.5) and I've set up phpunit and ...
4
votes
1answer
1k views

Tutorials for Unit-Testing in WordPress and for unit-test.svn.wordpress.org?

I'm starting to learn Selenium and PHPUnit and I am interested in implementing what I've learned in my WordPress projects. I've seen http://unit-test.svn.wordpress.org and wonder if there are any ...
3
votes
1answer
676 views

WP_UnitTestCase missing?

I was looking at tests for wordpress and some, if not all the classes have WP_UnitTestCase but I cannot find the class, why do I care? I have downloaded The most up to date version of this from github ...
7
votes
2answers
3k views

PHP unit testing WordPress?

Given how WordPress is written and how it interacts with a database and given how its not very much OOP oriented, is there a way to unit test a theme? is there a way unit test a framework (not a theme ...
5
votes
1answer
886 views

Programmatically create blogs with dummy content on a WPMU site

I'm trying to set up a WPMU test environment with 5-6K blogs, lots of posts comments, users etc. Browsing trough the WP's functions, I picked up wp_insert_post, wp_insert_comment, create_empty_blog(),...