/** * @expectedException \Team3\PayU\PropertyExtractor\ExtractorException */ public function testThrowingExceptionWhenWrongMethodReturned() { $reader = $this->getMock(self::READER_INTERFACE); $reader->expects($this->any())->method('read')->willReturn([new ReaderResult('wrongMethod', self::ANNOTATION_PROPERTY_NAME)]); $extractor = new Extractor($reader, $this->getLogger()); $extractor->extract(new \stdClass()); }
/** * @param OrderInterface $order * @param UserOrderModelWithPrivateMethods $userOrder */ protected function copyAllValues(OrderInterface $order, UserOrderModelWithPrivateMethods $userOrder) { foreach ($this->extractor->extract($userOrder) as $extractedResult) { if ($this->shippingMethodCollectionTransformer->supports($extractedResult->getPropertyName())) { $this->shippingMethodCollectionTransformer->transform($order, $extractedResult); } } }
/** * @param OrderInterface $order * @param BuyerModelWithPrivateMethods $buyer */ private function copyAllValues(OrderInterface $order, BuyerModelWithPrivateMethods $buyer) { $results = $this->extractor->extract($buyer); /** @var ExtractorResult $result */ foreach ($results as $result) { if ($this->buyerTransformer->supports($result->getPropertyName())) { $this->buyerTransformer->transform($order, $result); } } }