Skip to content

Move Сarrier Сodes validation to service layer #131 #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 27, 2017

Conversation

larsroettig
Copy link
Member

Description

  • Move Сarrier Сodes validation to service layer
  • Impelment API test cases for it

larsroettig added 2 commits October 24, 2017 10:25
- Move Сarrier Сodes validation to service layer
- Add New intigration Test
$errors[] = __('You can\'t configure "%field" because you have chosen Global Shipping configuration.', [
'field' => SourceInterface::CARRIER_LINKS
]);
}

$availableCarriers = $this->shippingConfig->getAllCarriers();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we should refactor this logic
Becuase if $carrierLinks is not array then we do not need to perform foreach

try {
$this->_webApiCall($serviceInfo, ['source' => $expectedData]);
} catch (\Exception $e) {
self::assertEquals(\Magento\Framework\Webapi\Exception::HTTP_BAD_REQUEST, $e->getCode());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, need to check all conditions (all error messages)

*/
private $shippingConfig;

/**
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed docktype for $shippingConfig

self::assertEquals(\Magento\Framework\Webapi\Exception::HTTP_BAD_REQUEST, $e->getCode());
}
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, need to fix the other api-functional builds
We do not run api-functional builds on Travis, so we need to run them on local machine
And now we have broken tests

larsroettig added 2 commits October 27, 2017 11:37
- Refactoring for validate function
- Add expectedErrorData to api test
- Fix API Test
@naydav naydav merged commit 1fab7e3 into develop Oct 27, 2017
@maghamed maghamed deleted the move-carrier-codes-validation branch December 11, 2018 18:15
magento-devops-reposync-svc pushed a commit that referenced this pull request Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants