Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Ukena committed Nov 26, 2018
1 parent 183f2c1 commit aad4772
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions spec/Factory/PaymentMethodViewFactorySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ function it_build_payment_method_view(PaymentMethodInterface $paymentMethod, Pay

$paymentMethodTranslation->getName()->willReturn('Cash on delivery');
$paymentMethodTranslation->getDescription()->willReturn('Really nice payment method');
$paymentMethodTranslation->getInstructions()->willReturn('Put the money in this bag, right here!');

$paymentMethodView = new PaymentMethodView();

$paymentMethodView->code = 'COD_CODE';
$paymentMethodView->name = 'Cash on delivery';
$paymentMethodView->description = 'Really nice payment method';
$paymentMethodView->instructions = 'Put the money in this bag, right here!';

$this->create($paymentMethod, 'en_GB')->shouldBeLike($paymentMethodView);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Factory/PaymentMethodViewFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public function create(PaymentMethodInterface $paymentMethod, string $locale): P

$translation = $paymentMethod->getTranslation($locale);

$paymentMethodView->code = $paymentMethod->getCode() ?? '';
$paymentMethodView->name = $translation->getName() ?? '';
$paymentMethodView->description = $translation->getDescription() ?? '';
$paymentMethodView->code = $paymentMethod->getCode() ?? '';
$paymentMethodView->name = $translation->getName() ?? '';
$paymentMethodView->description = $translation->getDescription() ?? '';
$paymentMethodView->instructions = $translation->getInstructions() ?? '';

return $paymentMethodView;
Expand Down

0 comments on commit aad4772

Please sign in to comment.