/**
  * @test
  * @return null
  */
 public function shouldThrowParseExceptionIfTitleTagNotFound()
 {
     // given
     $html = '
     <body>
         <div id="resultStats">150</div>
         <div id="ires">
         <ul>
         <li class="g">
             <div class="s">
                 <cite>http://some-page.pl</cite>
                 <h3 class="xxxxxxx"><a>some page title</a></h2>
             </div>
         </li>
         </ul>
         </div>
     </body>';
     // expect
     $this->setExpectedException('Pszpiler\\SeoGoogleClient\\Exception\\ParseException', 'Title parsing error');
     // when
     $this->parser->parse($html);
 }
Example #2
0
 /**
  * @param string $keyword
  * @param int    $page
  *
  * @return Result
  */
 private function getResultForOnePage($keyword, $page)
 {
     $url = $this->createUrl($keyword, $page);
     $html = $this->httpClient->getBody($url);
     return $this->parser->parse($html);
 }