Exemplo n.º 1
0
 /**
  * @return StylesheetConstraint
  */
 private function getConstraint(StylesheetConstraint $constraint, $tag, array $classes = array())
 {
     foreach ($constraint->getConstraints() as $child) {
         $childClasses = $child->getClasses();
         if ($child->getTag() == $tag && count(array_intersect($childClasses, $classes)) == count($childClasses)) {
             return $child;
         }
     }
     return false;
 }
 private function assertStylesheetConstraintEquals(StylesheetConstraint $expected, StylesheetConstraint $actual)
 {
     $this->assertEquals($expected->getTag(), $actual->getTag());
     $this->assertEquals($expected->getWeight(), $actual->getWeight());
     $this->assertEquals($expected->getAll(), $actual->getAll());
     $this->assertEquals($expected->getClasses(), $actual->getClasses());
     $actualConstraintChildren = $actual->getConstraints();
     foreach ($expected->getConstraints() as $name => $constraint) {
         $this->assertStylesheetConstraintEquals($constraint, $actualConstraintChildren[$name]);
     }
 }