renaming
This commit is contained in:
@@ -93,7 +93,7 @@ class Application
|
||||
}
|
||||
|
||||
$runner = $this->getInjectableFactory()->createWith($className, [
|
||||
'params' => $params ?? RunnerParams::fromNothing(),
|
||||
'params' => $params ?? RunnerParams::create(),
|
||||
]);
|
||||
|
||||
if (!$runner instanceof Runner) {
|
||||
|
||||
@@ -34,9 +34,9 @@ namespace Espo\Core\Application;
|
||||
*/
|
||||
class RunnerParams
|
||||
{
|
||||
private $data;
|
||||
private $data = [];
|
||||
|
||||
private function __construct()
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ class RunnerParams
|
||||
}
|
||||
|
||||
/**
|
||||
* Create from an array.
|
||||
* Create from an associative array.
|
||||
*/
|
||||
public static function fromArray(array $data): self
|
||||
{
|
||||
@@ -87,7 +87,7 @@ class RunnerParams
|
||||
/**
|
||||
* Create an empty instance.
|
||||
*/
|
||||
public static function fromNothing(): self
|
||||
public static function create(): self
|
||||
{
|
||||
return new self();
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ class EntryPoint implements Runner
|
||||
$this->authBuilderFactory = $authBuilderFactory;
|
||||
$this->errorOutput = $errorOutput;
|
||||
|
||||
$this->params = $params ?? RunnerParams::fromNothing();
|
||||
$this->params = $params ?? RunnerParams::create();
|
||||
}
|
||||
|
||||
public function run(): void
|
||||
|
||||
@@ -74,7 +74,7 @@ class PortalClient implements Runner
|
||||
$this->config = $config;
|
||||
$this->errorOutput = $errorOutput;
|
||||
|
||||
$this->params = $params ?? RunnerParams::fromNothing();
|
||||
$this->params = $params ?? RunnerParams::create();
|
||||
}
|
||||
|
||||
public function run(): void
|
||||
|
||||
@@ -84,8 +84,8 @@ class Result
|
||||
public static function fail(?string $reason = null): self
|
||||
{
|
||||
$data = $reason ?
|
||||
ResultData::fromFailReason($reason) :
|
||||
ResultData::fromNothing();
|
||||
ResultData::createWithFailReason($reason) :
|
||||
ResultData::create();
|
||||
|
||||
return new self(self::STATUS_FAIL, null, $data);
|
||||
}
|
||||
|
||||
@@ -57,17 +57,17 @@ class ResultData
|
||||
$this->loggedUser = $loggedUser;
|
||||
}
|
||||
|
||||
public static function fromNothing(): self
|
||||
public static function create(): self
|
||||
{
|
||||
return new self();
|
||||
}
|
||||
|
||||
public static function fromFailReason(string $failReason): self
|
||||
public static function createWithFailReason(string $failReason): self
|
||||
{
|
||||
return new self(null, $failReason);
|
||||
}
|
||||
|
||||
public static function fromMessage(string $message): self
|
||||
public static function createWithMessage(string $message): self
|
||||
{
|
||||
return new self($message);
|
||||
}
|
||||
@@ -112,4 +112,49 @@ class ResultData
|
||||
{
|
||||
return $this->failReason;
|
||||
}
|
||||
|
||||
public function withMessage(?string $message): self
|
||||
{
|
||||
$obj = clone $this;
|
||||
|
||||
$obj->message = $message;
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function withFailReason(?string $failReason): self
|
||||
{
|
||||
$obj = clone $this;
|
||||
|
||||
$obj->failReason = $failReason;
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function withToken(?string $token): self
|
||||
{
|
||||
$obj = clone $this;
|
||||
|
||||
$obj->token = $token;
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function withView(?string $view): self
|
||||
{
|
||||
$obj = clone $this;
|
||||
|
||||
$obj->view = $view;
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function withLoggedUser(?User $loggedUser): self
|
||||
{
|
||||
$obj = clone $this;
|
||||
|
||||
$obj->loggedUser = $loggedUser;
|
||||
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,6 +80,6 @@ class Totp implements CodeVerify
|
||||
|
||||
public function getLoginData(User $user): ResultData
|
||||
{
|
||||
return ResultData::fromMessage('enterTotpCode');
|
||||
return ResultData::createWithMessage('enterTotpCode');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class LoaderParams
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public static function fromNothing(): self
|
||||
public static function create(): self
|
||||
{
|
||||
return new self();
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class SaveProcessor
|
||||
|
||||
public function process(Entity $entity, array $options): void
|
||||
{
|
||||
$params = SaverParams::fromNothing()->withRawOptions($options);
|
||||
$params = SaverParams::create()->withRawOptions($options);
|
||||
|
||||
foreach ($this->getSaverList($entity->getEntityType()) as $processor) {
|
||||
$processor->process($entity, $params);
|
||||
|
||||
@@ -65,7 +65,7 @@ class SaverParams
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public static function fromNothing(): self
|
||||
public static function create(): self
|
||||
{
|
||||
return new self();
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class Params
|
||||
/**
|
||||
* A field list that will be skipped in validation.
|
||||
*
|
||||
* @return array<int, string>
|
||||
* @return string[]
|
||||
*/
|
||||
public function getSkipFieldList(): array
|
||||
{
|
||||
@@ -52,7 +52,7 @@ class Params
|
||||
/**
|
||||
* A field list that will be skipped in validation for a specific validation type.
|
||||
*
|
||||
* @return array<int, string>
|
||||
* @return string[]
|
||||
*/
|
||||
public function getTypeSkipFieldList(string $type): array
|
||||
{
|
||||
@@ -62,7 +62,7 @@ class Params
|
||||
/**
|
||||
* Clone with a specified field list that will be skipped in validation.
|
||||
*
|
||||
* @param array<int, string> $list
|
||||
* @param string[] $list
|
||||
*/
|
||||
public function withSkipFieldList(array $list): self
|
||||
{
|
||||
@@ -76,7 +76,7 @@ class Params
|
||||
/**
|
||||
* Clone with a specified field list that will be skipped in validation for a specific validation type.
|
||||
*
|
||||
* @param array<int, string> $list
|
||||
* @param string[] $list
|
||||
*/
|
||||
public function withTypeSkipFieldList(string $type, array $list): self
|
||||
{
|
||||
@@ -90,7 +90,7 @@ class Params
|
||||
/**
|
||||
* Create an empty instance.
|
||||
*/
|
||||
public static function fromNothing(): self
|
||||
public static function create(): self
|
||||
{
|
||||
return new self();
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ class Address
|
||||
/**
|
||||
* Create an empty address.
|
||||
*/
|
||||
public static function fromNothing(): self
|
||||
public static function create(): self
|
||||
{
|
||||
return new self();
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ class Currency
|
||||
/**
|
||||
* Create from an amount and code.
|
||||
*/
|
||||
public static function fromAmountAndCode(float $amount, string $code): self
|
||||
public static function create(float $amount, string $code): self
|
||||
{
|
||||
return new self($amount, $code);
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ class EmailAddress
|
||||
/**
|
||||
* Create from an address.
|
||||
*/
|
||||
public static function fromAddress(string $address): self
|
||||
public static function create(string $address): self
|
||||
{
|
||||
return new self($address);
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ class EmailAddressGroupFactory implements ValueFactory
|
||||
}
|
||||
|
||||
foreach ($dataList as $item) {
|
||||
$emailAddress = EmailAddress::fromAddress($item->emailAddress);
|
||||
$emailAddress = EmailAddress::create($item->emailAddress);
|
||||
|
||||
if ($item->optOut) {
|
||||
$emailAddress = $emailAddress->optedOut();
|
||||
@@ -122,7 +122,7 @@ class EmailAddressGroupFactory implements ValueFactory
|
||||
$emailAddressList[] = $emailAddress;
|
||||
}
|
||||
|
||||
$group = EmailAddressGroup::fromList($emailAddressList);
|
||||
$group = EmailAddressGroup::create($emailAddressList);
|
||||
|
||||
if ($primaryEmailAddress) {
|
||||
$group = $group->withPrimary($primaryEmailAddress);
|
||||
|
||||
@@ -38,7 +38,7 @@ use RuntimeException;
|
||||
class EmailAddressGroup
|
||||
{
|
||||
/**
|
||||
* @var array<int, EmailAddress>
|
||||
* @var EmailAddress[]
|
||||
*/
|
||||
private $list = [];
|
||||
|
||||
@@ -48,7 +48,7 @@ class EmailAddressGroup
|
||||
private $primary = null;
|
||||
|
||||
/**
|
||||
* @param array<int, EmailAddress> $list
|
||||
* @param EmailAddress[] $list
|
||||
*
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
@@ -95,7 +95,7 @@ class EmailAddressGroup
|
||||
/**
|
||||
* Get a list of all email addresses.
|
||||
*
|
||||
* @return array<int, EmailAddress>
|
||||
* @return EmailAddress[]
|
||||
*/
|
||||
public function getList(): array
|
||||
{
|
||||
@@ -113,7 +113,7 @@ class EmailAddressGroup
|
||||
/**
|
||||
* Get a list of email addresses w/o a primary.
|
||||
*
|
||||
* @return array<int, EmailAddress>
|
||||
* @return EmailAddress[]
|
||||
*/
|
||||
public function getSecondaryList(): array
|
||||
{
|
||||
@@ -133,7 +133,7 @@ class EmailAddressGroup
|
||||
/**
|
||||
* Get a list of email addresses represented as strings.
|
||||
*
|
||||
* @return array<int, string>
|
||||
* @return string[]
|
||||
*/
|
||||
public function getAddressList(): array
|
||||
{
|
||||
@@ -185,13 +185,13 @@ class EmailAddressGroup
|
||||
|
||||
$newList = array_merge([$emailAddress], $list);
|
||||
|
||||
return self::fromList($newList);
|
||||
return self::create($newList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clone with an added email address list.
|
||||
*
|
||||
* @param array<int, EmailAddress> $list
|
||||
* @param EmailAddress[] $list
|
||||
*/
|
||||
public function withAddedList(array $list): self
|
||||
{
|
||||
@@ -209,7 +209,7 @@ class EmailAddressGroup
|
||||
$newList[] = $item;
|
||||
}
|
||||
|
||||
return self::fromList($newList);
|
||||
return self::create($newList);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -243,27 +243,19 @@ class EmailAddressGroup
|
||||
$newList = array_values($newList);
|
||||
}
|
||||
|
||||
return self::fromList($newList);
|
||||
return self::create($newList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create from an email address list. A first item will be set as primary.
|
||||
* Create with an optional email address list. A first item will be set as primary.
|
||||
*
|
||||
* @param array<int, EmailAddress> $list
|
||||
* @param EmailAddress[] $list
|
||||
*/
|
||||
public static function fromList(array $list): self
|
||||
public static function create(array $list = []): self
|
||||
{
|
||||
return new self($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create empty.
|
||||
*/
|
||||
public static function fromNothing(): self
|
||||
{
|
||||
return new self([]);
|
||||
}
|
||||
|
||||
private function searchAddressInList(string $address): ?int
|
||||
{
|
||||
foreach ($this->getAddressList() as $i => $item) {
|
||||
|
||||
@@ -80,7 +80,7 @@ class Link
|
||||
/**
|
||||
* Create from an ID.
|
||||
*/
|
||||
public static function fromId(string $id): self
|
||||
public static function create(string $id): self
|
||||
{
|
||||
return new self($id);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class LinkFactory implements ValueFactory
|
||||
$name = $entity->get($field . 'Name');
|
||||
|
||||
return Link
|
||||
::fromId($id)
|
||||
::create($id)
|
||||
->withName($name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class LinkMultiple
|
||||
private $list = [];
|
||||
|
||||
/**
|
||||
* @param array<int, LinkMultipleItem> $list
|
||||
* @param LinkMultipleItem[] $list
|
||||
*
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
@@ -72,7 +72,7 @@ class LinkMultiple
|
||||
/**
|
||||
* Get a list of IDs.
|
||||
*
|
||||
* @return array<int, string>
|
||||
* @return string[]
|
||||
*/
|
||||
public function getIdList(): array
|
||||
{
|
||||
@@ -88,7 +88,7 @@ class LinkMultiple
|
||||
/**
|
||||
* Get a list of items.
|
||||
*
|
||||
* @return array<int, LinkMultipleItem>
|
||||
* @return LinkMultipleItem[]
|
||||
*/
|
||||
public function getList(): array
|
||||
{
|
||||
@@ -128,7 +128,7 @@ class LinkMultiple
|
||||
/**
|
||||
* Clone with an added item list.
|
||||
* .
|
||||
* @param array<int, LinkMultipleItem> $list
|
||||
* @param LinkMultipleItem[] $list
|
||||
*
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
@@ -148,7 +148,7 @@ class LinkMultiple
|
||||
$newList[] = $item;
|
||||
}
|
||||
|
||||
return self::fromList($newList);
|
||||
return self::create($newList);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -174,29 +174,21 @@ class LinkMultiple
|
||||
$newList = array_values($newList);
|
||||
}
|
||||
|
||||
return self::fromList($newList);
|
||||
return self::create($newList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create from an item list.
|
||||
* Create with an optional item list.
|
||||
*
|
||||
* @param array<int, LinkMultipleItem> $list
|
||||
* @param LinkMultipleItem[] $list
|
||||
*
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public static function fromList(array $list): self
|
||||
public static function create(array $list = []): self
|
||||
{
|
||||
return new self($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create empty.
|
||||
*/
|
||||
public static function fromNothing(): self
|
||||
{
|
||||
return new self([]);
|
||||
}
|
||||
|
||||
private function validateList(): void
|
||||
{
|
||||
$idList = [];
|
||||
|
||||
@@ -100,7 +100,7 @@ class LinkMultipleFactory implements ValueFactory
|
||||
}
|
||||
|
||||
foreach ($idList as $id) {
|
||||
$item = LinkMultipleItem::fromId($id);
|
||||
$item = LinkMultipleItem::create($id);
|
||||
|
||||
if ($columnData && property_exists($columnData, $id)) {
|
||||
$item = $this->addColumnValues($item, $columnData->$id);
|
||||
|
||||
@@ -125,11 +125,11 @@ class LinkMultipleItem
|
||||
}
|
||||
|
||||
/**
|
||||
* Create from an ID.
|
||||
* Create.
|
||||
*
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public static function fromId(string $id): self
|
||||
public static function create(string $id): self
|
||||
{
|
||||
return new self($id);
|
||||
}
|
||||
|
||||
@@ -93,9 +93,9 @@ class LinkParent
|
||||
}
|
||||
|
||||
/**
|
||||
* Create from an entity type and ID.
|
||||
* Create.
|
||||
*/
|
||||
public static function fromEntityTypeAndId(string $entityType, string $id): self
|
||||
public static function create(string $entityType, string $id): self
|
||||
{
|
||||
return new self($entityType, $id);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class LinkParentFactory implements ValueFactory
|
||||
$entityType = $entity->get($field . 'Type');
|
||||
|
||||
return LinkParent
|
||||
::fromEntityTypeAndId($entityType, $id)
|
||||
::create($entityType, $id)
|
||||
->withName($entity->get($field . 'Name'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,9 +146,9 @@ class PhoneNumber
|
||||
}
|
||||
|
||||
/**
|
||||
* Create from a number.
|
||||
* Create with a number.
|
||||
*/
|
||||
public static function fromNumber(string $number): self
|
||||
public static function create(string $number): self
|
||||
{
|
||||
return new self($number);
|
||||
}
|
||||
@@ -156,9 +156,9 @@ class PhoneNumber
|
||||
/**
|
||||
* Create from a number and type.
|
||||
*/
|
||||
public static function fromNumberAndType(string $number, string $type): self
|
||||
public static function createWithType(string $number, string $type): self
|
||||
{
|
||||
return self::fromNumber($number)->withType($type);
|
||||
return self::create($number)->withType($type);
|
||||
}
|
||||
|
||||
private function clone(): self
|
||||
|
||||
@@ -105,7 +105,7 @@ class PhoneNumberGroupFactory implements ValueFactory
|
||||
}
|
||||
|
||||
foreach ($dataList as $item) {
|
||||
$phoneNumber = PhoneNumber::fromNumber($item->phoneNumber);
|
||||
$phoneNumber = PhoneNumber::create($item->phoneNumber);
|
||||
|
||||
if ($item->type) {
|
||||
$phoneNumber = $phoneNumber->withType($item->type);
|
||||
@@ -126,7 +126,7 @@ class PhoneNumberGroupFactory implements ValueFactory
|
||||
$phoneNumberList[] = $phoneNumber;
|
||||
}
|
||||
|
||||
$group = PhoneNumberGroup::fromList($phoneNumberList);
|
||||
$group = PhoneNumberGroup::create($phoneNumberList);
|
||||
|
||||
if ($primaryPhoneNumber) {
|
||||
$group = $group->withPrimary($primaryPhoneNumber);
|
||||
|
||||
@@ -38,7 +38,7 @@ use RuntimeException;
|
||||
class PhoneNumberGroup
|
||||
{
|
||||
/**
|
||||
* @var array<int, PhoneNumber>
|
||||
* @var PhoneNumber[]
|
||||
*/
|
||||
private $list = [];
|
||||
|
||||
@@ -48,7 +48,7 @@ class PhoneNumberGroup
|
||||
private $primary = null;
|
||||
|
||||
/**
|
||||
* @param array<int, PhoneNumber> $list
|
||||
* @param PhoneNumber[] $list
|
||||
*
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
@@ -95,7 +95,7 @@ class PhoneNumberGroup
|
||||
/**
|
||||
* Get a list of all phone numbers.
|
||||
*
|
||||
* @return array<int, PhoneNumber>
|
||||
* @return PhoneNumber[]
|
||||
*/
|
||||
public function getList(): array
|
||||
{
|
||||
@@ -113,7 +113,7 @@ class PhoneNumberGroup
|
||||
/**
|
||||
* Get a list of phone numbers w/o a primary.
|
||||
*
|
||||
* @return array<int, PhoneNumber>
|
||||
* @return PhoneNumber[]
|
||||
*/
|
||||
public function getSecondaryList(): array
|
||||
{
|
||||
@@ -133,7 +133,7 @@ class PhoneNumberGroup
|
||||
/**
|
||||
* Get a list of phone numbers represented as strings.
|
||||
*
|
||||
* @return array<int, string>
|
||||
* @return string[]
|
||||
*/
|
||||
public function getNumberList(): array
|
||||
{
|
||||
@@ -185,13 +185,13 @@ class PhoneNumberGroup
|
||||
|
||||
$newList = array_merge([$phoneNumber], $list);
|
||||
|
||||
return self::fromList($newList);
|
||||
return self::create($newList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clone with an added phone number list.
|
||||
*
|
||||
* @param array<int, PhoneNumber> $list
|
||||
* @param PhoneNumber[] $list
|
||||
*/
|
||||
public function withAddedList(array $list): self
|
||||
{
|
||||
@@ -209,7 +209,7 @@ class PhoneNumberGroup
|
||||
$newList[] = $item;
|
||||
}
|
||||
|
||||
return self::fromList($newList);
|
||||
return self::create($newList);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -243,27 +243,19 @@ class PhoneNumberGroup
|
||||
$newList = array_values($newList);
|
||||
}
|
||||
|
||||
return self::fromList($newList);
|
||||
return self::create($newList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create from a phone number list. A first item will be set as primary.
|
||||
* Create with an optional phone number list. A first item will be set as primary.
|
||||
*
|
||||
* @param array<int, PhoneNumber> $list
|
||||
* @param PhoneNumber[] $list
|
||||
*/
|
||||
public static function fromList(array $list): self
|
||||
public static function create(array $list = []): self
|
||||
{
|
||||
return new self($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create empty.
|
||||
*/
|
||||
public static function fromNothing(): self
|
||||
{
|
||||
return new self([]);
|
||||
}
|
||||
|
||||
private function searchNumberInList(string $number): ?int
|
||||
{
|
||||
foreach ($this->getNumberList() as $i => $item) {
|
||||
|
||||
@@ -112,7 +112,7 @@ class GenerateType extends BaseFunction implements
|
||||
$fileName = Util::sanitizeFileName($entity->get('name')) . '.pdf';
|
||||
}
|
||||
|
||||
$data = Data::fromNothing()->withAcl(false);
|
||||
$data = Data::create()->withAcl(false);
|
||||
|
||||
try {
|
||||
$contents = $this->serviceFactory
|
||||
|
||||
@@ -177,7 +177,7 @@ class JobManager
|
||||
public function processQueue(string $queue, int $limit): void
|
||||
{
|
||||
$params = QueueProcessorParams
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withQueue($queue)
|
||||
->withLimit($limit)
|
||||
->withUseProcessPool(false)
|
||||
@@ -193,7 +193,7 @@ class JobManager
|
||||
$limit = (int) $this->config->get('jobMaxPortion', 0);
|
||||
|
||||
$params = QueueProcessorParams
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withUseProcessPool($this->useProcessPool)
|
||||
->withLimit($limit);
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ class QueueProcessorParams
|
||||
return $this->limit;
|
||||
}
|
||||
|
||||
public static function fromNothing(): self
|
||||
public static function create(): self
|
||||
{
|
||||
return new self();
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ class Params
|
||||
return !is_null($this->ids);
|
||||
}
|
||||
|
||||
public static function fromIds(string $entityType, array $ids): self
|
||||
public static function createWithIds(string $entityType, array $ids): self
|
||||
{
|
||||
return self::fromRaw([
|
||||
'entityType' => $entityType,
|
||||
@@ -83,7 +83,7 @@ class Params
|
||||
]);
|
||||
}
|
||||
|
||||
public static function fromSearchParams(string $entityType, SearchParams $searchParams): self
|
||||
public static function createWithSearchParams(string $entityType, SearchParams $searchParams): self
|
||||
{
|
||||
$obj = new self();
|
||||
|
||||
|
||||
@@ -354,7 +354,7 @@ class Service implements Crud,
|
||||
public function processValidation(Entity $entity, $data)
|
||||
{
|
||||
$params = FieldValidationParams
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withSkipFieldList($this->validateSkipFieldList)
|
||||
->withTypeSkipFieldList('required', $this->validateRequiredSkipFieldList);
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ class SearchParams
|
||||
/**
|
||||
* Create an empty instance.
|
||||
*/
|
||||
public static function fromNothing(): self
|
||||
public static function create(): self
|
||||
{
|
||||
return new self();
|
||||
}
|
||||
|
||||
@@ -829,7 +829,7 @@ class Activities implements
|
||||
);
|
||||
|
||||
$loadProcessorParams = FieldLoaderParams
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withSelect($searchParams->getSelect());
|
||||
|
||||
foreach ($collection as $e) {
|
||||
|
||||
@@ -332,7 +332,7 @@ class Pdf
|
||||
|
||||
if (!$data) {
|
||||
$data = Data
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withAdditionalTemplateData($additionalData ?? [])
|
||||
->withAcl($applyAcl);
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ class Export
|
||||
$dataResource = fopen('php://temp', 'w');
|
||||
|
||||
$loaderParams = LoaderParams
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withSelect($attributeList);
|
||||
|
||||
$recordService = $this->serviceContainer->get($entityType);
|
||||
|
||||
@@ -110,7 +110,7 @@ class Params
|
||||
}
|
||||
|
||||
$obj->searchParams = SearchParams
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withWhere(
|
||||
WhereItem::fromRaw([
|
||||
'type' => 'equals',
|
||||
@@ -131,7 +131,7 @@ class Params
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public static function fromEntityType(string $entityType): self
|
||||
public static function create(string $entityType): self
|
||||
{
|
||||
return new self($entityType);
|
||||
}
|
||||
@@ -205,7 +205,7 @@ class Params
|
||||
public function getSearchParams(): SearchParams
|
||||
{
|
||||
if (!$this->searchParams) {
|
||||
return SearchParams::fromNothing();
|
||||
return SearchParams::create();
|
||||
}
|
||||
|
||||
return $this->searchParams;
|
||||
|
||||
@@ -251,7 +251,7 @@ class Kanban
|
||||
}
|
||||
|
||||
$loadProcessorParams = FieldLoaderParams
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withSelect($searchParams->getSelect());
|
||||
|
||||
foreach ($collectionSub as $e) {
|
||||
|
||||
@@ -71,7 +71,7 @@ class Data
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public static function fromNothing(): self
|
||||
public static function create(): self
|
||||
{
|
||||
return new self();
|
||||
}
|
||||
|
||||
@@ -139,14 +139,14 @@ class ActionTest extends \tests\integration\Core\BaseTestCase
|
||||
$contact1 = $this->entityManager->getEntity('Contact');
|
||||
|
||||
$emailAddressGroup1 = $contact1->getEmailAddressGroup()
|
||||
->withAdded(EmailAddress::fromAddress('c1a@test.com'))
|
||||
->withAdded(EmailAddress::fromAddress('c1b@test.com')->invalid());
|
||||
->withAdded(EmailAddress::create('c1a@test.com'))
|
||||
->withAdded(EmailAddress::create('c1b@test.com')->invalid());
|
||||
|
||||
$contact1->setEmailAddressGroup($emailAddressGroup1);
|
||||
|
||||
$phoneNumberGroup1 = $contact1->getPhoneNumberGroup()
|
||||
->withAdded(PhoneNumber::fromNumber('+1a'))
|
||||
->withAdded(PhoneNumber::fromNumber('+1b')->invalid());
|
||||
->withAdded(PhoneNumber::create('+1a'))
|
||||
->withAdded(PhoneNumber::create('+1b')->invalid());
|
||||
|
||||
$contact1->setPhoneNumberGroup($phoneNumberGroup1);
|
||||
|
||||
@@ -158,14 +158,14 @@ class ActionTest extends \tests\integration\Core\BaseTestCase
|
||||
$contact2 = $this->entityManager->getEntity('Contact');
|
||||
|
||||
$emailAddressGroup2 = $contact1->getEmailAddressGroup()
|
||||
->withAdded(EmailAddress::fromAddress('c2a@test.com'))
|
||||
->withAdded(EmailAddress::fromAddress('c2b@test.com')->optedOut());
|
||||
->withAdded(EmailAddress::create('c2a@test.com'))
|
||||
->withAdded(EmailAddress::create('c2b@test.com')->optedOut());
|
||||
|
||||
$contact2->setEmailAddressGroup($emailAddressGroup2);
|
||||
|
||||
$phoneNumberGroup2 = $contact2->getPhoneNumberGroup()
|
||||
->withAdded(PhoneNumber::fromNumber('+2a'))
|
||||
->withAdded(PhoneNumber::fromNumber('+2b')->optedOut());
|
||||
->withAdded(PhoneNumber::create('+2a'))
|
||||
->withAdded(PhoneNumber::create('+2b')->optedOut());
|
||||
|
||||
$contact2->setPhoneNumberGroup($phoneNumberGroup2);
|
||||
|
||||
|
||||
@@ -56,13 +56,12 @@ class EmailAddressTest extends \tests\integration\Core\BaseTestCase
|
||||
|
||||
$this->assertEquals('test@test.com', $group1->getPrimary()->getAddress());
|
||||
|
||||
$group2 = EmailAddressGroup
|
||||
::fromNothing()
|
||||
$group2 = EmailAddressGroup::create()
|
||||
->withAdded(
|
||||
EmailAddress::fromAddress('test-a@test.com')->invalid()
|
||||
EmailAddress::create('test-a@test.com')->invalid()
|
||||
)
|
||||
->withAdded(
|
||||
EmailAddress::fromAddress('test@test.com')->optedOut()
|
||||
EmailAddress::create('test@test.com')->optedOut()
|
||||
);
|
||||
|
||||
$contact->setValueObject('emailAddress', $group2);
|
||||
@@ -82,10 +81,9 @@ class EmailAddressTest extends \tests\integration\Core\BaseTestCase
|
||||
|
||||
$this->assertTrue($group3->getList()[1]->isOptedOut());
|
||||
|
||||
$group4 = EmailAddressGroup
|
||||
::fromNothing()
|
||||
$group4 = EmailAddressGroup::create()
|
||||
->withAdded(
|
||||
EmailAddress::fromAddress('test-a@test.com')->invalid()
|
||||
EmailAddress::create('test-a@test.com')->invalid()
|
||||
);
|
||||
|
||||
$contact->setValueObject('emailAddress', $group4);
|
||||
|
||||
@@ -57,12 +57,12 @@ class PhoneNumberTest extends \tests\integration\Core\BaseTestCase
|
||||
$this->assertEquals('+1', $group1->getPrimary()->getNumber());
|
||||
|
||||
$group2 = PhoneNumberGroup
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withAdded(
|
||||
PhoneNumber::fromNumber('+2')->invalid()
|
||||
PhoneNumber::create('+2')->invalid()
|
||||
)
|
||||
->withAdded(
|
||||
PhoneNumber::fromNumber('+1')->optedOut()
|
||||
PhoneNumber::create('+1')->optedOut()
|
||||
);
|
||||
|
||||
$contact->setValueObject('phoneNumber', $group2);
|
||||
@@ -83,9 +83,9 @@ class PhoneNumberTest extends \tests\integration\Core\BaseTestCase
|
||||
$this->assertTrue($group3->getList()[1]->isOptedOut());
|
||||
|
||||
$group4 = PhoneNumberGroup
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withAdded(
|
||||
PhoneNumber::fromNumber('+2')->invalid()
|
||||
PhoneNumber::create('+2')->invalid()
|
||||
);
|
||||
|
||||
$contact->setValueObject('phoneNumber', $group4);
|
||||
|
||||
@@ -54,7 +54,7 @@ class ValueObjectTest extends \tests\integration\Core\BaseTestCase
|
||||
$entity = $entityManager->getEntity('Account');
|
||||
|
||||
$address = Address
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withCity('Test')
|
||||
->withCountry('United States');
|
||||
|
||||
@@ -212,10 +212,10 @@ class ValueObjectTest extends \tests\integration\Core\BaseTestCase
|
||||
|
||||
$entity = $entityManager->getEntity('Account');
|
||||
|
||||
$group = EmailAddressGroup::fromList([
|
||||
EmailAddress::fromAddress('one@test.com'),
|
||||
EmailAddress::fromAddress('two@test.com')->optedOut(),
|
||||
EmailAddress::fromAddress('three@test.com')->invalid(),
|
||||
$group = EmailAddressGroup::create([
|
||||
EmailAddress::create('one@test.com'),
|
||||
EmailAddress::create('two@test.com')->optedOut(),
|
||||
EmailAddress::create('three@test.com')->invalid(),
|
||||
]);
|
||||
|
||||
$entity->setEmailAddressGroup($group);
|
||||
@@ -239,10 +239,10 @@ class ValueObjectTest extends \tests\integration\Core\BaseTestCase
|
||||
|
||||
$entity = $entityManager->getEntity('Account');
|
||||
|
||||
$group = PhoneNumberGroup::fromList([
|
||||
PhoneNumber::fromNumber('1')->withType('Office'),
|
||||
PhoneNumber::fromNumber('2')->optedOut(),
|
||||
PhoneNumber::fromNumber('3')->invalid(),
|
||||
$group = PhoneNumberGroup::create([
|
||||
PhoneNumber::create('1')->withType('Office'),
|
||||
PhoneNumber::create('2')->optedOut(),
|
||||
PhoneNumber::create('3')->invalid(),
|
||||
]);
|
||||
|
||||
$entity->setPhoneNumberGroup($group);
|
||||
@@ -267,7 +267,7 @@ class ValueObjectTest extends \tests\integration\Core\BaseTestCase
|
||||
|
||||
$entity = $entityManager->getEntity('Account');
|
||||
|
||||
$entity->setValueObject('assignedUser', Link::fromId('1'));
|
||||
$entity->setValueObject('assignedUser', Link::create('1'));
|
||||
|
||||
$link = $entity->getValueObject('assignedUser');
|
||||
|
||||
@@ -284,7 +284,7 @@ class ValueObjectTest extends \tests\integration\Core\BaseTestCase
|
||||
|
||||
$entity = $entityManager->getEntity('Task');
|
||||
|
||||
$entity->setValueObject('parent', LinkParent::fromEntityTypeAndId('Account', 'test-id'));
|
||||
$entity->setValueObject('parent', LinkParent::create('Account', 'test-id'));
|
||||
|
||||
$link = $entity->getValueObject('parent');
|
||||
|
||||
@@ -305,9 +305,9 @@ class ValueObjectTest extends \tests\integration\Core\BaseTestCase
|
||||
|
||||
$entity = $entityManager->getEntity('Opportunity');
|
||||
|
||||
$link = LinkMultiple::fromList([
|
||||
LinkMultipleItem::fromId($c1->id)->withColumnValue('role', 'Decision Maker'),
|
||||
LinkMultipleItem::fromId($c2->id),
|
||||
$link = LinkMultiple::create([
|
||||
LinkMultipleItem::create($c1->id)->withColumnValue('role', 'Decision Maker'),
|
||||
LinkMultipleItem::create($c2->id),
|
||||
]);
|
||||
|
||||
$entity->setValueObject('contacts', $link);
|
||||
@@ -336,9 +336,9 @@ class ValueObjectTest extends \tests\integration\Core\BaseTestCase
|
||||
|
||||
$entity = $entityManager->getEntity('Opportunity');
|
||||
|
||||
$link = LinkMultiple::fromList([
|
||||
LinkMultipleItem::fromId($c1->id)->withColumnValue('role', 'Decision Maker'),
|
||||
LinkMultipleItem::fromId($c2->id),
|
||||
$link = LinkMultiple::create([
|
||||
LinkMultipleItem::create($c1->id)->withColumnValue('role', 'Decision Maker'),
|
||||
LinkMultipleItem::create($c2->id),
|
||||
]);
|
||||
|
||||
$entity->setValueObject('contacts', $link);
|
||||
|
||||
@@ -98,7 +98,7 @@ class ExportTest extends \tests\integration\Core\BaseTestCase
|
||||
]);
|
||||
|
||||
$searchParams = SearchParams
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withWhere(WhereItem::fromRaw([
|
||||
'type' => 'equals',
|
||||
'attribute' => 'assignedUserId',
|
||||
@@ -106,7 +106,7 @@ class ExportTest extends \tests\integration\Core\BaseTestCase
|
||||
]));
|
||||
|
||||
$params = Params
|
||||
::fromEntityType('Task')
|
||||
::create('Task')
|
||||
->withFieldList([
|
||||
'name',
|
||||
'assignedUser',
|
||||
@@ -154,7 +154,7 @@ class ExportTest extends \tests\integration\Core\BaseTestCase
|
||||
]);
|
||||
|
||||
$params = Params
|
||||
::fromEntityType('Task')
|
||||
::create('Task')
|
||||
->withAttributeList([
|
||||
'id',
|
||||
'name',
|
||||
@@ -216,7 +216,7 @@ class ExportTest extends \tests\integration\Core\BaseTestCase
|
||||
->find();
|
||||
|
||||
$params = Params
|
||||
::fromEntityType('Task')
|
||||
::create('Task')
|
||||
->withAttributeList([
|
||||
'name',
|
||||
'assignedUserId',
|
||||
|
||||
@@ -89,7 +89,7 @@ class AclTest extends \tests\integration\Core\BaseTestCase
|
||||
|
||||
$service = $app->getContainer()->get('recordServiceContainer')->get('Case');
|
||||
|
||||
$result = $service->find(SearchParams::fromNothing());
|
||||
$result = $service->find(SearchParams::create());
|
||||
|
||||
$idList = [];
|
||||
foreach ($result->getCollection() as $e) {
|
||||
@@ -160,7 +160,7 @@ class AclTest extends \tests\integration\Core\BaseTestCase
|
||||
$this->assertTrue($acl->check($case4, 'read'));
|
||||
|
||||
$service = $app->getContainer()->get('recordServiceContainer')->get('Case');
|
||||
$result = $service->find(SearchParams::fromNothing());
|
||||
$result = $service->find(SearchParams::create());
|
||||
|
||||
$idList = [];
|
||||
foreach ($result->getCollection() as $e) {
|
||||
@@ -238,7 +238,7 @@ class AclTest extends \tests\integration\Core\BaseTestCase
|
||||
|
||||
$service = $app->getContainer()->get('recordServiceContainer')->get('Case');
|
||||
|
||||
$result = $service->find(SearchParams::fromNothing());
|
||||
$result = $service->find(SearchParams::create());
|
||||
|
||||
$idList = [];
|
||||
|
||||
|
||||
@@ -569,7 +569,7 @@ class AclTest extends \tests\integration\Core\BaseTestCase
|
||||
$this->expectException(Forbidden::class);
|
||||
|
||||
$searchParams = SearchParams
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withWhere(WhereItem::fromRaw(
|
||||
[
|
||||
'type' => 'isNull',
|
||||
|
||||
@@ -43,7 +43,7 @@ class LoaderParamsTest extends \PHPUnit\Framework\TestCase
|
||||
];
|
||||
|
||||
$params = LoaderParams
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withSelect($select);
|
||||
|
||||
$this->assertEquals(true, $params->hasInSelect('id'));
|
||||
@@ -55,7 +55,7 @@ class LoaderParamsTest extends \PHPUnit\Framework\TestCase
|
||||
public function testTwo(): void
|
||||
{
|
||||
$params = LoaderParams
|
||||
::fromNothing();
|
||||
::create();
|
||||
|
||||
|
||||
$this->assertEquals(false, $params->hasSelect());
|
||||
|
||||
@@ -42,7 +42,7 @@ class SaverParamsTest extends \PHPUnit\Framework\TestCase
|
||||
];
|
||||
|
||||
$params = SaverParams
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withRawOptions($options);
|
||||
|
||||
$this->assertEquals(true, $params->getOption('silent'));
|
||||
|
||||
@@ -125,7 +125,7 @@ class AddressTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testCreateFromNothing()
|
||||
{
|
||||
$address = Address::fromNothing();
|
||||
$address = Address::create();
|
||||
|
||||
$this->assertEquals(null, $address->getState());
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class CurrencyTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testValue()
|
||||
{
|
||||
$value = Currency::fromAmountAndCode(2.0, 'USD');
|
||||
$value = Currency::create(2.0, 'USD');
|
||||
|
||||
$this->assertEquals(2.0, $value->getAmount());
|
||||
|
||||
|
||||
+4
-4
@@ -40,9 +40,9 @@ class EmailAddressGroupAttributeExtractorTest extends \PHPUnit\Framework\TestCas
|
||||
public function testExtract()
|
||||
{
|
||||
$group = EmailAddressGroup
|
||||
::fromList([
|
||||
EmailAddress::fromAddress('ONE@test.com'),
|
||||
EmailAddress::fromAddress('two@test.com')->optedOut(),
|
||||
::create([
|
||||
EmailAddress::create('ONE@test.com'),
|
||||
EmailAddress::create('two@test.com')->optedOut(),
|
||||
]);
|
||||
|
||||
$valueMap = (new EmailAddressGroupAttributeExtractor())->extract($group, 'emailAddress');
|
||||
@@ -74,7 +74,7 @@ class EmailAddressGroupAttributeExtractorTest extends \PHPUnit\Framework\TestCas
|
||||
public function testEmpty()
|
||||
{
|
||||
$group = EmailAddressGroup
|
||||
::fromList([]);
|
||||
::create([]);
|
||||
|
||||
$valueMap = (new EmailAddressGroupAttributeExtractor())->extract($group, 'emailAddress');
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class EmailAddressGroupTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testEmpty()
|
||||
{
|
||||
$group = EmailAddressGroup::fromNothing();
|
||||
$group = EmailAddressGroup::create();
|
||||
|
||||
$this->assertEquals(0, count($group->getAddressList()));
|
||||
$this->assertEquals(0, count($group->getSecondaryList()));
|
||||
@@ -55,9 +55,9 @@ class EmailAddressGroupTest extends \PHPUnit\Framework\TestCase
|
||||
$this->expectException(RuntimeException::class);
|
||||
|
||||
EmailAddressGroup
|
||||
::fromList([
|
||||
EmailAddress::fromAddress('one@test.com'),
|
||||
EmailAddress::fromAddress('one@test.com'),
|
||||
::create([
|
||||
EmailAddress::create('one@test.com'),
|
||||
EmailAddress::create('one@test.com'),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -66,18 +66,18 @@ class EmailAddressGroupTest extends \PHPUnit\Framework\TestCase
|
||||
$this->expectException(RuntimeException::class);
|
||||
|
||||
EmailAddressGroup
|
||||
::fromList([
|
||||
EmailAddress::fromAddress('one@test.com'),
|
||||
EmailAddress::fromAddress('ONE@test.com'),
|
||||
::create([
|
||||
EmailAddress::create('one@test.com'),
|
||||
EmailAddress::create('ONE@test.com'),
|
||||
]);
|
||||
}
|
||||
|
||||
public function testWithPrimary1()
|
||||
{
|
||||
$primary = EmailAddress::fromAddress('primary@test.com')->invalid();
|
||||
$primary = EmailAddress::create('primary@test.com')->invalid();
|
||||
|
||||
$group = EmailAddressGroup
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withPrimary($primary);
|
||||
|
||||
$this->assertEquals(1, count($group->getList()));
|
||||
@@ -87,7 +87,7 @@ class EmailAddressGroupTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
$this->assertEquals('primary@test.com', $group->getPrimary()->getAddress());
|
||||
|
||||
$primaryAnother = EmailAddress::fromAddress('primaryAnother@test.com');
|
||||
$primaryAnother = EmailAddress::create('primaryAnother@test.com');
|
||||
|
||||
$groupAnother = $group->withPrimary($primaryAnother);
|
||||
|
||||
@@ -106,15 +106,15 @@ class EmailAddressGroupTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testWithPrimary2()
|
||||
{
|
||||
$address = EmailAddress::fromAddress('one@test.com')->invalid();
|
||||
$address = EmailAddress::create('one@test.com')->invalid();
|
||||
|
||||
$group = EmailAddressGroup
|
||||
::fromList([$address])
|
||||
::create([$address])
|
||||
->withAdded(
|
||||
EmailAddress::fromAddress('two@test.com')
|
||||
EmailAddress::create('two@test.com')
|
||||
)
|
||||
->withPrimary(
|
||||
EmailAddress::fromAddress('two@test.com')
|
||||
EmailAddress::create('two@test.com')
|
||||
);
|
||||
|
||||
$this->assertEquals('two@test.com', $group->getPrimary()->getAddress());
|
||||
@@ -124,12 +124,12 @@ class EmailAddressGroupTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testWithAdded1()
|
||||
{
|
||||
$address = EmailAddress::fromAddress('one@test.com')->invalid();
|
||||
$address = EmailAddress::create('one@test.com')->invalid();
|
||||
|
||||
$group = EmailAddressGroup
|
||||
::fromList([$address])
|
||||
::create([$address])
|
||||
->withAdded(
|
||||
EmailAddress::fromAddress('two@test.com')
|
||||
EmailAddress::create('two@test.com')
|
||||
);
|
||||
|
||||
$this->assertEquals('one@test.com', $group->getPrimary()->getAddress());
|
||||
@@ -142,10 +142,10 @@ class EmailAddressGroupTest extends \PHPUnit\Framework\TestCase
|
||||
public function testWithAddedList()
|
||||
{
|
||||
$group = EmailAddressGroup
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withAddedList([
|
||||
EmailAddress::fromAddress('one@test.com'),
|
||||
EmailAddress::fromAddress('two@test.com'),
|
||||
EmailAddress::create('one@test.com'),
|
||||
EmailAddress::create('two@test.com'),
|
||||
]);
|
||||
|
||||
$this->assertEquals('one@test.com', $group->getPrimary()->getAddress());
|
||||
@@ -156,12 +156,12 @@ class EmailAddressGroupTest extends \PHPUnit\Framework\TestCase
|
||||
public function testWithRemoved1()
|
||||
{
|
||||
$group = EmailAddressGroup
|
||||
::fromList([
|
||||
EmailAddress::fromAddress('one@test.com'),
|
||||
EmailAddress::fromAddress('two@test.com'),
|
||||
EmailAddress::fromAddress('three@test.com'),
|
||||
::create([
|
||||
EmailAddress::create('one@test.com'),
|
||||
EmailAddress::create('two@test.com'),
|
||||
EmailAddress::create('three@test.com'),
|
||||
])
|
||||
->withRemoved(EmailAddress::fromAddress('two@test.com'));
|
||||
->withRemoved(EmailAddress::create('two@test.com'));
|
||||
|
||||
$this->assertEquals('one@test.com', $group->getPrimary()->getAddress());
|
||||
|
||||
@@ -171,12 +171,12 @@ class EmailAddressGroupTest extends \PHPUnit\Framework\TestCase
|
||||
public function testWithRemoved2()
|
||||
{
|
||||
$group = EmailAddressGroup
|
||||
::fromList([
|
||||
EmailAddress::fromAddress('one@test.com'),
|
||||
EmailAddress::fromAddress('two@test.com'),
|
||||
EmailAddress::fromAddress('three@test.com'),
|
||||
::create([
|
||||
EmailAddress::create('one@test.com'),
|
||||
EmailAddress::create('two@test.com'),
|
||||
EmailAddress::create('three@test.com'),
|
||||
])
|
||||
->withRemoved(EmailAddress::fromAddress('one@test.com'));
|
||||
->withRemoved(EmailAddress::create('one@test.com'));
|
||||
|
||||
$this->assertEquals('two@test.com', $group->getPrimary()->getAddress());
|
||||
|
||||
@@ -186,10 +186,10 @@ class EmailAddressGroupTest extends \PHPUnit\Framework\TestCase
|
||||
public function testWithRemoved3()
|
||||
{
|
||||
$group = EmailAddressGroup
|
||||
::fromList([
|
||||
EmailAddress::fromAddress('one@test.com'),
|
||||
::create([
|
||||
EmailAddress::create('one@test.com'),
|
||||
])
|
||||
->withRemoved(EmailAddress::fromAddress('one@test.com'));
|
||||
->withRemoved(EmailAddress::create('one@test.com'));
|
||||
|
||||
$this->assertNull($group->getPrimary());
|
||||
|
||||
@@ -201,9 +201,9 @@ class EmailAddressGroupTest extends \PHPUnit\Framework\TestCase
|
||||
public function testHasAddress()
|
||||
{
|
||||
$group = EmailAddressGroup
|
||||
::fromList([
|
||||
EmailAddress::fromAddress('one@test.com'),
|
||||
EmailAddress::fromAddress('two@test.com'),
|
||||
::create([
|
||||
EmailAddress::create('one@test.com'),
|
||||
EmailAddress::create('two@test.com'),
|
||||
]);
|
||||
|
||||
$this->assertTrue($group->hasAddress('one@test.com'));
|
||||
@@ -215,10 +215,10 @@ class EmailAddressGroupTest extends \PHPUnit\Framework\TestCase
|
||||
public function testGetByAddress()
|
||||
{
|
||||
$group = EmailAddressGroup
|
||||
::fromList([
|
||||
EmailAddress::fromAddress('one@test.com'),
|
||||
EmailAddress::fromAddress('two@test.com'),
|
||||
EmailAddress::fromAddress('three@test.com'),
|
||||
::create([
|
||||
EmailAddress::create('one@test.com'),
|
||||
EmailAddress::create('two@test.com'),
|
||||
EmailAddress::create('three@test.com'),
|
||||
]);
|
||||
|
||||
$this->assertEquals('one@test.com', $group->getByAddress('one@test.com')->getAddress());
|
||||
@@ -229,10 +229,10 @@ class EmailAddressGroupTest extends \PHPUnit\Framework\TestCase
|
||||
public function testClone()
|
||||
{
|
||||
$group = EmailAddressGroup
|
||||
::fromList([
|
||||
EmailAddress::fromAddress('one@test.com'),
|
||||
EmailAddress::fromAddress('two@test.com'),
|
||||
EmailAddress::fromAddress('three@test.com'),
|
||||
::create([
|
||||
EmailAddress::create('one@test.com'),
|
||||
EmailAddress::create('two@test.com'),
|
||||
EmailAddress::create('three@test.com'),
|
||||
]);
|
||||
|
||||
$cloned = clone $group;
|
||||
|
||||
@@ -41,19 +41,19 @@ class EmailAddressTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
$this->expectException(RuntimeException::class);
|
||||
|
||||
EmailAddress::fromAddress('one');
|
||||
EmailAddress::create('one');
|
||||
}
|
||||
|
||||
public function testInvalidEmpty()
|
||||
{
|
||||
$this->expectException(RuntimeException::class);
|
||||
|
||||
EmailAddress::fromAddress('');
|
||||
EmailAddress::create('');
|
||||
}
|
||||
|
||||
public function testCloneInvalid()
|
||||
{
|
||||
$address = EmailAddress::fromAddress('test@test.com')->invalid();
|
||||
$address = EmailAddress::create('test@test.com')->invalid();
|
||||
|
||||
$this->assertEquals('test@test.com', $address->getAddress());
|
||||
|
||||
@@ -63,7 +63,7 @@ class EmailAddressTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testCloneOptedOut()
|
||||
{
|
||||
$address = EmailAddress::fromAddress('test@test.com')->optedOut();
|
||||
$address = EmailAddress::create('test@test.com')->optedOut();
|
||||
|
||||
$this->assertFalse($address->isInvalid());
|
||||
$this->assertTrue($address->isOptedOut());
|
||||
@@ -71,7 +71,7 @@ class EmailAddressTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testCloneNotOptedOut()
|
||||
{
|
||||
$address = EmailAddress::fromAddress('test@test.com')
|
||||
$address = EmailAddress::create('test@test.com')
|
||||
->optedOut()
|
||||
->notOptedOut()
|
||||
->invalid()
|
||||
|
||||
@@ -39,7 +39,7 @@ class LinkTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testCreate()
|
||||
{
|
||||
$value = Link::fromId('id');
|
||||
$value = Link::create('id');
|
||||
|
||||
$this->assertEquals('id', $value->getId());
|
||||
$this->assertEquals(null, $value->getName());
|
||||
@@ -49,12 +49,12 @@ class LinkTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
$this->expectException(RuntimeException::class);
|
||||
|
||||
Link::fromId('');
|
||||
Link::create('');
|
||||
}
|
||||
|
||||
public function testWithName()
|
||||
{
|
||||
$value = Link::fromId('id')->withName('Name');
|
||||
$value = Link::create('id')->withName('Name');
|
||||
|
||||
$this->assertEquals('Name', $value->getName());
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ class LinkMultipleTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testEmpty()
|
||||
{
|
||||
$value = LinkMultiple::fromNothing();
|
||||
$value = LinkMultiple::create();
|
||||
|
||||
$this->assertEquals(0, count($value->getIdList()));
|
||||
$this->assertEquals(0, count($value->getList()));
|
||||
@@ -52,20 +52,20 @@ class LinkMultipleTest extends \PHPUnit\Framework\TestCase
|
||||
$this->expectException(RuntimeException::class);
|
||||
|
||||
LinkMultiple
|
||||
::fromList([
|
||||
LinkMultipleItem::fromId('1'),
|
||||
LinkMultipleItem::fromId('1'),
|
||||
::create([
|
||||
LinkMultipleItem::create('1'),
|
||||
LinkMultipleItem::create('1'),
|
||||
]);
|
||||
}
|
||||
|
||||
public function testWithAdded1()
|
||||
{
|
||||
$item = LinkMultipleItem::fromId('1')->withName('test-1');
|
||||
$item = LinkMultipleItem::create('1')->withName('test-1');
|
||||
|
||||
$group = LinkMultiple
|
||||
::fromList([$item])
|
||||
::create([$item])
|
||||
->withAdded(
|
||||
LinkMultipleItem::fromId('2')
|
||||
LinkMultipleItem::create('2')
|
||||
);
|
||||
|
||||
$this->assertEquals(2, $group->getCount());
|
||||
@@ -79,10 +79,10 @@ class LinkMultipleTest extends \PHPUnit\Framework\TestCase
|
||||
public function testWithAddedList()
|
||||
{
|
||||
$group = LinkMultiple
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withAddedList([
|
||||
LinkMultipleItem::fromId('1'),
|
||||
LinkMultipleItem::fromId('2'),
|
||||
LinkMultipleItem::create('1'),
|
||||
LinkMultipleItem::create('2'),
|
||||
]);
|
||||
|
||||
$this->assertEquals(2, $group->getCount());
|
||||
@@ -91,12 +91,12 @@ class LinkMultipleTest extends \PHPUnit\Framework\TestCase
|
||||
public function testWithRemoved1()
|
||||
{
|
||||
$group = LinkMultiple
|
||||
::fromList([
|
||||
LinkMultipleItem::fromId('1'),
|
||||
LinkMultipleItem::fromId('2'),
|
||||
LinkMultipleItem::fromId('3'),
|
||||
::create([
|
||||
LinkMultipleItem::create('1'),
|
||||
LinkMultipleItem::create('2'),
|
||||
LinkMultipleItem::create('3'),
|
||||
])
|
||||
->withRemoved(LinkMultipleItem::fromId('1'));
|
||||
->withRemoved(LinkMultipleItem::create('1'));
|
||||
|
||||
$this->assertEquals(2, $group->getCount());
|
||||
}
|
||||
@@ -104,10 +104,10 @@ class LinkMultipleTest extends \PHPUnit\Framework\TestCase
|
||||
public function testGetById()
|
||||
{
|
||||
$group = LinkMultiple
|
||||
::fromList([
|
||||
LinkMultipleItem::fromId('1'),
|
||||
LinkMultipleItem::fromId('2'),
|
||||
LinkMultipleItem::fromId('3'),
|
||||
::create([
|
||||
LinkMultipleItem::create('1'),
|
||||
LinkMultipleItem::create('2'),
|
||||
LinkMultipleItem::create('3'),
|
||||
]);
|
||||
|
||||
$this->assertEquals('1', $group->getById('1')->getId());
|
||||
@@ -118,10 +118,10 @@ class LinkMultipleTest extends \PHPUnit\Framework\TestCase
|
||||
public function testClone()
|
||||
{
|
||||
$group = LinkMultiple
|
||||
::fromList([
|
||||
LinkMultipleItem::fromId('1'),
|
||||
LinkMultipleItem::fromId('2'),
|
||||
LinkMultipleItem::fromId('3'),
|
||||
::create([
|
||||
LinkMultipleItem::create('1'),
|
||||
LinkMultipleItem::create('2'),
|
||||
LinkMultipleItem::create('3'),
|
||||
]);
|
||||
|
||||
$cloned = clone $group;
|
||||
@@ -134,7 +134,7 @@ class LinkMultipleTest extends \PHPUnit\Framework\TestCase
|
||||
public function testItemColumn()
|
||||
{
|
||||
$item = LinkMultipleItem
|
||||
::fromId('1')
|
||||
::create('1')
|
||||
->withColumnValue('key', 'value');
|
||||
|
||||
$this->assertTrue($item->hasColumnValue('key'));
|
||||
|
||||
@@ -39,7 +39,7 @@ class LinkParentTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testCreate()
|
||||
{
|
||||
$value = LinkParent::fromEntityTypeAndId('Test', 'id');
|
||||
$value = LinkParent::create('Test', 'id');
|
||||
|
||||
$this->assertEquals('Test', $value->getEntityType());
|
||||
$this->assertEquals('id', $value->getId());
|
||||
@@ -50,19 +50,19 @@ class LinkParentTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
$this->expectException(RuntimeException::class);
|
||||
|
||||
LinkParent::fromEntityTypeAndId('Test', '');
|
||||
LinkParent::create('Test', '');
|
||||
}
|
||||
|
||||
public function testBad2()
|
||||
{
|
||||
$this->expectException(RuntimeException::class);
|
||||
|
||||
LinkParent::fromEntityTypeAndId('', 'id');
|
||||
LinkParent::create('', 'id');
|
||||
}
|
||||
|
||||
public function testWithName()
|
||||
{
|
||||
$value = LinkParent::fromEntityTypeAndId('Test', 'id')->withName('Name');
|
||||
$value = LinkParent::create('Test', 'id')->withName('Name');
|
||||
|
||||
$this->assertEquals('Name', $value->getName());
|
||||
}
|
||||
|
||||
@@ -40,9 +40,9 @@ class PhoneNumberGroupAttributeExtractorTest extends \PHPUnit\Framework\TestCase
|
||||
public function testExtract()
|
||||
{
|
||||
$group = PhoneNumberGroup
|
||||
::fromList([
|
||||
PhoneNumber::fromNumber('+1')->withType('Test-1'),
|
||||
PhoneNumber::fromNumber('+2')->withType('Test-2')->optedOut(),
|
||||
::create([
|
||||
PhoneNumber::create('+1')->withType('Test-1'),
|
||||
PhoneNumber::create('+2')->withType('Test-2')->optedOut(),
|
||||
]);
|
||||
|
||||
$valueMap = (new PhoneNumberGroupAttributeExtractor())->extract($group, 'phoneNumber');
|
||||
@@ -74,7 +74,7 @@ class PhoneNumberGroupAttributeExtractorTest extends \PHPUnit\Framework\TestCase
|
||||
public function testEmpty()
|
||||
{
|
||||
$group = PhoneNumberGroup
|
||||
::fromList([]);
|
||||
::create([]);
|
||||
|
||||
$valueMap = (new PhoneNumberGroupAttributeExtractor())->extract($group, 'phoneNumber');
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class PhoneNumberGroupTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testEmpty()
|
||||
{
|
||||
$group = PhoneNumberGroup::fromNothing();
|
||||
$group = PhoneNumberGroup::create();
|
||||
|
||||
$this->assertEquals(0, count($group->getNumberList()));
|
||||
$this->assertEquals(0, count($group->getSecondaryList()));
|
||||
@@ -55,18 +55,18 @@ class PhoneNumberGroupTest extends \PHPUnit\Framework\TestCase
|
||||
$this->expectException(RuntimeException::class);
|
||||
|
||||
PhoneNumberGroup
|
||||
::fromList([
|
||||
PhoneNumber::fromNumber('+100'),
|
||||
PhoneNumber::fromNumber('+100'),
|
||||
::create([
|
||||
PhoneNumber::create('+100'),
|
||||
PhoneNumber::create('+100'),
|
||||
]);
|
||||
}
|
||||
|
||||
public function testWithPrimary1()
|
||||
{
|
||||
$primary = PhoneNumber::fromNumber('+000')->invalid();
|
||||
$primary = PhoneNumber::create('+000')->invalid();
|
||||
|
||||
$group = PhoneNumberGroup
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withPrimary($primary);
|
||||
|
||||
$this->assertEquals(1, count($group->getList()));
|
||||
@@ -76,7 +76,7 @@ class PhoneNumberGroupTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
$this->assertEquals('+000', $group->getPrimary()->getNumber());
|
||||
|
||||
$primaryAnother = PhoneNumber::fromNumber('+001');
|
||||
$primaryAnother = PhoneNumber::create('+001');
|
||||
|
||||
$groupAnother = $group->withPrimary($primaryAnother);
|
||||
|
||||
@@ -94,15 +94,15 @@ class PhoneNumberGroupTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testWithPrimary2()
|
||||
{
|
||||
$number = PhoneNumber::fromNumber('+100')->invalid();
|
||||
$number = PhoneNumber::create('+100')->invalid();
|
||||
|
||||
$group = PhoneNumberGroup
|
||||
::fromList([$number])
|
||||
::create([$number])
|
||||
->withAdded(
|
||||
PhoneNumber::fromNumber('+200')
|
||||
PhoneNumber::create('+200')
|
||||
)
|
||||
->withPrimary(
|
||||
PhoneNumber::fromNumber('+200')
|
||||
PhoneNumber::create('+200')
|
||||
);
|
||||
|
||||
$this->assertEquals('+200', $group->getPrimary()->getNumber());
|
||||
@@ -112,12 +112,12 @@ class PhoneNumberGroupTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testWithAdded1()
|
||||
{
|
||||
$number = PhoneNumber::fromNumber('+100')->invalid();
|
||||
$number = PhoneNumber::create('+100')->invalid();
|
||||
|
||||
$group = PhoneNumberGroup
|
||||
::fromList([$number])
|
||||
::create([$number])
|
||||
->withAdded(
|
||||
PhoneNumber::fromNumber('+200')
|
||||
PhoneNumber::create('+200')
|
||||
);
|
||||
|
||||
$this->assertEquals('+100', $group->getPrimary()->getNumber());
|
||||
@@ -130,10 +130,10 @@ class PhoneNumberGroupTest extends \PHPUnit\Framework\TestCase
|
||||
public function testWithAddedList()
|
||||
{
|
||||
$group = PhoneNumberGroup
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withAddedList([
|
||||
PhoneNumber::fromNumber('+100'),
|
||||
PhoneNumber::fromNumber('+200'),
|
||||
PhoneNumber::create('+100'),
|
||||
PhoneNumber::create('+200'),
|
||||
]);
|
||||
|
||||
$this->assertEquals('+100', $group->getPrimary()->getNumber());
|
||||
@@ -144,12 +144,12 @@ class PhoneNumberGroupTest extends \PHPUnit\Framework\TestCase
|
||||
public function testWithRemoved1()
|
||||
{
|
||||
$group = PhoneNumberGroup
|
||||
::fromList([
|
||||
PhoneNumber::fromNumber('+100'),
|
||||
PhoneNumber::fromNumber('+200'),
|
||||
PhoneNumber::fromNumber('+300'),
|
||||
::create([
|
||||
PhoneNumber::create('+100'),
|
||||
PhoneNumber::create('+200'),
|
||||
PhoneNumber::create('+300'),
|
||||
])
|
||||
->withRemoved(PhoneNumber::fromNumber('+200'));
|
||||
->withRemoved(PhoneNumber::create('+200'));
|
||||
|
||||
$this->assertEquals('+100', $group->getPrimary()->getNumber());
|
||||
|
||||
@@ -159,12 +159,12 @@ class PhoneNumberGroupTest extends \PHPUnit\Framework\TestCase
|
||||
public function testWithRemoved2()
|
||||
{
|
||||
$group = PhoneNumberGroup
|
||||
::fromList([
|
||||
PhoneNumber::fromNumber('+100'),
|
||||
PhoneNumber::fromNumber('+200'),
|
||||
PhoneNumber::fromNumber('+300'),
|
||||
::create([
|
||||
PhoneNumber::create('+100'),
|
||||
PhoneNumber::create('+200'),
|
||||
PhoneNumber::create('+300'),
|
||||
])
|
||||
->withRemoved(PhoneNumber::fromNumber('+100'));
|
||||
->withRemoved(PhoneNumber::create('+100'));
|
||||
|
||||
$this->assertEquals('+200', $group->getPrimary()->getNumber());
|
||||
|
||||
@@ -174,10 +174,10 @@ class PhoneNumberGroupTest extends \PHPUnit\Framework\TestCase
|
||||
public function testWithRemoved3()
|
||||
{
|
||||
$group = PhoneNumberGroup
|
||||
::fromList([
|
||||
PhoneNumber::fromNumber('+100'),
|
||||
::create([
|
||||
PhoneNumber::create('+100'),
|
||||
])
|
||||
->withRemoved(PhoneNumber::fromNumber('+100'));
|
||||
->withRemoved(PhoneNumber::create('+100'));
|
||||
|
||||
$this->assertNull($group->getPrimary());
|
||||
|
||||
@@ -189,9 +189,9 @@ class PhoneNumberGroupTest extends \PHPUnit\Framework\TestCase
|
||||
public function testHasNumber()
|
||||
{
|
||||
$group = PhoneNumberGroup
|
||||
::fromList([
|
||||
PhoneNumber::fromNumber('+100'),
|
||||
PhoneNumber::fromNumber('+200'),
|
||||
::create([
|
||||
PhoneNumber::create('+100'),
|
||||
PhoneNumber::create('+200'),
|
||||
]);
|
||||
|
||||
$this->assertTrue($group->hasNumber('+100'));
|
||||
@@ -203,10 +203,10 @@ class PhoneNumberGroupTest extends \PHPUnit\Framework\TestCase
|
||||
public function testGetByNumber()
|
||||
{
|
||||
$group = PhoneNumberGroup
|
||||
::fromList([
|
||||
PhoneNumber::fromNumber('+100'),
|
||||
PhoneNumber::fromNumber('+200'),
|
||||
PhoneNumber::fromNumber('+300'),
|
||||
::create([
|
||||
PhoneNumber::create('+100'),
|
||||
PhoneNumber::create('+200'),
|
||||
PhoneNumber::create('+300'),
|
||||
]);
|
||||
|
||||
$this->assertEquals('+100', $group->getByNumber('+100')->getNumber());
|
||||
@@ -217,10 +217,10 @@ class PhoneNumberGroupTest extends \PHPUnit\Framework\TestCase
|
||||
public function testClone()
|
||||
{
|
||||
$group = PhoneNumberGroup
|
||||
::fromList([
|
||||
PhoneNumber::fromNumber('+100'),
|
||||
PhoneNumber::fromNumber('+200'),
|
||||
PhoneNumber::fromNumber('+300'),
|
||||
::create([
|
||||
PhoneNumber::create('+100'),
|
||||
PhoneNumber::create('+200'),
|
||||
PhoneNumber::create('+300'),
|
||||
]);
|
||||
|
||||
$cloned = clone $group;
|
||||
|
||||
@@ -41,12 +41,12 @@ class PhoneNumberTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
$this->expectException(RuntimeException::class);
|
||||
|
||||
PhoneNumber::fromNumber('');
|
||||
PhoneNumber::create('');
|
||||
}
|
||||
|
||||
public function testCloneInvalid()
|
||||
{
|
||||
$number = PhoneNumber::fromNumber('+100')->invalid();
|
||||
$number = PhoneNumber::create('+100')->invalid();
|
||||
|
||||
$this->assertEquals('+100', $number->getNumber());
|
||||
|
||||
@@ -58,7 +58,7 @@ class PhoneNumberTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testCloneOptedOut()
|
||||
{
|
||||
$number = PhoneNumber::fromNumber('+100')->optedOut();
|
||||
$number = PhoneNumber::create('+100')->optedOut();
|
||||
|
||||
$this->assertFalse($number->isInvalid());
|
||||
$this->assertTrue($number->isOptedOut());
|
||||
@@ -66,7 +66,7 @@ class PhoneNumberTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testCloneWithType()
|
||||
{
|
||||
$number = PhoneNumber::fromNumberAndType('+100', 'Office');
|
||||
$number = PhoneNumber::createWithType('+100', 'Office');
|
||||
|
||||
$this->assertEquals('+100', $number->getNumber());
|
||||
$this->assertEquals('Office', $number->getType());
|
||||
@@ -74,7 +74,7 @@ class PhoneNumberTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testCloneNotOptedOut()
|
||||
{
|
||||
$number = PhoneNumber::fromNumber('+100')
|
||||
$number = PhoneNumber::create('+100')
|
||||
->optedOut()
|
||||
->notOptedOut()
|
||||
->invalid()
|
||||
|
||||
@@ -42,7 +42,7 @@ class QueueProcessorParamsTest extends \PHPUnit\Framework\TestCase
|
||||
public function testParams1()
|
||||
{
|
||||
$params = QueueProcessorParams
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withLimit(10);
|
||||
|
||||
$this->assertFalse($params->useProcessPool());
|
||||
@@ -56,7 +56,7 @@ class QueueProcessorParamsTest extends \PHPUnit\Framework\TestCase
|
||||
public function testParams2()
|
||||
{
|
||||
$params = QueueProcessorParams
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withLimit(10)
|
||||
->withUseProcessPool(true)
|
||||
->withNoLock(true)
|
||||
|
||||
@@ -60,7 +60,7 @@ class ParamsTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testFromIds()
|
||||
{
|
||||
$params = Params::fromIds('Test', ['1']);
|
||||
$params = Params::createWithIds('Test', ['1']);
|
||||
|
||||
$this->assertEquals('Test', $params->getEntityType());
|
||||
|
||||
@@ -71,7 +71,7 @@ class ParamsTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
$searchParams = $this->createMock(SearchParams::class);
|
||||
|
||||
$params = Params::fromSearchParams('Test', $searchParams);
|
||||
$params = Params::createWithSearchParams('Test', $searchParams);
|
||||
|
||||
$this->assertEquals('Test', $params->getEntityType());
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ class SearchParamsTest extends \PHPUnit\Framework\TestCase
|
||||
];
|
||||
|
||||
$params = SearchParams
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withBoolFilterList(['a'])
|
||||
->withMaxSize(10)
|
||||
->withOffset(0)
|
||||
@@ -333,7 +333,7 @@ class SearchParamsTest extends \PHPUnit\Framework\TestCase
|
||||
public function testWithWhereAdded1(): void
|
||||
{
|
||||
$params = SearchParams
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withWhere(
|
||||
WhereItem::fromRaw([
|
||||
'type' => 'isTrue',
|
||||
@@ -374,7 +374,7 @@ class SearchParamsTest extends \PHPUnit\Framework\TestCase
|
||||
public function testWithWhereAdded2(): void
|
||||
{
|
||||
$params = SearchParams
|
||||
::fromNothing()
|
||||
::create()
|
||||
->withWhereAdded(
|
||||
WhereItem::fromRaw([
|
||||
'type' => 'isTrue',
|
||||
|
||||
Reference in New Issue
Block a user