示例#1
0
 public function testHasTagForNonEmptyTags()
 {
     $name = 'tag';
     $value = 'value';
     $difference = new Difference('message');
     $difference->addTag($name, $value);
     self::assertTrue($difference->hasTag($name));
     self::assertEquals($value, $difference->getTag($name));
 }
示例#2
0
 /**
  * @param Difference $difference
  */
 private function getDisplayName(Difference $difference)
 {
     if ($difference->hasTag(Difference::CONSTANT_NAME)) {
         return $difference->getTag(Difference::CONSTANT_NAME);
     }
     if ($difference->hasTag(Difference::MEMBER_NAME)) {
         return '$' . $difference->getTag(Difference::MEMBER_NAME);
     }
     if ($difference->hasTag(Difference::METHOD_NAME)) {
         return $difference->getTag(Difference::METHOD_NAME) . '()';
     }
 }