Commit Graph

225 Commits

Author SHA1 Message Date
Claudio Sanches ea36caf17e Removed MaxMind from System Status 2020-01-15 20:26:12 -03:00
Rodrigo Primo e325eafc9a Remove image after unit tests to make sure they pass on Travis
The test
WC_Tests_API_Functions::test_wc_rest_upload_image_from_url_should_download_image_and_return_array()
was failing on Travis with the error below due images being kept on
accros different tests. To fix this problem, this commit makes sure that
every test that creates an image, removes it after the assertions.

```
1) WC_Tests_API_Functions::test_wc_rest_upload_image_from_url_should_download_image_and_return_array

Failed asserting that two arrays are equal.

--- Expected
+++ Actual

@@ @@

 Array (
-    'file' => '/tmp/wordpress/wp-content/uploads/2020/01/Dr1Bczxq4q.png'
-    'url' => 'http://example.org/wp-content/uploads/2020/01/Dr1Bczxq4q.png'
+    'file' => '/tmp/wordpress/wp-content/uploads/2020/01/Dr1Bczxq4q-3.png'
+    'url' => 'http://example.org/wp-content/uploads/2020/01/Dr1Bczxq4q-3.png'

/home/travis/build/woocommerce/woocommerce-rest-api/unit-tests/Tests/Version3/functions.php:113
```

