/** * @dataProvider processors */ public function testProcessor($path, $data, $processors, $expected) { $processor = new Processor(); foreach ($processors as $callback) { $processor->add($callback); } $this->assertEquals($expected, $processor->process($path, $data)); }
/** * @param Processor $processor */ public function checkout(Processor $processor) { foreach ($this->getItems() as $item) { $processor->add($item->getPrice()); } $payment = $this->isCredit ? $this->factory->getCredit() : $this->factory->getCash(); $processor->pay($payment); }