diff --git a/bin/doctrine b/bin/doctrine
index 9f213bc..cf20dbe 100644
--- a/bin/doctrine
+++ b/bin/doctrine
@@ -1,12 +1,11 @@
#!/usr/bin/env php
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/config/doctrine/xml/TestUser.dcm.xml b/config/doctrine/xml/TestUser.dcm.xml
deleted file mode 100644
index 6e330dc..0000000
--- a/config/doctrine/xml/TestUser.dcm.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/config/xml/Bitrix24.Lib.Bitrix24Accounts.Entity.Bitrix24Account.dcm.xml b/config/xml/Bitrix24.Lib.Bitrix24Accounts.Entity.Bitrix24Account.dcm.xml
new file mode 100644
index 0000000..671cb2d
--- /dev/null
+++ b/config/xml/Bitrix24.Lib.Bitrix24Accounts.Entity.Bitrix24Account.dcm.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/config/xml/Bitrix24.Lib.Bitrix24Accounts.Entity.TestUser.dcm.xml b/config/xml/Bitrix24.Lib.Bitrix24Accounts.Entity.TestUser.dcm.xml
new file mode 100644
index 0000000..2d30540
--- /dev/null
+++ b/config/xml/Bitrix24.Lib.Bitrix24Accounts.Entity.TestUser.dcm.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/config/xml/Bitrix24.SDK.Core.Credentials.AuthToken.dcm.xml b/config/xml/Bitrix24.SDK.Core.Credentials.AuthToken.dcm.xml
new file mode 100644
index 0000000..b2498a7
--- /dev/null
+++ b/config/xml/Bitrix24.SDK.Core.Credentials.AuthToken.dcm.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Bitrix24Accounts/Entity/Bitrix24Account.php b/src/Bitrix24Accounts/Entity/Bitrix24Account.php
index 31b9d24..b0f066e 100644
--- a/src/Bitrix24Accounts/Entity/Bitrix24Account.php
+++ b/src/Bitrix24Accounts/Entity/Bitrix24Account.php
@@ -10,7 +10,7 @@
declare(strict_types=1);
-namespace Bitrix24\SDK\Lib\Bitrix24Accounts\Entity;
+namespace Bitrix24\Lib\Bitrix24Accounts\Entity;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity\Bitrix24AccountInterface;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity\Bitrix24AccountStatus;
@@ -25,8 +25,9 @@
use Bitrix24\SDK\Core\Exceptions\InvalidArgumentException;
use Bitrix24\SDK\Core\Exceptions\UnknownScopeCodeException;
use Bitrix24\SDK\Core\Response\DTO\RenewedAuthToken;
-use Bitrix24\SDK\Lib\Bitrix24Accounts\Infrastructure\Doctrine\Bitrix24AccountRepository;
+use Bitrix24\Lib\Bitrix24Accounts\Infrastructure\Doctrine\Bitrix24AccountRepository;
use Carbon\CarbonImmutable;
+use Doctrine\ORM\Mapping\Embedded;
use Override;
use Symfony\Bridge\Doctrine\Types\UuidType;
use Symfony\Component\Serializer\Annotation\Ignore;
@@ -50,6 +51,8 @@ class Bitrix24Account implements Bitrix24AccountInterface, AggregateRootEventsEm
private ?string $comment = null;
+ private AuthToken $authToken;
+
/**
* @var Event[]
*/
@@ -74,7 +77,7 @@ public function __construct(
private string $domainUrl,
#[ORM\Column(name: 'account_status', type: 'string', nullable: false, enumType: Bitrix24AccountStatus::class)]
private Bitrix24AccountStatus $accountStatus,
- AuthToken $authToken,
+ AuthToken $authToken,
#[ORM\Column(name: 'created_at_utc', type: 'carbon_immutable', precision: 3, nullable: false)]
#[Ignore]
private readonly CarbonImmutable $createdAt,
@@ -87,6 +90,7 @@ public function __construct(
Scope $applicationScope,
)
{
+ $this->authToken = $authToken;
$this->accessToken = $authToken->accessToken;
$this->refreshToken = $authToken->refreshToken;
$this->expires = $authToken->expires;
diff --git a/src/Bitrix24Accounts/Entity/TestUser.php b/src/Bitrix24Accounts/Entity/TestUser.php
index 51a1543..216d1f2 100644
--- a/src/Bitrix24Accounts/Entity/TestUser.php
+++ b/src/Bitrix24Accounts/Entity/TestUser.php
@@ -1,7 +1,7 @@
password = $password;
}
+
public function getId(): int
{
return $this->id;
diff --git a/src/Bitrix24Accounts/Exceptions/MultipleBitrix24AccountsFoundException.php b/src/Bitrix24Accounts/Exceptions/MultipleBitrix24AccountsFoundException.php
index e545dc2..8ec97fb 100644
--- a/src/Bitrix24Accounts/Exceptions/MultipleBitrix24AccountsFoundException.php
+++ b/src/Bitrix24Accounts/Exceptions/MultipleBitrix24AccountsFoundException.php
@@ -2,7 +2,7 @@
declare(strict_types=1);
-namespace Bitrix24\SDK\Lib\Bitrix24Accounts\Exceptions;
+namespace Bitrix24\Lib\Bitrix24Accounts\Exceptions;
use DomainException;
diff --git a/src/Bitrix24Accounts/Infrastructure/Doctrine/Bitrix24AccountRepository.php b/src/Bitrix24Accounts/Infrastructure/Doctrine/Bitrix24AccountRepository.php
index 08f7978..b512f42 100644
--- a/src/Bitrix24Accounts/Infrastructure/Doctrine/Bitrix24AccountRepository.php
+++ b/src/Bitrix24Accounts/Infrastructure/Doctrine/Bitrix24AccountRepository.php
@@ -2,16 +2,16 @@
declare(strict_types=1);
-namespace Bitrix24\SDK\Lib\Bitrix24Accounts\Infrastructure\Doctrine;
+namespace Bitrix24\Lib\Bitrix24Accounts\Infrastructure\Doctrine;
+use Bitrix24\Lib\Bitrix24Accounts\Entity\Bitrix24Account;
+use Bitrix24\Lib\Bitrix24Accounts\UseCase\SaveAccount\Handler;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity\Bitrix24AccountInterface;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity\Bitrix24AccountStatus;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Exceptions\Bitrix24AccountNotFoundException;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Repository\Bitrix24AccountRepositoryInterface;
use Bitrix24\SDK\Application\Contracts\Events\AggregateRootEventsEmitterInterface;
use Bitrix24\SDK\Core\Exceptions\InvalidArgumentException;
-use Bitrix24\SDK\Lib\Bitrix24Accounts\Entity\Bitrix24Account;
-use Bitrix24\SDK\Lib\Bitrix24Accounts\UseCase\Command\Flusher;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Override;
@@ -19,14 +19,11 @@
class Bitrix24AccountRepository extends EntityRepository implements Bitrix24AccountRepositoryInterface
{
- private Flusher $flusher;
public function __construct(
- EntityManagerInterface $entityManager,
- Flusher $flusher
+ EntityManagerInterface $entityManager
)
{
parent::__construct($entityManager, $entityManager->getClassMetadata(Bitrix24Account::class));
- $this->flusher = $flusher;
}
/**
@@ -51,9 +48,9 @@ public function getById(Uuid $uuid): Bitrix24AccountInterface
public function save(Bitrix24AccountInterface $bitrix24Account): void
{
$this->getEntityManager()->persist($bitrix24Account);
+
//todo discuss add flush arg to contract or add flusher in usecases?
// $this->getEntityManager()->flush();
- $this->flusher->flush();
}
/**
diff --git a/src/Bitrix24Accounts/ReadModel/Fetcher.php b/src/Bitrix24Accounts/ReadModel/Fetcher.php
index 45b2e6b..03ed4dc 100644
--- a/src/Bitrix24Accounts/ReadModel/Fetcher.php
+++ b/src/Bitrix24Accounts/ReadModel/Fetcher.php
@@ -2,7 +2,7 @@
declare(strict_types=1);
-namespace Bitrix24\SDK\Lib\Bitrix24Accounts\ReadModel;
+namespace Bitrix24\Lib\Bitrix24Accounts\ReadModel;
use Doctrine\ORM\EntityManagerInterface;
use Knp\Component\Pager\Pagination\PaginationInterface;
diff --git a/src/Bitrix24Accounts/UseCase/ChangeDomainUrl/Command.php b/src/Bitrix24Accounts/UseCase/ChangeDomainUrl/Command.php
index a753b89..c1789b7 100644
--- a/src/Bitrix24Accounts/UseCase/ChangeDomainUrl/Command.php
+++ b/src/Bitrix24Accounts/UseCase/ChangeDomainUrl/Command.php
@@ -2,7 +2,7 @@
declare(strict_types=1);
-namespace Bitrix24\SDK\Lib\Bitrix24Accounts\UseCase\ChangeDomainUrl;
+namespace Bitrix24\Lib\Bitrix24Accounts\UseCase\ChangeDomainUrl;
readonly class Command
{
diff --git a/src/Bitrix24Accounts/UseCase/ChangeDomainUrl/Handler.php b/src/Bitrix24Accounts/UseCase/ChangeDomainUrl/Handler.php
index c9ad2e7..a762104 100644
--- a/src/Bitrix24Accounts/UseCase/ChangeDomainUrl/Handler.php
+++ b/src/Bitrix24Accounts/UseCase/ChangeDomainUrl/Handler.php
@@ -2,7 +2,7 @@
declare(strict_types=1);
-namespace Bitrix24\SDK\Lib\Bitrix24Accounts\UseCase\ChangeDomainUrl;
+namespace Bitrix24\Lib\Bitrix24Accounts\UseCase\ChangeDomainUrl;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity\Bitrix24AccountInterface;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Repository\Bitrix24AccountRepositoryInterface;
diff --git a/src/Bitrix24Accounts/UseCase/InstallFinish/Command.php b/src/Bitrix24Accounts/UseCase/InstallFinish/Command.php
index fb9d84f..a5f66e6 100644
--- a/src/Bitrix24Accounts/UseCase/InstallFinish/Command.php
+++ b/src/Bitrix24Accounts/UseCase/InstallFinish/Command.php
@@ -2,7 +2,7 @@
declare(strict_types=1);
-namespace Bitrix24\SDK\Lib\Bitrix24Accounts\UseCase\InstallFinish;
+namespace Bitrix24\Lib\Bitrix24Accounts\UseCase\InstallFinish;
use Bitrix24\SDK\Core\Credentials\AuthToken;
use Bitrix24\SDK\Core\Credentials\Scope;
diff --git a/src/Bitrix24Accounts/UseCase/InstallFinish/Handler.php b/src/Bitrix24Accounts/UseCase/InstallFinish/Handler.php
index 5c50e18..60b62ab 100644
--- a/src/Bitrix24Accounts/UseCase/InstallFinish/Handler.php
+++ b/src/Bitrix24Accounts/UseCase/InstallFinish/Handler.php
@@ -2,14 +2,14 @@
declare(strict_types=1);
-namespace Bitrix24\SDK\Lib\Bitrix24Accounts\UseCase\InstallFinish;
+namespace Bitrix24\Lib\Bitrix24Accounts\UseCase\InstallFinish;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity\Bitrix24AccountInterface;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity\Bitrix24AccountStatus;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Exceptions\Bitrix24AccountNotFoundException;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Repository\Bitrix24AccountRepositoryInterface;
use Bitrix24\SDK\Application\Contracts\Events\AggregateRootEventsEmitterInterface;
-use Bitrix24\SDK\Lib\Bitrix24Accounts\Exceptions\MultipleBitrix24AccountsFoundException;
+use Bitrix24\Lib\Bitrix24Accounts\Exceptions\MultipleBitrix24AccountsFoundException;
use Psr\Log\LoggerInterface;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
diff --git a/src/Bitrix24Accounts/UseCase/InstallStart/Command.php b/src/Bitrix24Accounts/UseCase/InstallStart/Command.php
index 604b8e6..8b41877 100644
--- a/src/Bitrix24Accounts/UseCase/InstallStart/Command.php
+++ b/src/Bitrix24Accounts/UseCase/InstallStart/Command.php
@@ -2,7 +2,7 @@
declare(strict_types=1);
-namespace Bitrix24\SDK\Lib\Bitrix24Accounts\UseCase\InstallStart;
+namespace Bitrix24\Lib\Bitrix24Accounts\UseCase\InstallStart;
use Bitrix24\SDK\Core\Credentials\AuthToken;
use Bitrix24\SDK\Core\Credentials\Scope;
diff --git a/src/Bitrix24Accounts/UseCase/InstallStart/Handler.php b/src/Bitrix24Accounts/UseCase/InstallStart/Handler.php
index 0d3b811..739fcd1 100644
--- a/src/Bitrix24Accounts/UseCase/InstallStart/Handler.php
+++ b/src/Bitrix24Accounts/UseCase/InstallStart/Handler.php
@@ -2,12 +2,12 @@
declare(strict_types=1);
-namespace Bitrix24\SDK\Lib\Bitrix24Accounts\UseCase\InstallStart;
+namespace Bitrix24\Lib\Bitrix24Accounts\UseCase\InstallStart;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity\Bitrix24AccountStatus;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Events\Bitrix24AccountCreatedEvent;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Repository\Bitrix24AccountRepositoryInterface;
-use Bitrix24\SDK\Lib\Bitrix24Accounts\Entity\Bitrix24Account;
+use Bitrix24\Lib\Bitrix24Accounts\Entity\Bitrix24Account;
use Carbon\CarbonImmutable;
use Psr\Log\LoggerInterface;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
diff --git a/src/Bitrix24Accounts/UseCase/RenewAuthToken/Command.php b/src/Bitrix24Accounts/UseCase/RenewAuthToken/Command.php
index defa0f4..3f7fdc1 100644
--- a/src/Bitrix24Accounts/UseCase/RenewAuthToken/Command.php
+++ b/src/Bitrix24Accounts/UseCase/RenewAuthToken/Command.php
@@ -2,7 +2,7 @@
declare(strict_types=1);
-namespace Bitrix24\SDK\Lib\Bitrix24Accounts\UseCase\RenewAuthToken;
+namespace Bitrix24\Lib\Bitrix24Accounts\UseCase\RenewAuthToken;
use Bitrix24\SDK\Core\Response\DTO\RenewedAuthToken;
diff --git a/src/Bitrix24Accounts/UseCase/RenewAuthToken/Handler.php b/src/Bitrix24Accounts/UseCase/RenewAuthToken/Handler.php
index 1d38849..81c6a0a 100644
--- a/src/Bitrix24Accounts/UseCase/RenewAuthToken/Handler.php
+++ b/src/Bitrix24Accounts/UseCase/RenewAuthToken/Handler.php
@@ -2,14 +2,14 @@
declare(strict_types=1);
-namespace Bitrix24\SDK\Lib\Bitrix24Accounts\UseCase\RenewAuthToken;
+namespace Bitrix24\Lib\Bitrix24Accounts\UseCase\RenewAuthToken;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity\Bitrix24AccountInterface;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity\Bitrix24AccountStatus;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Exceptions\Bitrix24AccountNotFoundException;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Repository\Bitrix24AccountRepositoryInterface;
use Bitrix24\SDK\Application\Contracts\Events\AggregateRootEventsEmitterInterface;
-use Bitrix24\SDK\Lib\Bitrix24Accounts\Exceptions\MultipleBitrix24AccountsFoundException;
+use Bitrix24\Lib\Bitrix24Accounts\Exceptions\MultipleBitrix24AccountsFoundException;
use Psr\Log\LoggerInterface;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
diff --git a/src/Bitrix24Accounts/UseCase/SaveAccount/Command.php b/src/Bitrix24Accounts/UseCase/SaveAccount/Command.php
new file mode 100644
index 0000000..04742a6
--- /dev/null
+++ b/src/Bitrix24Accounts/UseCase/SaveAccount/Command.php
@@ -0,0 +1,14 @@
+bitrix24AccountRepository->save($command->bitrix24AccountRepository);
+
+ $this->flusher->flush();
+ }
+}
\ No newline at end of file
diff --git a/src/Bitrix24Accounts/UseCase/Uninstall/Command.php b/src/Bitrix24Accounts/UseCase/Uninstall/Command.php
index 37c7813..d0bd745 100644
--- a/src/Bitrix24Accounts/UseCase/Uninstall/Command.php
+++ b/src/Bitrix24Accounts/UseCase/Uninstall/Command.php
@@ -2,7 +2,7 @@
declare(strict_types=1);
-namespace Bitrix24\SDK\Lib\Bitrix24Accounts\UseCase\Uninstall;
+namespace Bitrix24\Lib\Bitrix24Accounts\UseCase\Uninstall;
use Bitrix24\SDK\Core\Credentials\AuthToken;
use Bitrix24\SDK\Core\Credentials\Scope;
diff --git a/src/Bitrix24Accounts/UseCase/Uninstall/Handler.php b/src/Bitrix24Accounts/UseCase/Uninstall/Handler.php
index 6218f19..73b510a 100644
--- a/src/Bitrix24Accounts/UseCase/Uninstall/Handler.php
+++ b/src/Bitrix24Accounts/UseCase/Uninstall/Handler.php
@@ -2,7 +2,7 @@
declare(strict_types=1);
-namespace Bitrix24\SDK\Lib\Bitrix24Accounts\UseCase\Uninstall;
+namespace Bitrix24\Lib\Bitrix24Accounts\UseCase\Uninstall;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity\Bitrix24AccountInterface;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity\Bitrix24AccountStatus;
@@ -10,8 +10,8 @@
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Repository\Bitrix24AccountRepositoryInterface;
use Bitrix24\SDK\Application\Contracts\Events\AggregateRootEventsEmitterInterface;
use Bitrix24\SDK\Core\Exceptions\InvalidArgumentException;
-use Bitrix24\SDK\Lib\Bitrix24Accounts\Exceptions\MultipleBitrix24AccountsFoundException;
-use Bitrix24\SDK\Lib\Bitrix24Accounts\UseCase\Uninstall\Command;
+use Bitrix24\Lib\Bitrix24Accounts\Exceptions\MultipleBitrix24AccountsFoundException;
+use Bitrix24\Lib\Bitrix24Accounts\UseCase\Uninstall\Command;
use Psr\Log\LoggerInterface;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
diff --git a/src/Bitrix24Accounts/UseCase/Command/Flusher.php b/src/Services/Flusher.php
similarity index 80%
rename from src/Bitrix24Accounts/UseCase/Command/Flusher.php
rename to src/Services/Flusher.php
index c832cb6..292e7d4 100644
--- a/src/Bitrix24Accounts/UseCase/Command/Flusher.php
+++ b/src/Services/Flusher.php
@@ -2,7 +2,7 @@
declare(strict_types=1);
-namespace Bitrix24\SDK\Lib\Bitrix24Accounts\UseCase\Command;
+namespace Bitrix24\Lib\Services;
use Doctrine\ORM\EntityManagerInterface;
diff --git a/tests/EntityManagerFactory.php b/tests/EntityManagerFactory.php
index e0de768..2475265 100644
--- a/tests/EntityManagerFactory.php
+++ b/tests/EntityManagerFactory.php
@@ -2,7 +2,7 @@
declare(strict_types=1);
-namespace Bitrix24\SDK\Lib\Tests;
+namespace Bitrix24\Lib\Tests;
use Bitrix24\SDK\Core\Exceptions\WrongConfigurationException;
use Carbon\Doctrine\CarbonImmutableType;
@@ -17,6 +17,7 @@
use Doctrine\ORM\ORMSetup;
use Doctrine\DBAL\Types\Type;
+
class EntityManagerFactory
{
/**
@@ -27,11 +28,11 @@ class EntityManagerFactory
*/
public static function get(): EntityManagerInterface
{
- /*$paths = [
+ /* $paths = [
dirname(__DIR__) . '/src/Bitrix24Accounts/Entity'
];*/
$paths = [
- dirname(__DIR__) . '/config/doctrine/xml'
+ dirname(__DIR__) . '/config/xml'
];
$isDevMode = true;
diff --git a/tests/Functional/Bitrix24Accounts/Infrastructure/Doctrine/Bitrix24AccountRepositoryTest.php b/tests/Functional/Bitrix24Accounts/Infrastructure/Doctrine/Bitrix24AccountRepositoryTest.php
index c80fdca..24fbfd4 100644
--- a/tests/Functional/Bitrix24Accounts/Infrastructure/Doctrine/Bitrix24AccountRepositoryTest.php
+++ b/tests/Functional/Bitrix24Accounts/Infrastructure/Doctrine/Bitrix24AccountRepositoryTest.php
@@ -11,17 +11,17 @@
declare(strict_types=1);
-namespace Bitrix24\SDK\Lib\Tests\Functional\Bitrix24Accounts\Infrastructure\Doctrine;
+namespace Bitrix24\Lib\Tests\Functional\Bitrix24Accounts\Infrastructure\Doctrine;
+use Bitrix24\Lib\Bitrix24Accounts\Entity\Bitrix24Account;
+use Bitrix24\Lib\Bitrix24Accounts\Infrastructure\Doctrine\Bitrix24AccountRepository;
+use Bitrix24\Lib\Services\Flusher;
+use Bitrix24\Lib\Tests\EntityManagerFactory;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity\Bitrix24AccountInterface;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity\Bitrix24AccountStatus;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Repository\Bitrix24AccountRepositoryInterface;
-use Bitrix24\SDK\Lib\Bitrix24Accounts\Entity\Bitrix24Account;
use Bitrix24\SDK\Core\Credentials\AuthToken;
use Bitrix24\SDK\Core\Credentials\Scope;
-use Bitrix24\SDK\Lib\Bitrix24Accounts\Infrastructure\Doctrine\Bitrix24AccountRepository;
-use Bitrix24\SDK\Lib\Bitrix24Accounts\UseCase\Command\Flusher;
-use Bitrix24\SDK\Lib\Tests\EntityManagerFactory;
use Bitrix24\SDK\Tests\Application\Contracts\Bitrix24Accounts\Repository\Bitrix24AccountRepositoryInterfaceTest;
use Carbon\CarbonImmutable;
use Override;
@@ -65,7 +65,6 @@ protected function createBitrix24AccountImplementation(
protected function createBitrix24AccountRepositoryImplementation(): Bitrix24AccountRepositoryInterface
{
$entityManager = EntityManagerFactory::get();
- $flusher = new Flusher($entityManager);
- return new Bitrix24AccountRepository($entityManager,$flusher);
+ return new Bitrix24AccountRepository($entityManager);
}
}
\ No newline at end of file
diff --git a/tests/Functional/Bitrix24Accounts/UseCase/RenewAuthToken/HandlerTest.php b/tests/Functional/Bitrix24Accounts/UseCase/RenewAuthToken/HandlerTest.php
index 898e953..3ea83a4 100644
--- a/tests/Functional/Bitrix24Accounts/UseCase/RenewAuthToken/HandlerTest.php
+++ b/tests/Functional/Bitrix24Accounts/UseCase/RenewAuthToken/HandlerTest.php
@@ -11,25 +11,21 @@
declare(strict_types=1);
-namespace Bitrix24\SDK\Lib\Tests\Functional\Bitrix24Accounts\UseCase\RenewAuthToken;
+namespace Bitrix24\Lib\Tests\Functional\Bitrix24Accounts\UseCase\RenewAuthToken;
+use Bitrix24\Lib\Bitrix24Accounts\Entity\Bitrix24Account;
+use Bitrix24\Lib\Bitrix24Accounts\Infrastructure\Doctrine\Bitrix24AccountRepository;
+use Bitrix24\Lib\Bitrix24Accounts\UseCase\RenewAuthToken\Command;
+use Bitrix24\Lib\Bitrix24Accounts\UseCase\RenewAuthToken\Handler;
+use Bitrix24\Lib\Services\Flusher;
+use Bitrix24\Lib\Tests\EntityManagerFactory;
use Bitrix24\SDK\Application\ApplicationStatus;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity\Bitrix24AccountStatus;
use Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Repository\Bitrix24AccountRepositoryInterface;
-use Bitrix24\SDK\Core\Exceptions\WrongConfigurationException;
-use Bitrix24\SDK\Core\Response\DTO\RenewedAuthToken;
-use Bitrix24\SDK\Lib\Bitrix24Accounts\Entity\Bitrix24Account;
use Bitrix24\SDK\Core\Credentials\AuthToken;
use Bitrix24\SDK\Core\Credentials\Scope;
-use Bitrix24\SDK\Lib\Bitrix24Accounts\Infrastructure\Doctrine\Bitrix24AccountRepository;
-use Bitrix24\SDK\Lib\Bitrix24Accounts\UseCase\Command\Flusher;
-use Bitrix24\SDK\Lib\Bitrix24Accounts\UseCase\RenewAuthToken\Command;
-use Bitrix24\SDK\Lib\Bitrix24Accounts\UseCase\RenewAuthToken\Handler;
-use Bitrix24\SDK\Lib\Tests\EntityManagerFactory;
+use Bitrix24\SDK\Core\Response\DTO\RenewedAuthToken;
use Carbon\CarbonImmutable;
-use Doctrine\DBAL\Exception;
-use Doctrine\ORM\Exception\ORMException;
-use Doctrine\ORM\OptimisticLockException;
use Override;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Test;
@@ -87,8 +83,7 @@ public function testRenewAuthTokenWithoutBitrix24UserId(): void
protected function setUp(): void
{
$entityManager = EntityManagerFactory::get();
- $flusher = new Flusher($entityManager);
- $this->repository = new Bitrix24AccountRepository($entityManager,$flusher);
+ $this->repository = new Bitrix24AccountRepository($entityManager);
$this->handler = new Handler(
new EventDispatcher(),
$this->repository,
diff --git a/tests/Functional/Bitrix24Accounts/UseCase/SaveAccount/HandlerTest.php b/tests/Functional/Bitrix24Accounts/UseCase/SaveAccount/HandlerTest.php
new file mode 100644
index 0000000..9bc80fe
--- /dev/null
+++ b/tests/Functional/Bitrix24Accounts/UseCase/SaveAccount/HandlerTest.php
@@ -0,0 +1,41 @@
+