Tag Info

Hot answers tagged

12

There is a bit of personal philosophy that goes into a deployment workflow. It's not an easy question to answer outright without knowing your experience with servers and version control, your operating system, hosting, client's experience and tech culture, etc... Here's a similar question that has a lot of explanation. For content deployment, you can ...


11

As an ex-software engineer building large business types who landed in an interactive agency let me give you a few thoughts on testing when developing for Wordpress: Your Unit Testing should test the smallest amount of behavior that a class can perform. Each class should be able to be tested independently of Wordpress. If you have a Wordpress dependency ...


8

Resources on how to use the WordPress unit-test: WordPress Automated Tests Trac Automated Testing in The Codex The Unit-Test README File The PHPUnit Manual Hakre/WP Unit-Tests Codex Page


8

PHPUnit would come to mind, if the WP test suite wasn't so broken, and if WP had been designed and written in a way that it could actually be tested properly. ;-) More seriously, you can test your plugins all you want from their functional standpoint with unit tests and the like. The issue is that these tests won't guarantee that they'll catch subtle ...


7

I've not actually done it myself, but there is a testing environment for WordPress unit testing. It's meant for core testing, but it could be adapted to test plugins. More info here: http://codex.wordpress.org/Automated_Testing http://svn.automattic.com/wordpress-tests/


6

I just wrote this quick plugin and it seems to work. Let me know if there is a better way. <? /* Plugin Name: Theme Switch if Admin Description: Display different theme to user if logged in as admin Author: Kyle Barber */ add_filter('template', 'change_theme'); add_filter('option_template', 'change_theme'); add_filter('option_stylesheet', ...


5

You should strongly consider Selenium. It allows you to record actions (e.g. entering data into a form, clicking a link) and then you can perform assertions. It also integrates with PHPUnit. I highly recommend checking out the two minute demo.


5

I would suggest you take a look at WP Dummy Content. You can easily extend this plugin or build a script to activate and run it. As suggested by @kaiser I would really record all the performance data I can to get in insights into this scale of operations.


5

You can use ShrimpTest for this. Basically, you need to reverse the test idea. You're making three separate posts, one of which will be displayed on the front page. That means that two others will not be displayed on the front page. So you're doing an exclusion. Say your three posts have id's of 101, 102, and 103. You'd set up a test and use the manual PHP ...


4

Usually a plugin developed in WordPress version will run fine on several newer versions. What you need to care about is 'deprecated` features/apis in WordPress. Any API in WordPress is not removed overnight, rather it remains deprecated for several versions. You will get such a list here: http://codex.wordpress.org/Category:Deprecated_Functions When you ...


3

Unit tests for WordPress are a tricky thing. If you need to test the code with a live database, etc. I would suggest using the official WordPress test suite. I've gotten unit tests running for a plugin using that method before, but it wasn't pretty, and was fairly unreliable. If you need to do it that way, though, I personally wouldn't think of doing it with ...


3

There is nothing stopping you from writing your own unit testing for themes/plugins using PHPUnit or some other testing platform. As for WordPress, it has an official Unit Tests here: http://unit-tests.svn.wordpress.org/trunk/ https://github.com/kurtpayne/wordpress-unit-tests (github mirror) There are several build scripts that can automate unit ...


3

$user_id = $this->_make_user('author', 'user_login_name', 'password', 'test@test.com'); wp_set_current_user( $user_id ); as long as the class that you define the testcase in inherits from WPTestCase, then you can use the _make_user function. The function is found in this svn repository, and is defined in wp-testlib/base.php line 380. NEW: I switched ...


3

You should include /wp-load.php, that will load all of WordPress' functions, etc.


3

This isn't really a WordPress question - more a generic web development issue. These are some open source tools that can be used for scripting and testing a web browser session. Selenium Cucumber Watir


3

The reason the WordPress test bootstrap is loaded at the end is precisely because it loads WordPress: // Load WordPress require_once ABSPATH . '/wp-settings.php'; If you don't hook your function to load your plugin to 'muplugins_loaded' before including the bootstrap, your plugin won't be loaded with WordPress. In most cases that will mean that your ...


2

You can do this from the dashboard, enter the post and on the right hand side you can edit the published date.


2

The Premise plugin from Copyblogger integrates with Google Optimizer and lets you create multiple versions of landing pages. It also contains some templates and lots of copy writing advice.


2

ShrimpTest is a simple and easy way to add AB testing all over a site: http://wordpress.org/extend/plugins/shrimptest/


2

I sometimes use this plugin http://wordpress.org/extend/plugins/duplicator/ it works pretty well if your server enviroment meets it's requirements. Otherwise, it's the good ole, mysql dump route that the other guys explained.


2

I usually do this for just code (no HTML): add_action('template_redirect', 'test'); function test() { // code goes here die; } For dealing with HTML I prefer blank theme, set up for testing. If you want to test in context of existing theme create custom page template, add/remove elements according to your needs and assign to test page.


2

Upgrade to latest MU version first. If you run into problems with that, report your feedback and the bugs you encounter to the MU Project. Then Upgrade to WordPress 3.0. If you run into any problems with that step, report it to the WP Project. Update: As far as you're concerned for a quick test (not a mass test), you can do the test locally on a ...


2

I really found this presentation from WCSF to be extremely helpful. http://wordpress.tv/2011/08/20/nikolay-bachiyski-unit-testing-will-change-your-life/


2

Your htaccess file seems to be a little off. I would suggest the first part of the file should look like the following... <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /testsite/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /testsite/index.php [L] </IfModule> And that you store it in the ...


2

I don't think you need to worry about these things! WP Upgrades rarely change any function definitions, and if they do, WP_DEBUG = true will bring it to your notice. Just develop with WP_DEBUG set to true, and if a function is deprecated after a WP upgrade, replace it with its newer equivalent and release your plugin with a newer version. Well that's just ...


2

I wrote the Travis-CI powered PHPunit testing library for Jigoshop and Easy Digital Downloads both of which are Ecommerce WP plugins developed on Github. The library employed could be easily converted to work for themes. The nice thing about the Travis-CI powered suite is that we can use it to quickly test multiple PHP and WP versions. If you're theme is a ...


2

Your easiest solution here is to keep everything in your cms folder. and follow this step found at http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory This will keep all wordpress related files in the cms folder, but it will look like its running from the root, copy of index and some .htaccess wizardly as you call it :). enjoy Using a ...


1

You need to be using one of these functions to display a list of tags associated with the post: the_tags() get_the_tag_list() get_the_term_list() Otherwise the check will fail. If you're building this theme for use with a project that doesn't need tags, don't bother adding support. If you're indenting to upload it to WordPress.org for review, then you ...


1

This class is defined in includes/testcase.php. If you checkout the entire repo, you should have it. To check out the entire repo, you should be running something along the lines of: svn co https://unit-tests.svn.wordpress.org/trunk wordpress-tests



Only top voted, non community-wiki answers of a minimum length are eligible