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