Fix unit tests to match new tested method behavior

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.
This commit is contained in:
Rodrigo Primo 2020-01-16 14:23:01 -03:00 committed by vedanshujain
parent f7eab9db6e
commit c792dfb192
2 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@ class WC_Tests_API_Shipping_Zones_V2 extends WC_REST_Unit_Test_Case {
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 );

View File

@ -57,7 +57,7 @@ class WC_Tests_API_Shipping_Zones extends WC_REST_Unit_Test_Case {
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 );