function its_calculated_value_should_be_an_integer(ShippingSubjectInterface $subject)
 {
     $subject->getShippingVolume()->willReturn(100);
     $this->calculate($subject, ['amount' => 500, 'division' => 2])->shouldBeInteger();
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function calculate(ShippingSubjectInterface $subject, array $configuration)
 {
     return (int) round($configuration['amount'] * ($subject->getShippingVolume() / $configuration['division']));
 }