/**
  * @param \Dvs\UUIDGenerator\Interfaces\UUIDGenerator $uuidGenerator
  * @param \Dvs\FileBundle\Storage\Resource\Storageable           $storageable
  */
 public function it_should_return_generated_name_if_it_possible($uuidGenerator, $storageable)
 {
     //given
     $uuidGenerator->generateUnique()->willReturn($generatedName = 'name');
     //then
     $this->generate($storageable)->shouldReturn($generatedName);
 }
 /**
  * @param Storageable $storageable
  * @return string
  */
 public function generate(Storageable $storageable) : string
 {
     try {
         return $this->uuidGenerator->generateUnique();
     } catch (UUIDGeneratorException $e) {
         throw NameGenerationException::notGenerated();
     }
 }
 /**
  * @param string     $name
  * @param string     $directory
  * @param bool|false $isUrl
  *
  * @return string
  */
 public function createUUIDirsFromName($name, $directory, $isUrl = false)
 {
     $uuid = $isUrl ? $this->UUIDGenerator->generateFromUrl($name) : $this->UUIDGenerator->generateFromString($name);
     return $this->createDirs($uuid, $directory) . DIRECTORY_SEPARATOR . $uuid;
 }