You are here

public function CommerceMigrateTestCase::testProduct in Commerce Migrate 7

Tests integrity of a product.

Parameters

string $sku: Product SKU.

1 call to CommerceMigrateTestCase::testProduct()
CommerceMigrateTestCase::testRollback in tests/commerce_migrate_tests.test
Tests of removing imported data.

File

tests/commerce_migrate_tests.test, line 86
Tests of "Commerce Migrate".

Class

CommerceMigrateTestCase
Class CommerceMigrateTestCase.

Code

public function testProduct($sku = '64671631') {
  $product = $this
    ->getProduct($sku);
  $raw_product = $this
    ->getProductsCsvItem($sku);
  $this
    ->assertIdentical($raw_product->title, $product->title
    ->value(), 'Product title is correct.');
  $this
    ->assertEqual(commerce_currency_decimal_to_amount($raw_product->price, $raw_product->currency_code), $product->commerce_price->amount
    ->value(), 'Product amount is correct.');
  $this
    ->assertIdentical($raw_product->currency_code, $product->commerce_price->currency_code
    ->value(), 'Product currency code is correct.');
}