fixed tests

This commit is contained in:
Denis Duliçi 2020-06-08 23:40:04 +03:00
parent 5e51b494d2
commit e715ec6b01

View File

@ -6,12 +6,16 @@ trait Contacts
{ {
public function isCustomer() public function isCustomer()
{ {
return in_array($this->type, $this->getCustomerTypes()); $type = $this->type ?? $this->contact->type ?? 'customer';
return in_array($type, $this->getCustomerTypes());
} }
public function isVendor() public function isVendor()
{ {
return in_array($this->type, $this->getVendorTypes()); $type = $this->type ?? $this->contact->type ?? 'vendor';
return in_array($type, $this->getVendorTypes());
} }
public function getCustomerTypes($return = 'array') public function getCustomerTypes($return = 'array')