Пример #1
0
 /**
  * Assert against XPath selection; should contain no more than this number of nodes
  *
  * @param  string $path XPath path
  * @param  string $count Maximum number of nodes that should match
  * @param  string $message
  * @return void
  */
 public function assertXpathCountMax($path, $count, $message = '')
 {
     $this->_incrementAssertionCount();
     require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php';
     $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path);
     $constraint->registerXpathNamespaces($this->_xpathNamespaces);
     $content = $this->response->outputBody();
     if (!$constraint->evaluate($content, __FUNCTION__, $count)) {
         $constraint->fail($path, $message);
     }
 }