Do a CURL request for the page, parse it with Dom\Query and select all
anchors from that page. That would be the css3-like format. e.g.: "a".
Afterwards, you filter each anchor by selecting only those who have "href"
set to your page. If there is any, you got your backlink!

Here is a implementation for it:
https://github.com/blanchonvincent/zf2/blob/master/library/Zend/Test/PHPUnit/Controller/AbstractHttpControllerTestCase.php#L298-340

Here is a simple use of it:
public function testHomeUriShouldDisplayA404ErrorMessage()
        {
                $this->dispatch('/');
                $found = false;
                foreach($this->queryDOM('*') as $node)
                        if(strpos($node->nodeValue, "404") !== false)
                                $found = true;
                $this->assertTrue($found, "A 404 message couldn't be found in 
Application
module");
        }



--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/How-to-Validate-Backlink-tp4659841p4659862.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to