public function testRemoveRootAssetMapping()
 {
     $uuid = $this->binding1->getUuid();
     $this->bindingType->load($this->rootPackage);
     $this->binding1->load($this->rootPackage, $this->bindingType);
     $this->discoveryManager->expects($this->at(0))->method('removeRootBindings')->with($this->uuid($uuid));
     $this->manager->removeRootAssetMapping($uuid);
 }
Ejemplo n.º 2
0
 public function testRemoveRootAssetMappingDispatchesEvent()
 {
     $uuid = $this->binding1->getUuid();
     $mapping = new AssetMapping('/path', 'target1', '/css', $uuid);
     $event = new RemoveAssetMappingEvent($mapping);
     $this->bindingType->load($this->rootPackage);
     $this->binding1->load($this->rootPackage, $this->bindingType);
     $this->dispatcher->expects($this->any())->method('hasListeners')->with(PuliEvents::POST_REMOVE_ASSET_MAPPING)->willReturn(true);
     $this->dispatcher->expects($this->once())->method('dispatch')->with(PuliEvents::POST_REMOVE_ASSET_MAPPING, $event);
     $this->discoveryManager->expects($this->once())->method('findRootBindings')->with($this->uuid($uuid))->willReturn(array($this->binding1));
     $this->discoveryManager->expects($this->once())->method('removeRootBindings')->with($this->uuid($uuid));
     $this->manager->removeRootAssetMapping($uuid);
 }