123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- <?php
- namespace PhpCsFixer\Tests\Test;
- use PhpCsFixer\RuleSet;
- final class IntegrationCase
- {
-
- private $config;
-
- private $expectedCode;
-
- private $fileName;
-
- private $inputCode;
-
- private $requirements;
-
- private $ruleset;
-
- private $settings;
-
- private $title;
-
- public function __construct(
- $fileName,
- $title,
- array $settings,
- array $requirements,
- array $config,
- RuleSet $ruleset,
- $expectedCode,
- $inputCode
- ) {
- $this->fileName = $fileName;
- $this->title = $title;
- $this->settings = $settings;
- $this->requirements = $requirements;
- $this->config = $config;
- $this->ruleset = $ruleset;
- $this->expectedCode = $expectedCode;
- $this->inputCode = $inputCode;
- }
- public function hasInputCode()
- {
- return null !== $this->inputCode;
- }
- public function getConfig()
- {
- return $this->config;
- }
- public function getExpectedCode()
- {
- return $this->expectedCode;
- }
- public function getFileName()
- {
- return $this->fileName;
- }
- public function getInputCode()
- {
- return $this->inputCode;
- }
-
- public function getRequirement($name)
- {
- if (!is_string($name)) {
- throw new \InvalidArgumentException(sprintf(
- 'Requirement key must be a string, got "%s".',
- is_object($name) ? get_class($name) : gettype($name).'#'.$name
- ));
- }
- if (!array_key_exists($name, $this->requirements)) {
- throw new \InvalidArgumentException(sprintf(
- 'Unknown requirement key "%s", expected any of "%s".',
- $name,
- implode('","', array_keys($this->requirements))
- ));
- }
- return $this->requirements[$name];
- }
- public function getRequirements()
- {
- return $this->requirements;
- }
- public function getRuleset()
- {
- return $this->ruleset;
- }
- public function getSettings()
- {
- return $this->settings;
- }
- public function getTitle()
- {
- return $this->title;
- }
- }
|