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