/** * @return array */ protected function getExtensions() { $accountUserRoleSelectType = new EntitySelectTypeStub($this->getRoles(), AccountUserRoleSelectType::NAME, new AccountUserRoleSelectType()); $addressEntityType = new EntityType($this->getAddresses(), 'test_address_entity'); $accountSelectType = new AccountSelectTypeStub($this->getAccounts(), AccountSelectType::NAME); return [new PreloadedExtension([OroDateType::NAME => new OroDateType(), AccountUserRoleSelectType::NAME => $accountUserRoleSelectType, $accountSelectType->getName() => $accountSelectType, AddressCollectionTypeStub::NAME => new AddressCollectionTypeStub(), $addressEntityType->getName() => $addressEntityType], []), new ValidatorExtension(Validation::createValidator())]; }
/** * @return array */ protected function getExtensions() { $account = $this->getAccount(1); $user = new AccountUser(); $user->setAccount($account); $this->securityFacade->expects($this->any())->method('getLoggedUser')->willReturn($user); $frontendUserRoleSelectType = new EntitySelectTypeStub($this->getRoles(), FrontendAccountUserRoleSelectType::NAME, new AccountUserRoleSelectType()); $addressEntityType = new EntityType($this->getAddresses(), 'test_address_entity'); $accountSelectType = new AccountSelectTypeStub($this->getAccounts(), 'orob2b_account_select'); $accountUserType = new AccountUserType($this->securityFacade); $accountUserType->setDataClass(self::DATA_CLASS); $accountUserType->setAddressClass(self::ADDRESS_CLASS); return [new PreloadedExtension([OroDateType::NAME => new OroDateType(), AccountUserType::NAME => $accountUserType, FrontendAccountUserRoleSelectType::NAME => $frontendUserRoleSelectType, $accountSelectType->getName() => $accountSelectType, AddressCollectionTypeStub::NAME => new AddressCollectionTypeStub(), $addressEntityType->getName() => $addressEntityType], []), new ValidatorExtension(Validation::createValidator())]; }
/** * @return array */ protected function getExtensions() { $addressType = new EntityType([AddressType::TYPE_BILLING => $this->billingType, AddressType::TYPE_SHIPPING => $this->shippingType], 'translatable_entity'); $addressTypeStub = new AddressTypeStub(); return [new PreloadedExtension([$addressType->getName() => $addressType, AccountTypedAddressWithDefaultTypeStub::NAME => new AccountTypedAddressWithDefaultTypeStub([$this->billingType, $this->shippingType], $this->em), $addressTypeStub->getName() => $addressTypeStub], [])]; }