From 8a9385bb2e37c128a3a000d2a2186e1e5f2aabf3 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 25 Dec 2022 00:06:17 +0100 Subject: [PATCH] test fixes and changes for release --- Models/Supplier.php | 55 ++++++++++++++++++++++++++++++++++++++++++++- tests/Bootstrap.php | 19 ++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/Models/Supplier.php b/Models/Supplier.php index 39ff819..ad88cac 100755 --- a/Models/Supplier.php +++ b/Models/Supplier.php @@ -22,6 +22,7 @@ use Modules\Media\Models\NullMedia; use Modules\Profile\Models\ContactElement; use Modules\Profile\Models\NullContactElement; use Modules\Profile\Models\Profile; +use Modules\Admin\Models\Account; /** * Supplier class. @@ -58,7 +59,7 @@ class Supplier /** * Attributes. * - * @var int[]|SupplierAttribute[] + * @var SupplierAttribute[] * @since 1.0.0 */ private array $attributes = []; @@ -221,6 +222,58 @@ class Supplier return $this->address; } + /** + * Add partner + * + * @param Account $partner Partner + * + * @return void + * + * @since 1.0.0 + */ + public function addPartner(Account $partner) : void + { + $this->partners[] = $partner; + } + + /** + * Get partners + * + * @return Account[] + * + * @since 1.0.0 + */ + public function getPartners() : array + { + return $this->partners; + } + + /** + * Add attribute to supplier + * + * @param SupplierAttribute $attribute Attribute + * + * @return void + * + * @since 1.0.0 + */ + public function addAttribute(SupplierAttribute $attribute) : void + { + $this->attributes[] = $attribute; + } + + /** + * Get attributes + * + * @return SupplierAttribute[] + * + * @since 1.0.0 + */ + public function getAttributes() : array + { + return $this->attributes; + } + /** * Get contacts. * diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index d46fd31..b5d36a8 100755 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -257,6 +257,25 @@ $CONFIG = [ 'root' => '/', 'https' => false, ], + 'app' => [ + 'path' => __DIR__, + 'default' => [ + 'app' => 'Backend', + 'id' => 'backend', + 'lang' => 'en', + 'theme' => 'Backend', + 'org' => 1, + ], + 'domains' => [ + '127.0.0.1' => [ + 'app' => 'Backend', + 'id' => 'backend', + 'lang' => 'en', + 'theme' => 'Backend', + 'org' => 1, + ], + ], + ], 'socket' => [ 'master' => [ 'host' => '127.0.0.1',