-
Notifications
You must be signed in to change notification settings - Fork 11
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
OP-319 Added the ability to select package dimensions #28
Merged
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
bb6a56e
OP-319 - Extended shipping export by a parameter parcel_template
tomkalon c74bc5f
OP-319 - Added select parcel template column
tomkalon dc08656
Merge branch 'refs/heads/feature/OP-374' into OP-319
tomkalon fa04c2e
OP-319 - ECS fixes
tomkalon 36bb663
OP-319 - Select parcel template fixes
tomkalon 3cab4af
OP-319 - Added PHPSpec tests
tomkalon dabaaca
OP-319 - Extension of parcel template with courier services
tomkalon 2ec47d1
OP-319 - Added select parcel Behat test
tomkalon a70f537
OP-319 - Shipping-export fixes
tomkalon 160a5a5
OP-319 - installation.md
tomkalon 297dc75
OP-319 - ShippingExportEventListener fix
tomkalon e161c2e
OP-319 - PHPSpec: PHPDoc annotation has been removed
tomkalon 7c1d315
OP-319 - Default parcel template and label type configuration
tomkalon 80cdcfb
OP-319 - Behat feature fixed
tomkalon ebf8ae9
OP-319 - The way the controller is overwritten has been changed
tomkalon 0198a0e
OP-319 - Lexical error has been fixed
tomkalon fe10a65
OP-319 - installation.md and code review fixes
tomkalon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@managing_shipping_export_parcel_template_inpost | ||
Feature: Changing shipping export parcel template | ||
To send a query to the Inpost API with a different shipment template | ||
As an Administrator | ||
I need to be able to choose a parcel template | ||
|
||
Background: | ||
Given the store operates on a single channel in the "United States" named "Web-US" | ||
And I am logged in as an administrator | ||
And the store has "Inpost" shipping method with "$10.00" fee | ||
And there is a registered "inpost" shipping gateway for this shipping method named "INPOST_PL" | ||
And it has "Access token" field set to "123" | ||
And it has "Organization ID" field set to "123" | ||
And it has "Environment" field set to "sandbox" | ||
And it has "service" field set to "inpost_locker_standard" | ||
And the store has a product "Chicken" priced at "$2.00" in "Web-US" channel | ||
And customer "[email protected]" has placed 1 orders on the "Web-US" channel in each buying 5 "Chicken" products | ||
And the customer set the shipping address "Mike Ross" addressed it to "350 5th Ave", "10118" "New York" in the "United States" to orders | ||
And those orders were placed with "Inpost" shipping method | ||
And set product weight to "10" | ||
And set units to the shipment | ||
|
||
@ui | ||
Scenario: Seeing shipments to export | ||
When I go to the shipping export page | ||
Then I should see 1 shipments with "New" state | ||
Then I select parcel template | ||
Then I should see that shipping export parcel template is set |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -28,13 +28,16 @@ final class WebClientSpec extends ObjectBehavior | |||
|
||||
public const LABEL_TYPE = "normal"; | ||||
|
||||
public const PARCEL_TEMPLATE = "medium"; | ||||
|
||||
|
||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||||
public function let( | ||||
ClientInterface $client, | ||||
RequestFactoryInterface $requestFactory, | ||||
StreamFactoryInterface $streamFactory, | ||||
): void | ||||
{ | ||||
$this->beConstructedWith($client, $requestFactory, $streamFactory, self::LABEL_TYPE); | ||||
$this->beConstructedWith($client, $requestFactory, $streamFactory, self::LABEL_TYPE, self::PARCEL_TEMPLATE); | ||||
} | ||||
|
||||
public function it_is_initializable(): void | ||||
|
46 changes: 46 additions & 0 deletions
46
spec/EventListener/SelectParcelTemplateEventListener/SelectParcelTemplateActionSpec.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace spec\BitBag\SyliusInPostPlugin\EventListener\SelectParcelTemplateEventListener; | ||
|
||
use BitBag\SyliusInPostPlugin\Entity\ShippingExportInterface; | ||
use BitBag\SyliusInPostPlugin\EventListener\SelectParcelTemplateEventListener\SelectParcelTemplateAction; | ||
use BitBag\SyliusInPostPlugin\EventListener\SelectParcelTemplateEventListener\SelectParcelTemplateActionInterface; | ||
use BitBag\SyliusShippingExportPlugin\Repository\ShippingExportRepositoryInterface; | ||
use PhpSpec\ObjectBehavior; | ||
use Symfony\Component\HttpFoundation\RequestStack; | ||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; | ||
use Symfony\Component\HttpFoundation\Session\SessionInterface; | ||
use Symfony\Contracts\Translation\TranslatorInterface; | ||
|
||
class SelectParcelTemplateActionSpec extends ObjectBehavior | ||
{ | ||
public function let( | ||
ShippingExportRepositoryInterface $shippingExportRepository, | ||
RequestStack $requestStack, | ||
TranslatorInterface $translator, | ||
): void { | ||
$this->beConstructedWith($shippingExportRepository, $requestStack, $translator); | ||
} | ||
|
||
public function it_is_initializable() | ||
{ | ||
$this->shouldHaveType(SelectParcelTemplateAction::class); | ||
$this->shouldBeAnInstanceOf(SelectParcelTemplateActionInterface::class); | ||
} | ||
|
||
public function it_should_save_shipping_export_changes( | ||
ShippingExportInterface $shippingExport, | ||
ShippingExportRepositoryInterface $shippingExportRepository, | ||
RequestStack $requestStack, | ||
SessionInterface $session, | ||
FlashBagInterface $flashBag | ||
): void { | ||
$shippingExportRepository->add($shippingExport)->shouldBeCalled(); | ||
|
||
$requestStack->getSession()->willReturn($session); | ||
$session->getBag('flashes')->willReturn($flashBag); | ||
|
||
$this->execute($shippingExport); | ||
} | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would extend namespace
BitBag\SyliusShippingExportPlugin\Controller\ShippingExportController
and remove the public methods from the listing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't extend ShippingExportController because it is a final class.