function let(TextSizeCalculatorInterface $calculator) { $calculator->calculateWidth(Argument::any())->willReturn(20); $this->beConstructedWith($calculator); }
/** * @param $text * * @return float */ private function stringWidth($text) { return $this->textSizeCalculator->calculateWidth($text); }