Skip to content

Commit

Permalink
#758: fix code style in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Westfeld committed Jun 30, 2019
1 parent 0c08e24 commit 2f766b1
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,32 +64,32 @@ public function testGetCartTotalsWithTaxApplied()
self::assertEquals('USD', $appliedTaxesResponse[0]['amount']['currency']);
}

/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/GraphQl/Tax/_files/tax_rule_for_region_1.php
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/apply_tax_for_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
*/
public function testGetCartTotalsWithEmptyCart()
{
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId);
$response = $this->graphQlQuery($query, [], '', $this->getHeaderMap());

self::assertArrayHasKey('prices', $response['cart']);
$pricesResponse = $response['cart']['prices'];
self::assertEquals(0, $pricesResponse['grand_total']['value']);
self::assertEquals(0, $pricesResponse['subtotal_including_tax']['value']);
self::assertEquals(0, $pricesResponse['subtotal_excluding_tax']['value']);
self::assertEquals(0, $pricesResponse['subtotal_with_discount_excluding_tax']['value']);

$appliedTaxesResponse = $pricesResponse['applied_taxes'];

self::assertCount(0, $appliedTaxesResponse);
}
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/GraphQl/Tax/_files/tax_rule_for_region_1.php
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/apply_tax_for_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
*/
public function testGetCartTotalsWithEmptyCart()
{
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId);
$response = $this->graphQlQuery($query, [], '', $this->getHeaderMap());

self::assertArrayHasKey('prices', $response['cart']);
$pricesResponse = $response['cart']['prices'];
self::assertEquals(0, $pricesResponse['grand_total']['value']);
self::assertEquals(0, $pricesResponse['subtotal_including_tax']['value']);
self::assertEquals(0, $pricesResponse['subtotal_excluding_tax']['value']);
self::assertEquals(0, $pricesResponse['subtotal_with_discount_excluding_tax']['value']);

$appliedTaxesResponse = $pricesResponse['applied_taxes'];

self::assertCount(0, $appliedTaxesResponse);
}

/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,31 +59,31 @@ public function testGetCartTotalsWithTaxApplied()
self::assertEquals('USD', $appliedTaxesResponse[0]['amount']['currency']);
}

/**
* @magentoApiDataFixture Magento/GraphQl/Tax/_files/tax_rule_for_region_1.php
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/apply_tax_for_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
*/
public function testGetCartTotalsWithEmptyCart()
{
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId);
$response = $this->graphQlQuery($query);

self::assertArrayHasKey('prices', $response['cart']);
$pricesResponse = $response['cart']['prices'];
self::assertEquals(0, $pricesResponse['grand_total']['value']);
self::assertEquals(0, $pricesResponse['subtotal_including_tax']['value']);
self::assertEquals(0, $pricesResponse['subtotal_excluding_tax']['value']);
self::assertEquals(0, $pricesResponse['subtotal_with_discount_excluding_tax']['value']);

$appliedTaxesResponse = $pricesResponse['applied_taxes'];

self::assertCount(0, $appliedTaxesResponse);
}
/**
* @magentoApiDataFixture Magento/GraphQl/Tax/_files/tax_rule_for_region_1.php
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/apply_tax_for_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
*/
public function testGetCartTotalsWithEmptyCart()
{
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId);
$response = $this->graphQlQuery($query);

self::assertArrayHasKey('prices', $response['cart']);
$pricesResponse = $response['cart']['prices'];
self::assertEquals(0, $pricesResponse['grand_total']['value']);
self::assertEquals(0, $pricesResponse['subtotal_including_tax']['value']);
self::assertEquals(0, $pricesResponse['subtotal_excluding_tax']['value']);
self::assertEquals(0, $pricesResponse['subtotal_with_discount_excluding_tax']['value']);

$appliedTaxesResponse = $pricesResponse['applied_taxes'];

self::assertCount(0, $appliedTaxesResponse);
}

/**
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
Expand Down

0 comments on commit 2f766b1

Please sign in to comment.