/**
  * @covers ::clearCachedDefinitions
  */
 public function testClearCachedDefinitionsWithCachedDecoratedDiscovery()
 {
     $this->decoratedDiscovery = $this->getMockForAbstractClass(PluginDiscoveryDecoratorTestCachedDiscovery::class);
     $this->sut = new PluginDiscoveryDecorator($this->decoratedDiscovery);
     $this->decoratedDiscovery->expects($this->once())->method('clearCachedDefinitions');
     $this->decoratedDiscovery->expects($this->exactly(2))->method('getDefinitions')->willReturn([]);
     // There are no cached definitions yet.
     $this->sut->getDefinitions();
     // This should return the cached definitions.
     $this->sut->getDefinitions();
     $this->sut->clearCachedDefinitions();
     // This should return newly built definitions.
     $this->sut->getDefinitions();
 }