Пример #1
0
 public function getTemplates()
 {
     $provider = $this->getMock('Alchemy\\Phrasea\\Authentication\\Provider\\ProviderInterface');
     $id = 'Id-' . mt_rand();
     $identity = $this->getMockBuilder('Alchemy\\Phrasea\\Authentication\\Provider\\Token\\Identity')->disableOriginalConstructor()->getMock();
     $provider->expects($this->once())->method('getIdentity')->will($this->returnValue($identity));
     $templates = [25, 42];
     $provider->expects($this->once())->method('getTemplates')->with($identity)->will($this->returnValue($templates));
     $token = new Token($provider, $id);
     $this->assertEquals($templates, $token->getTemplates());
 }