* @since 2.0.11 */ class DependencyTest extends TestCase { public function testResetReusableData(): void { $value = ['dummy']; $dependency = new MockDependency(); $this->setInaccessibleProperty($dependency, '_reusableData', $value, false); $this->assertEquals($value, $this->getInaccessibleProperty($dependency, '_reusableData')); $dependency->resetReusableData(); $this->assertEquals([], $this->getInaccessibleProperty($dependency, '_reusableData')); } public function testGenerateReusableHash(): void { $dependency = $this->getMockForAbstractClass(Dependency::class); $dependency->data = 'dummy'; $result = $this->invokeMethod($dependency, 'generateReusableHash'); $this->assertEquals(5, strlen($dependency->data)); $this->assertEquals(40, strlen((string) $result)); } public function testIsChanged(): void { $dependency = $this->getMockForAbstractClass(Dependency::class); $cache = $this->getMockForAbstractClass(Cache::class); $result = $dependency->isChanged($cache); $this->assertFalse($result); $dependency->data = 'changed'; $result = $dependency->isChanged($cache); $this->assertTrue($result); } }