Пример #1
0
 public function testCanLinkAccounts()
 {
     $types = [PrimaryAuthenticationProvider::TYPE_CREATE => true, PrimaryAuthenticationProvider::TYPE_LINK => true, PrimaryAuthenticationProvider::TYPE_NONE => false];
     foreach ($types as $type => $can) {
         $mock = $this->getMockForAbstractClass(PrimaryAuthenticationProvider::class);
         $mock->expects($this->any())->method('getUniqueId')->will($this->returnValue($type));
         $mock->expects($this->any())->method('accountCreationType')->will($this->returnValue($type));
         $this->primaryauthMocks = [$mock];
         $this->initializeManager(true);
         $this->assertSame($can, $this->manager->canCreateAccounts(), $type);
     }
 }