| Conditions | 1 |
| Total Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public function test(): void |
||
| 10 | { |
||
| 11 | $data1 = new class { |
||
| 12 | public $data = 1; |
||
| 13 | }; |
||
| 14 | |||
| 15 | $data2 = new class { |
||
| 16 | public $data = 2; |
||
| 17 | }; |
||
| 18 | |||
| 19 | $dependency1 = new CallbackDependency(static function () use ($data1) { |
||
| 20 | return $data1->data; |
||
| 21 | }); |
||
| 22 | |||
| 23 | $dependency2 = new CallbackDependency(static function () use ($data2) { |
||
| 24 | return $data2->data; |
||
| 25 | }); |
||
| 26 | |||
| 27 | $anyDependency = new AnyDependency([$dependency1, $dependency2]); |
||
| 28 | $anyDependency->evaluateDependency($this->getCache()); |
||
| 29 | |||
| 30 | $this->assertDependencyNotChanged($anyDependency); |
||
| 31 | |||
| 32 | $data2->data = 42; |
||
| 33 | |||
| 34 | $this->assertDependencyChanged($anyDependency); |
||
| 35 | } |
||
| 37 |