示例#1
0
 public function testIsObjectSharedWithUserSid()
 {
     $token = $this->getMockBuilder('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface')->disableOriginalConstructor()->getMock();
     $user = $this->getMockBuilder('Symfony\\Component\\Security\\Core\\User\\UserInterface')->disableOriginalConstructor()->getMock();
     $token->expects($this->once())->method('getUser')->willReturn($user);
     $this->securityContext->expects($this->once())->method('getToken')->willReturn($token);
     $this->shareProvider->expects($this->once())->method('isObjectSharedWithUserSid')->willReturn(true);
     $this->assertTrue($this->facade->isObjectSharedWithUserSid(new \stdClass()));
 }