/** * {@inheritdoc} */ public function add(OverrideInterface $override) { if (null === ($template = $override->getTemplate())) { throw new \InvalidArgumentException('Override needs to have a template defined.'); } if (!array_key_exists($template, $this->overrides)) { $this->overrides[$template] = array(); } $this->overrides[$template][] = $override; }
/** * @Given /^it wraps "([^"]*)" with \'([^\']*)\'$/ */ public function itWrapsWith($selector, $element) { $this->assertOverrideIsDefined(); $this->override->addAction(new Action\Wrap($selector, $element)); }
/** * @param OverrideInterface $override * @param Crawler $template */ private function apply(OverrideInterface $override, Crawler $template) { foreach ($override->getActions() as $action) { $action->apply($template); } }