public function testGetCanonical() { $canonical = $this->link->getCanonical(); $this->assertInstanceOf('\\Cekurte\\WebScrapingBundle\\Selector\\SelectorInterface', $canonical); $this->assertEquals('link[rel="canonical"]', $canonical->getSelectorKey()); $this->assertEquals(SelectorBuilder::NODE_ATTR, $canonical->getSelectorType()); $this->assertEquals('href', $canonical->getSelectorAttr()); }
/** * @inheritdoc */ public function getCanonical() { return SelectorResolver::create()->resolve($this->crawler, $this->selector->getCanonical())->getSingleResult(); }