Commit Graph

12 Commits

Author SHA1 Message Date
Claudio Sanches 162c5dd8a2 Updated tests for wc_query_string_form_fields() 2019-08-01 17:30:39 -03:00
Gerhard Potgieter d2c7d8c86e
Merge pull request #23535 from woocommerce/fix/23518
Fix: parameter values should be converted back as well when building form fields
2019-05-10 10:43:28 +02:00
Rodrigo Primo 18ee70918b Fix PHPCS violations in tests/ using PHPCBF
This commit fixes all 1533 PHPCS errors that PHPCBF can fix automatically in the tests/ directory. Before this change there was a total of 3106 PHPCS errors in the WooCommerce repository and now there is 1573 errors.
2019-05-01 19:05:00 -03:00
Rodrigo Primo 45c2c78ea2 Fix: parameter values should be converted back as well when building form fields
PR #23196 added a workaround to `parse_str()` limitation when dealing with full-stops, pluses, and spaces in the parameter key. This workaround involved temporarily replacing those three characters with placeholders before calling `parse_str()` and then replacing back to the original form. This commit fixes a bug in this logic that was replacing back only parameters keys and not parameters values.

For example, if the query string is `?query.parameter=foo.bar`, the resulting <input> field contained `foo{dot}bar`, instead of the expected `foo.bar`.
2019-04-26 13:58:27 -03:00
Rodrigo Primo e21430703c Remove redundant calls to var_export() in test_wc_query_string_form_fields()
It is not necessary to use the $message parameter of assertEquals() to output the value of $actual_html, as PHPUnit already output this variable value in case of error.
2019-04-26 11:49:30 -03:00
Mike Jolley 7feae340f2 Add tests 2019-04-03 11:58:15 +01:00
Mike Jolley 4b485eba13 Fixed unit tests 2019-02-06 21:00:07 +00:00
Rodrigo Primo 2854f8654b Add two unit tests for wc_dropdown_variation_attribute_options()
Those two tests covers only the basic functionality of this function.
2018-10-15 12:20:31 -03:00
Gerhard Potgieter 8aba169654 Switch travis codecoverage from xdebug to phpdbg (#20857)
This commit changes the travis codecoverage from using xdebug to phpdbg, phpdbg seems much faster and gives similar results.

Reason for switching is we have been running into constant timeouts on our codecoverage due to the 50min job limit on travis, which means our codecoverage has not been updated in a couple of months.

* Remove xdebug as it slows tests down, switch to using phpdbg for code coverage.

* Update parameters for phpdbg

* It is qrr not qqr

* Include vendor/bin path when using phpdbg

* Use PHP 7.1 to run phpdbg

* Update phpunit dire

* Include $HOME in phpdbg call to phpunit

* Set no memory limit to avoid out of memory errors.

* Assign timeout group to test_request_url test for paypal and do not execute that on coverage as it causes a memeory timeout. Test needs optimization to run for code coverage.

* @covers usage for methods should be prefixed with ::
2018-07-20 09:34:43 -03:00
Claudio Sanches f18220a009 Updated unit tests 2018-04-17 12:31:14 -03:00
Claudio Sanches 53b000cb87 Remove product after unit test 2018-04-06 14:49:20 -03:00
Claudio Sanches a10689ce40 Added unit tests for wc_get_product_class() 2018-04-06 14:47:18 -03:00