public function testNavigationHistoryItemEntity()
 {
     $user = new User();
     $user->setEmail('*****@*****.**');
     $values = array('title' => 'Some Title', 'url' => 'Some Url', 'user' => $user);
     $item = new NavigationHistoryItem($values);
     $this->assertEquals($values['title'], $item->getTitle());
     $this->assertEquals($values['url'], $item->getUrl());
     $this->assertEquals($values['user'], $item->getUser());
     $dateTime = new \DateTime();
     $item->setVisitedAt($dateTime);
     $this->assertEquals($dateTime, $item->getVisitedAt());
     $visitCount = rand(0, 100);
     $item->setVisitCount($visitCount);
     $this->assertEquals($visitCount, $item->getVisitCount());
     $this->assertEquals(null, $item->getId());
 }
 public function testNavigationHistoryItemEntity()
 {
     $organization = new Organization();
     $user = new User();
     $user->setEmail('*****@*****.**');
     $values = array('title' => 'Some Title', 'url' => 'Some Url', 'user' => $user, 'organization' => $organization, 'route' => 'test_route', 'routeParameters' => array('key' => 'value'), 'entityId' => 1);
     $item = new NavigationHistoryItem($values);
     $this->assertEquals($values['title'], $item->getTitle());
     $this->assertEquals($values['url'], $item->getUrl());
     $this->assertEquals($values['user'], $item->getUser());
     $this->assertEquals($values['organization'], $item->getOrganization());
     $this->assertEquals($values['route'], $item->getRoute());
     $this->assertEquals($values['routeParameters'], $item->getRouteParameters());
     $this->assertEquals($values['entityId'], $item->getEntityId());
     $dateTime = new \DateTime();
     $item->setVisitedAt($dateTime);
     $this->assertEquals($dateTime, $item->getVisitedAt());
     $visitCount = rand(0, 100);
     $item->setVisitCount($visitCount);
     $this->assertEquals($visitCount, $item->getVisitCount());
     $this->assertEquals(null, $item->getId());
 }
 /**
  * {@inheritDoc}
  */
 public function getUser()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getUser', array());
     return parent::getUser();
 }