Пример #1
0
 /**
  * @param Difference $difference
  */
 private function populateDifference(Difference $difference)
 {
     $unit = $this->challenger->getUnit();
     $difference->addTag(Difference::UNIT_NAME, $unit->getName());
     $difference->addTag(Difference::UNIT_FAMILY, $unit->getFamily());
     $difference->addTag(Difference::CONSTANT_NAME, $this->challenger->getName());
 }
Пример #2
0
 /**
  * @param Difference $difference
  * @param Method $method
  */
 private function populateDifference(Difference $difference, Method $method)
 {
     $unit = $method->getUnit();
     $difference->addTag(Difference::UNIT_NAME, $unit->getName());
     $difference->addTag(Difference::UNIT_FAMILY, $unit->getFamily());
     $difference->addTag(Difference::METHOD_NAME, $method->getName());
 }
 /**
  * @param Difference $difference
  * @param Constant $constant
  */
 private function populateDifference(Difference $difference, Constant $constant)
 {
     $unit = $constant->getUnit();
     $difference->addTag(Difference::UNIT_NAME, $unit->getName());
     $difference->addTag(Difference::UNIT_FAMILY, $unit->getFamily());
     $difference->addTag(Difference::CONSTANT_NAME, $constant->getName());
 }
Пример #4
0
 /**
  * @param Difference $difference
  * @param Member $member
  */
 private function populateDifference(Difference $difference, Member $member)
 {
     $unit = $member->getUnit();
     $difference->addTag(Difference::UNIT_NAME, $unit->getName());
     $difference->addTag(Difference::UNIT_FAMILY, $unit->getFamily());
     $difference->addTag(Difference::MEMBER_NAME, $member->getName());
 }
Пример #5
0
 /**
  * @param Difference $difference
  */
 private function populateDifference(Difference $difference)
 {
     $method = $this->challenger->getMethod();
     $unit = $method->getUnit();
     $difference->addTag(Difference::UNIT_NAME, $unit->getName());
     $difference->addTag(Difference::UNIT_FAMILY, $unit->getFamily());
     $difference->addTag(Difference::METHOD_NAME, $method->getName());
 }
Пример #6
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));
 }
Пример #7
0
 /**
  * @param Difference $difference
  * @param Unit $unit
  */
 private function populateDifference(Difference $difference, Unit $unit)
 {
     $difference->addTag(Difference::UNIT_NAME, $unit->getName());
     $difference->addTag(Difference::UNIT_FAMILY, $unit->getFamily());
 }
Пример #8
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) . '()';
     }
 }