Esempio n. 1
0
 /**
  * @test
  */
 public function deleteVersionDelegates()
 {
     $resource = Resource::create();
     $version = Version::get('lusso');
     $this->adapter->expects($this->once())->method('deleteVersion')->with($resource, $version)->will($this->returnValue('lus'));
     $this->adapter->expects($this->once())->method('versionExists')->with($resource, $version)->will($this->returnValue(true));
     $this->cache->expects($this->once())->method('deleteVersion')->with($resource, $version);
     $this->assertEquals('lus', $this->storage->deleteVersion($resource, $version));
 }
Esempio n. 2
0
 /**
  * Deletes storable versions
  *
  * @param File $file
  */
 public function deleteProvidedVersions(Versionable $versionable)
 {
     $versions = $this->getProvidedVersions();
     foreach ($versions as $version) {
         $version = Version::get($version);
         $versionable->removeVersion($version);
         if ($this->storage->versionExists($versionable, $version)) {
             $this->storage->deleteVersion($versionable, $version);
         }
     }
     $event = new VersionProviderEvent($this, $versionable, $versions);
     $this->eventDispatcher->dispatch(Events::VERSIONS_UNPROVIDED, $event);
 }