woocommerce/tests/framework
Rodrigo Primo 5a5a2bc1fb Make unit tests work again with PHP 5.2
This commit fixes WC PHPUnit tests in PHP 5.2 that have been broken since commit e68084d7b8 (diff-b43983ff635e47e2ec510ae07726f0b4R30) was merged. The mentioned commit added a new method to WC_Unit_Test_Case that uses late static binding. The problem is that late static binding is available only since PHP 5.3 and WooCommerce still support PHP 5.2. Running WC tests with PHP 5.2 resulted in the following error:

Parse error: syntax error, unexpected T_STATIC, expecting T_STRING or T_VARIABLE or '$' in /home/travis/build/woocommerce/woocommerce/tests/framework/class-wc-unit-test-case.php on line 40 (see https://travis-ci.org/woocommerce/woocommerce/jobs/350303315#L281)

For now, I'm simply removing the method that used late static binding (WC_Unit_Test_Case::include_dependencies()) and manually loading the required dependencies in the two test classes that relied on it. I'm happy to add WC_Unit_Test_Case::include_dependencies() again if someone can find a way to make it compatible with PHP 5.2. If not, we can revisit this once WC drops support for PHP 5.2.
2018-03-12 16:19:47 -03:00
..
helpers Rename class WC_Payment_Token_eCheck to WC_Payment_Token_ECheck 2018-03-07 14:50:21 -03:00
vendor Remote spy-server 2016-07-26 13:57:30 -07:00
class-wc-api-unit-test-case.php Unit test warnings 2017-01-03 12:19:03 +00:00
class-wc-dummy-data-store.php Changed version 2.7 to 3.0 2017-03-15 13:36:53 -03:00
class-wc-mock-session-handler.php Removed period for file headers 2015-11-03 11:53:50 -02:00
class-wc-mock-wc-data.php Better handling of nested arrays in apply_changes 2017-03-08 11:51:38 -08:00
class-wc-mock-wc-object-query.php WC_Object_Query 2017-04-24 11:33:17 -07:00
class-wc-payment-token-stub.php WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd 2016-08-27 08:57:05 +03:00
class-wc-rest-unit-test-case.php Changed version 2.7 to 3.0 2017-03-15 13:36:53 -03:00
class-wc-unit-test-case.php Make unit tests work again with PHP 5.2 2018-03-12 16:19:47 -03:00
class-wc-unit-test-factory.php Removed legacy webhook unit tests 2017-08-17 12:07:15 -03:00