/**
  * Assigns an Account to a Party
  *
  * @param Account $account
  * @param AbstractParty $party
  * @return void
  */
 public function assignAccountToParty(Account $account, AbstractParty $party)
 {
     if ($party->getAccounts()->contains($account)) {
         return;
     }
     $party->addAccount($account);
     $accountIdentifier = $this->persistenceManager->getIdentifierByObject($account);
     $this->accountsInPartyRuntimeCache[$accountIdentifier] = $party;
 }
Beispiel #2
0
 /**
  * @test
  */
 public function getAssignedPartyOfAccountCachesParty()
 {
     $this->mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnValue('723e3913-f803-42c8-a44c-fd7115f555c3'));
     $this->mockPartyRepository->expects($this->once())->method('findOneHavingAccount')->with($this->account)->will($this->returnValue($this->party));
     $this->party->addAccount($this->account);
     $assignedParty = $this->partyService->getAssignedPartyOfAccount($this->account);
     $this->assertSame($this->party, $assignedParty);
     $assignedParty = $this->partyService->getAssignedPartyOfAccount($this->account);
     $this->assertSame($this->party, $assignedParty);
 }
Beispiel #3
0
 /**
  * Construct a user
  */
 public function __construct()
 {
     parent::__construct();
     $account = new \TYPO3\FLOW3\Security\Account();
     $account->setAuthenticationProviderName('AdminInterfaceProvider');
     $this->addAccount($account);
 }
Beispiel #4
0
 /**
  * @test
  */
 public function getAccountsReturnsAccounts()
 {
     $this->assertSame($this->mockAccounts, $this->abstractParty->getAccounts());
 }
Beispiel #5
0
 /**
  * Constructs this Person
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->electronicAddresses = new \Doctrine\Common\Collections\ArrayCollection();
 }