Пример #1
0
 public function testFindUserActiveDashboardEmpty()
 {
     $organization = $this->getMock('Oro\\Bundle\\OrganizationBundle\\Entity\\Organization');
     $user = $this->getMock('Oro\\Bundle\\UserBundle\\Entity\\User');
     $token = $this->getMockBuilder('Oro\\Bundle\\SecurityBundle\\Authentication\\Token\\UsernamePasswordOrganizationToken')->disableOriginalConstructor()->getMock();
     $this->securityContext->expects($this->once())->method('getToken')->will($this->returnValue($token));
     $token->expects($this->once())->method('getOrganizationContext')->will($this->returnValue($organization));
     $this->activeDashboardRepository->expects($this->once())->method('findOneBy')->with(array('user' => $user, 'organization' => $organization))->will($this->returnValue(null));
     $this->factory->expects($this->never())->method($this->anything());
     $this->assertNull($this->manager->findUserActiveDashboard($user));
 }