| @@ 45-67 (lines=23) @@ | ||
| 42 | ); |
|
| 43 | } |
|
| 44 | ||
| 45 | private function getProvider(string $identifier): VariableProvider |
|
| 46 | { |
|
| 47 | return new class($identifier) implements VariableProvider { |
|
| 48 | private $identifier; |
|
| 49 | ||
| 50 | public function __construct(string $identifier) |
|
| 51 | { |
|
| 52 | $this->identifier = $identifier; |
|
| 53 | } |
|
| 54 | ||
| 55 | public function getIdentifier(): string |
|
| 56 | { |
|
| 57 | return $this->identifier; |
|
| 58 | } |
|
| 59 | ||
| 60 | public function getTwigVariables(View $view, array $options = []): object |
|
| 61 | { |
|
| 62 | return (object)[ |
|
| 63 | $this->identifier . '_parameter' => $this->identifier . '_value', |
|
| 64 | ]; |
|
| 65 | } |
|
| 66 | }; |
|
| 67 | } |
|
| 68 | ||
| 69 | private function getContentViewMockSubscriber(): ContentViewSubscriber |
|
| 70 | { |
|
| @@ 26-48 (lines=23) @@ | ||
| 23 | ); |
|
| 24 | } |
|
| 25 | ||
| 26 | private function getProvider(string $identifier): VariableProvider |
|
| 27 | { |
|
| 28 | return new class($identifier) implements VariableProvider { |
|
| 29 | private $identifier; |
|
| 30 | ||
| 31 | public function __construct(string $identifier) |
|
| 32 | { |
|
| 33 | $this->identifier = $identifier; |
|
| 34 | } |
|
| 35 | ||
| 36 | public function getIdentifier(): string |
|
| 37 | { |
|
| 38 | return $this->identifier; |
|
| 39 | } |
|
| 40 | ||
| 41 | public function getTwigVariables(View $view, array $options = []): object |
|
| 42 | { |
|
| 43 | return (object)[ |
|
| 44 | $this->identifier . '_parameter' => $this->identifier . '_value', |
|
| 45 | ]; |
|
| 46 | } |
|
| 47 | }; |
|
| 48 | } |
|
| 49 | ||
| 50 | public function testParameterProviderGetter(): void |
|
| 51 | { |
|