Skip to content

Commit

Permalink
Fix unit tests to match new tested method behavior
Browse files Browse the repository at this point in the history
This commit updates two unit tests that were failing
(https://travis-ci.org/woocommerce/woocommerce-rest-api/jobs/637678251#L707),
after the behavior of the method
WC_REST_Shipping_Zones_V2_Controller::register_routes() changed in PR #104.
  • Loading branch information
rodrigoprimo authored and vedanshujain committed May 11, 2020
1 parent f7eab9d commit c792dfb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion unit-tests/Tests/Version2/shipping-zones.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function create_shipping_zone( $name, $order = 0, $locations = array()
public function test_register_routes() {
$routes = $this->server->get_routes();
$this->assertArrayHasKey( '/wc/v2/shipping/zones', $routes );
$this->assertArrayHasKey( '/wc/v2/shipping/zones/(?P<id>[\d-]+)', $routes );
$this->assertArrayHasKey( '/wc/v2/shipping/zones/(?P<id>[\d]+)', $routes );
$this->assertArrayHasKey( '/wc/v2/shipping/zones/(?P<id>[\d]+)/locations', $routes );
$this->assertArrayHasKey( '/wc/v2/shipping/zones/(?P<zone_id>[\d]+)/methods', $routes );
$this->assertArrayHasKey( '/wc/v2/shipping/zones/(?P<zone_id>[\d]+)/methods/(?P<instance_id>[\d]+)', $routes );
Expand Down
2 changes: 1 addition & 1 deletion unit-tests/Tests/Version3/shipping-zones.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected function create_shipping_zone( $name, $order = 0, $locations = array()
public function test_register_routes() {
$routes = $this->server->get_routes();
$this->assertArrayHasKey( '/wc/v3/shipping/zones', $routes );
$this->assertArrayHasKey( '/wc/v3/shipping/zones/(?P<id>[\d-]+)', $routes );
$this->assertArrayHasKey( '/wc/v3/shipping/zones/(?P<id>[\d]+)', $routes );
$this->assertArrayHasKey( '/wc/v3/shipping/zones/(?P<id>[\d]+)/locations', $routes );
$this->assertArrayHasKey( '/wc/v3/shipping/zones/(?P<zone_id>[\d]+)/methods', $routes );
$this->assertArrayHasKey( '/wc/v3/shipping/zones/(?P<zone_id>[\d]+)/methods/(?P<instance_id>[\d]+)', $routes );
Expand Down

0 comments on commit c792dfb

Please sign in to comment.