public function testGenerate()
 {
     $resourceMock = $this->prophesize('Dunglas\\ApiBundle\\Api\\ResourceInterface');
     $resourceMock->getShortName()->willReturn('Foo')->shouldBeCalledTimes(1);
     $generator = new FolderGenerator();
     $folder = $generator->generate($resourceMock->reveal());
     $this->assertRegExp('/([A-z\\d]{8})-([A-z\\d]{4})-([A-z\\d]{4})-([A-z\\d]{4})-([A-z\\d]{12})/', $folder->getId());
     $this->assertEquals('Foo', $folder->getName());
 }
 /**
  * {@inheritdoc}
  *
  * @return Collection
  */
 public function generate(ResourceInterface $resource = null)
 {
     $collection = new Collection();
     $collection->setId((string) Uuid::uuid4());
     $collection->setName($this->name);
     $collection->setDescription($this->description);
     $collection->setPublic($this->public);
     foreach ($this->resourceCollection as $resource) {
         $folder = $this->folderGenerator->generate($resource);
         $folder->setRequests($this->requestGenerator->generate($resource));
         $collection->addFolder($folder);
     }
     return $collection;
 }