File tree Expand file tree Collapse file tree
features/shipping/managing_shipments
Resources/config/suites/ui/shipping
AdminBundle/Resources/views/Order/Show Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ Feature: Shipping a shipment from shipment list
1313 And the customer bought a single "Apple"
1414 And the customer "Donald Duck" addressed it to "Elm street" , "90802" "Duckburg" in the "United States" with identical billing address
1515 And the customer chose "UPS" shipping method with "Cash on Delivery" payment
16- And it is "20-02-2020 10:30:05" now
1716 And I am logged in as an administrator
1817
1918 @ui @email
@@ -33,7 +32,7 @@ Feature: Shipping a shipment from shipment list
3332
3433 @ui
3534 Scenario : Setting date when a shipment has been shipped
36- Given this order has already been shipped
35+ Given it is "20-02-2020 10:30:05" now
3736 When I browse shipments
3837 And I ship the shipment of order "#00000001"
3938 Then I should see the shipment of order "#00000001" as "Shipped"
Original file line number Diff line number Diff line change 4444 <directory name =" src/Sylius/Bundle/PromotionBundle/test" />
4545 <directory name =" src/Sylius/Bundle/PromotionBundle/Tests" />
4646 <directory name =" src/Sylius/Bundle/ReviewBundle/spec" />
47- <directory name =" src/Sylius/Bundle/ShippingBundle/test" />
4847 <directory name =" src/Sylius/Bundle/ShippingBundle/spec" />
48+ <directory name =" src/Sylius/Bundle/ShippingBundle/test" />
4949 <directory name =" src/Sylius/Bundle/ShopBundle/spec" />
5050 <directory name =" src/Sylius/Bundle/TaxationBundle/spec" />
5151 <directory name =" src/Sylius/Bundle/TaxationBundle/test" />
Original file line number Diff line number Diff line change @@ -379,7 +379,7 @@ public function resendShipmentConfirmationEmail(): void
379379
380380 public function getShippedAtDate (): string
381381 {
382- return $ this ->getElement ('shipment_shipping_at_date ' )->getText ();
382+ return $ this ->getElement ('shipment_shipped_at_date ' )->getText ();
383383 }
384384
385385 protected function getDefinedElements (): array
@@ -400,7 +400,7 @@ protected function getDefinedElements(): array
400400 'promotion_total ' => '#promotion-total ' ,
401401 'resend_order_confirmation_email ' => '[data-test-resend-order-confirmation-email] ' ,
402402 'resend_shipment_confirmation_email ' => '[data-test-resend-shipment-confirmation-email] ' ,
403- 'shipment_shipping_at_date ' => '#sylius-shipments .shipped-at-date ' ,
403+ 'shipment_shipped_at_date ' => '#sylius-shipments .shipped-at-date ' ,
404404 'shipments ' => '#sylius-shipments ' ,
405405 'shipping_address ' => '#shipping-address ' ,
406406 'shipping_adjustment_name ' => '#shipping-adjustment-label ' ,
Original file line number Diff line number Diff line change 66 - sylius.behat.context.hook.doctrine_orm
77 - sylius.behat.context.hook.email_spool
88
9- - sylius.behat.context.setup.calendar
109 - sylius.behat.context.transform.address
1110 - sylius.behat.context.transform.channel
1211 - sylius.behat.context.transform.country
@@ -19,14 +18,15 @@ default:
1918 - sylius.behat.context.transform.zone
2019
2120 - sylius.behat.context.setup.admin_security
21+ - sylius.behat.context.setup.calendar
2222 - sylius.behat.context.setup.channel
2323 - sylius.behat.context.setup.geographical
2424 - sylius.behat.context.setup.order
2525 - sylius.behat.context.setup.payment
2626 - sylius.behat.context.setup.product
2727 - sylius.behat.context.setup.shipping
2828 - sylius.behat.context.setup.zone
29-
29+
3030 - sylius.behat.context.ui.channel
3131 - sylius.behat.context.ui.email
3232
Original file line number Diff line number Diff line change @@ -27,11 +27,14 @@ public function __construct(string $projectDirectory)
2727
2828 public function today (): \DateTimeInterface
2929 {
30- /** @var resource $file */
31- $ file = fopen ($ this ->projectDirectory . '/var/temporaryDate.txt ' , 'r ' );
32- $ dateTime = fgets ($ file );
33- fclose ($ file );
30+ if ( file_exists ( $ this -> projectDirectory . ' /var/temporaryDate.txt ' )) {
31+ $ file = fopen ($ this ->projectDirectory . '/var/temporaryDate.txt ' , 'r ' );
32+ $ dateTime = fgets ($ file );
33+ fclose ($ file );
3434
35- return new \DateTimeImmutable ($ dateTime );
35+ return new \DateTimeImmutable ($ dateTime );
36+ }
37+
38+ return new \DateTimeImmutable ();
3639 }
3740}
Original file line number Diff line number Diff line change 1515 <i class =" globe icon" ></i >{{ shipment .method .zone }}
1616 </div >
1717 {% if shipment .shippedAt is not empty %}
18- {{ ' sylius.ui.shipped_at' | trans }}: <span class =" shipped-at-date" >{{ shipment .shippedAt | date (' d-m-Y H:i:s' ) }}</span >
18+ {{ ' sylius.ui.shipped_at' | trans }}: <span class =" shipped-at-date" >{{ shipment .shippedAt | date (' d-m-Y H:i:s' ) }}</span >
1919 {% endif %}
2020 </div >
2121 {% if sm_can(shipment , ' ship' , ' sylius_shipment' ) %}
Original file line number Diff line number Diff line change 1111
1212declare (strict_types=1 );
1313
14- namespace spec \Sylius \Bundle \ShippingBundle \DateAssigner ;
14+ namespace spec \Sylius \Bundle \ShippingBundle \Assigner ;
1515
1616use PhpSpec \ObjectBehavior ;
17- use Prophecy \Argument ;
1817use Sylius \Bundle \ShippingBundle \Assigner \ShippingDateAssignerInterface ;
1918use Sylius \Bundle \ShippingBundle \Provider \DateTimeProvider ;
2019use Sylius \Component \Shipping \Model \ShipmentInterface ;
@@ -31,7 +30,7 @@ function let(DateTimeProvider $calendar): void
3130 $ this ->beConstructedWith ($ calendar );
3231 }
3332
34- function it_assigns_a_shipped_at_date_to_an_shipment (ShipmentInterface $ shipment , DateTimeProvider $ calendar ): void
33+ function it_assigns_a_shipped_at_date_to_a_shipment (ShipmentInterface $ shipment , DateTimeProvider $ calendar ): void
3534 {
3635 $ calendar ->today ()->willReturn (new \DateTime ('20-05-2019 20:20:20 ' ));
3736 $ shipment ->setShippedAt (new \DateTime ('20-05-2019 20:20:20 ' ))->shouldBeCalled ();
Original file line number Diff line number Diff line change 1111
1212declare (strict_types=1 );
1313
14- namespace Sylius \Bundle \ShippingBundle \ spec \Provider ;
14+ namespace spec \ Sylius \Bundle \ShippingBundle \Provider ;
1515
1616use PhpSpec \ObjectBehavior ;
17- use Sylius \Bundle \ShippingBundle \Assigner \ ShippingDateAssignerInterface ;
17+ use Sylius \Bundle \ShippingBundle \Provider \ DateTimeProvider ;
1818
1919final class CalendarSpec extends ObjectBehavior
2020{
2121 function it_implements_a_date_time_provider (): void
2222 {
23- $ this ->shouldImplement (ShippingDateAssignerInterface ::class);
23+ $ this ->shouldImplement (DateTimeProvider ::class);
2424 }
2525
26- function it_provide_a_date (): void
26+ function it_provides_a_date (): void
2727 {
28- $ this ->today ()->shouldReturn ( typeOf ( new \DateTimeImmutable ()) );
28+ $ this ->today ()->shouldBeAnInstanceOf ( \DateTimeImmutable::class );
2929 }
3030}
You can’t perform that action at this time.
0 commit comments