getValue() public method

public getValue ( ) : string
return string
コード例 #1
0
 /**
  * Gets all the fixture IDs suitable for the given value.
  *
  * @param FixtureMatchReferenceValue $value
  * @param ResolvedFixtureSet         $fixtureSet
  *
  * @return string[]
  */
 private function getSuitableIds(FixtureMatchReferenceValue $value, ResolvedFixtureSet $fixtureSet) : array
 {
     if (array_key_exists($pattern = $value->getValue(), $this->idsByPattern)) {
         return $this->idsByPattern[$pattern];
     }
     $fixtureKeys = array_flip(preg_grep($pattern, array_keys($fixtureSet->getFixtures()->toArray())));
     $objectKeys = array_flip(preg_grep($pattern, array_keys($fixtureSet->getObjects()->toArray())));
     $this->idsByPattern[$pattern] = array_keys($fixtureKeys + $objectKeys);
     return $this->idsByPattern[$pattern];
 }
コード例 #2
0
 /**
  * Gets all the fixture IDs suitable for the given value.
  *
  * @param FixtureMatchReferenceValue $value
  * @param ResolvedFixtureSet         $fixtureSet
  * @param GenerationContext          $context
  *
  * @return string[]
  */
 private function getSuitableIds(FixtureMatchReferenceValue $value, ResolvedFixtureSet $fixtureSet, GenerationContext $context) : array
 {
     $pattern = $value->getValue();
     try {
         $cache = $context->getCachedValue(self::IDS_BY_PATTERN_CACHE_KEY);
     } catch (CachedValueNotFound $exception) {
         $cache = [];
     }
     if (array_key_exists($pattern, $cache)) {
         return $cache[$pattern];
     }
     $suitableIds = $this->findSuitableIds($pattern, $fixtureSet);
     $cache[$pattern] = $suitableIds;
     $context->cacheValue(self::IDS_BY_PATTERN_CACHE_KEY, $cache);
     return $suitableIds;
 }
コード例 #3
0
 public function testReadAccessorsReturnPropertiesValues()
 {
     $regex = '/dummy/';
     $value = new FixtureMatchReferenceValue($regex);
     $this->assertEquals($regex, $value->getValue());
 }