Beispiel #1
0
 /**
  * @Given /^the venue "([^"]*)"$/
  */
 public function createVenue($venue_name)
 {
     $venue = new Venue();
     $venue->setName($venue_name)->setShortName($venue_name);
     $em = $this->getEntityManager();
     $em->persist($venue);
     $em->flush();
     return $venue;
 }
Beispiel #2
0
 public function testNotVenueOwner()
 {
     $show = new Show();
     $venue = new Venue();
     $venue->setName('Test Venue');
     $show->setVenue($venue);
     $this->aclProvider->expects($this->atLeastOnce())->method('isOwner')->with($this->user, $venue)->will($this->returnValue(false));
     $this->assertEquals(ShowVoter::ACCESS_DENIED, $this->voter->vote($this->token, $show, array('EDIT')));
     $this->assertEquals(ShowVoter::ACCESS_DENIED, $this->voter->vote($this->token, $show, array('APPROVE')));
 }
Beispiel #3
0
 public function testCreateEventFromPerformance_VenueObject()
 {
     $performance = $this->getPerformance();
     $venue = new Venue();
     $venue->setName('Test Venue');
     $venue->setSlug('test-venue');
     $performance->setVenue($venue);
     $this->router->expects($this->exactly(2))->method('generate')->will($this->returnValueMap(array(array('get_show', array('identifier' => 'test-show'), UrlGeneratorInterface::ABSOLUTE_PATH, '/shows/test-show'), array('get_venue', array('identifier' => 'test-venue'), UrlGeneratorInterface::ABSOLUTE_PATH, '/venues/test-venue'))));
     list($event) = $this->diaryHelper->createEventsFromPerformance($performance);
     $this->assertEquals('Test Show', $event->getName());
     $this->assertEquals(new \DateTime('2013-02-10'), $event->getStartDate());
     $this->assertEquals(new \DateTime('2013-02-15'), $event->getEndDate());
     $this->assertEquals(new \DateTime('19:45'), $event->getStartTime());
     $this->assertEquals('/shows/test-show', $event->getLink());
     $this->assertEquals('/venues/test-venue', $event->getVenueLink());
 }
Beispiel #4
0
 /**
  * Get venue_name
  *
  * @return string
  */
 public function getVenueName()
 {
     if ($this->venue) {
         return $this->venue->getName();
     } elseif ($this->other_venue) {
         return $this->other_venue;
     }
 }
Beispiel #5
0
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     $file = __DIR__ . '/../../Resources/data/venues.yml';
     $data = Yaml::parse(file_get_contents($file));
     foreach ($data as $item) {
         $venue = new Venue();
         $venue->setName($item['name']);
         $venue->setShortName('');
         $venue->setDescription($item['description']);
         $venue->setLatitude($item['latitude']);
         $venue->setLongitude($item['longitude']);
         $manager->persist($venue);
     }
     $manager->flush();
 }