How to write testable classes in WordPress

WordPress is far from having a standard conventions for unit testing extensions. Or for extension structure in general.

At current time you should either:

  • research how unit testing framework of your choice recommends to work with globals and such for PHP code in general
  • look into WordPress-specific tools for unit testing that start to appear, such as WP_Mock

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)