(https://travis-ci.org/woocommerce/woocommerce-rest-api/jobs/634921426#L719)
2020-01-15 20:25:02 -03:00
Rodrigo Primo 10f55dbff4 Fix unit test suite in the Travis build jobs
This commit fixes a problem in the script that configures the
environment to run the unit tests in the Travis build jobs. The script
was not running `composer install` in the WooCommerce directory, leaving
it installation incomplete and thus the tests were failing.

To fix this problem, this commit adds a call to `composer install` right
after WooCommerce is downloaded in the setup script
(`unit-tests/bin/install.sh`).
2020-01-15 20:22:29 -03:00
Claudio Sanches 4ea0e73909 Fixed logic and removed old variable 2020-01-15 20:21:25 -03:00
Claudio Sanches c55b49194b Fixed coding standards 2020-01-15 20:21:25 -03:00
Claudio Sanches d133875e5d Keep backwards compatibility 2020-01-15 20:21:25 -03:00
Claudio Sanches 06ec2fd9c6 Set correct type 2020-01-15 20:21:25 -03:00
Claudio Sanches 19b7e278ac Fixed schema 2020-01-15 20:21:25 -03:00
Claudio Sanches 7eded142c7 Remove extra loop 2020-01-15 20:21:25 -03:00
Rodrigo Primo 64f09329dd Add unit test to test filtering by field when getting system status 2020-01-15 20:21:25 -03:00
Rodrigo Primo 0cfbc27a27 Simplify and speedup WC_Tests_REST_System_Status tests
This implements two changes to WC_Tests_REST_System_Status test class:

- It simplifies the tests by setting the user in the setUp method
instead of in each test.
- Improves the performance of the tests by creating a new admin user
only once when the class is instantiated instead of once for every
single test that is executed.
2020-01-15 20:21:25 -03:00
Claudio Sanches bc0acf60b8 Improved logic to only try remote requests if necessary 2020-01-15 20:21:25 -03:00
Claudio Sanches 4342ae2b6f Prevent wp_remote_post or wp_remote_get to trigger when not necessary 2020-01-15 20:21:25 -03:00
Claudio Sanches b4125269a3 Updated WC_REST_Controller::get_fields_for_response() 2020-01-15 20:21:25 -03:00
Claudio Sanches 361326d7f0 Fixed type numeric type on products and variations schema 2020-01-15 20:18:20 -03:00
Claudio Sanches b8763fd3e4 Added unit tests for instance_id 2020-01-15 20:17:36 -03:00
Claudio Sanches ae9948edef Allow set instance_id for Order's shipping_lines 2020-01-15 20:17:19 -03:00
Claudio Sanches d139b35344 Test the correct orders endpoint 2020-01-15 20:16:11 -03:00
Claudio Sanches 3be425631f Version 1.0.5 2019-12-18 19:20:59 -03:00
Christopher Allford 0704f6d023 Added support for filtering products and variations by their menu_order 2019-12-18 19:20:12 -03:00
Claudio Sanches 5a509591e7 Fixed unit tests 2019-12-18 19:20:00 -03:00
Claudio Sanches 3e0e9fee77 Included tests for v3 2019-12-18 19:20:00 -03:00
Claudio Sanches b0da8ca633 Included unit tests 2019-12-18 19:20:00 -03:00
Claudio Sanches 218f1b1edb Fixed prepare_line_items for v1 2019-12-18 19:20:00 -03:00
Claudio Sanches 48fb4433ac Allow edit line items without passing an product ID again 2019-12-18 19:20:00 -03:00
Claudio Sanches 28e046c33e Make product_id non mandatory while updating a line_item in orders endpoint 2019-12-18 19:20:00 -03:00
Csaba Maulis 1d5e1715d6 Fix Products Controller images property type 2019-12-18 19:19:45 -03:00
Claudio Sanches 8d2eb27637 Version 1.0.4 2019-12-05 22:44:20 -03:00
Claudio Sanches 066719a585 Fixed unit tests and updated sniffs 2019-12-05 22:42:43 -03:00
Claudio Sanches ff7cd27886 Fixed unit tests 2019-12-05 22:29:02 -03:00
Claudio Sanches 3e4274acbe Fixed coding standards 2019-12-05 22:29:02 -03:00
Nikhil Chaudhary 8b7b919cca Update class-wc-rest-system-status-v2-controller.php
Added the total post count that is need on the Woocommerce System Status tab.
2019-12-05 22:29:02 -03:00
Mike Jolley 7d8f8163b6 filter empty objects from results before loop 2019-12-05 22:12:21 -03:00
Rodrigo Primo 59a3bc7525 Use WP_UnitTestCase::assertWPError() instead of WC_Unit_Test_Case::assertIsWPError()
See https://github.com/woocommerce/woocommerce/pull/24207
2019-12-05 22:06:54 -03:00
Claudio Sanches 613502e57d Fixed WooCommerce 3.9 support 2019-12-05 22:03:03 -03:00
Claudio Sanches 0b1c1dd422 Fixed date_created and date_created_gmt for customers v2 2019-12-05 22:02:07 -03:00
Claudio Sanches 7d9babf1c2 Fix: check if DB_NAME is defined before using it
Port of https://github.com/woocommerce/woocommerce-rest-api/pull/3 for v2 and v3
2019-07-16 11:27:40 -03:00
Mike Jolley 1b3ea5eef1 Version 2019-07-10 11:11:48 +01:00
Mike Jolley 5170d9f296 Update tests 2019-07-10 11:10:50 +01:00
Claudio Sanches 83da0a2283 Reflect new changes from https://github.com/woocommerce/woocommerce/pull/23093 2019-07-10 11:07:16 +01:00
Claudio Sanches 72c5a6687d Fixed PHP notices when DB receives "ENGINE" instead of "engine" 2019-07-08 15:02:29 -03:00
Mike Jolley 1d0bd12a46 Moved hook like in master v3 2019-06-26 15:29:11 +01:00
Mike Jolley 4ba989a07e Changes from master 2019-06-26 15:27:45 +01:00
Mike Jolley 53fccbbf7d Fix paths 2019-06-25 16:20:26 +01:00
Mike Jolley 370d6c1a04 remove v4 for 1.0 release 2019-06-25 16:18:35 +01:00
Mike Jolley 8b82b84013 Autoload version 2019-06-25 16:17:22 +01:00
Mike Jolley 48b9ff0695 Versions 2019-06-25 16:16:58 +01:00
Mike Jolley a6db14ba38 Update test paths 2019-06-25 16:12:47 +01:00
Mike Jolley 09ef1e74cf Rename tests dir 2019-06-24 16:17:02 +01:00
Mike Jolley a703749a46 Fixed tests 2019-06-24 16:06:26 +01:00