Пример #1
0
 private function performRuntime($traitName, $entity)
 {
     $config = $this->basicTraitAssertions[$traitName];
     if (true !== array_key_exists('namespace', $config)) {
         $this->reflectionAnalyser->setRequireFQN(false);
     }
     static::assertTrue($this->reflectionAnalyser->hasTrait($traitName));
     foreach ($config['props'] as $property) {
         static::assertTrue($this->reflectionAnalyser->hasProperty($property));
     }
     foreach ($config['methods'] as $method) {
         static::assertTrue($this->reflectionAnalyser->hasMethod($method), 'Should have method ' . $method);
     }
     foreach ($config['op'] as $operation) {
         $this->{$operation}($traitName, $entity, $config);
     }
 }