function it_can_extract_content(NodeInterface $child, BlockInterface $parent) { $parent->getCurrentContent()->willReturn('__opening__Hello__closing__'); $child->getExtractionContent()->willReturn('Hello'); $child->getExtractionId()->willReturn('__content__'); $parent->setCurrentContent('__opening____content____closing__')->shouldBeCalled(); $this->extractContent($child, $parent); }
/** * Extract content */ public function extractContent(NodeInterface $child, NodeInterface $parent) { $content = preg_replace($this->search($child->getExtractionContent()), $child->getExtractionId(), $parent->getCurrentContent(), self::LIMIT); $parent->setCurrentContent($content); }