mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-13 20:06:57 +01:00
@@ -30,8 +30,8 @@ use PHPUnit\Framework\MockObject\Exception;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\Core\Acl\Actions;
|
||||
use SP\Core\Context\ContextException;
|
||||
use SP\DataModel\Action;
|
||||
use SP\Domain\Core\Acl\ActionNotFoundException;
|
||||
use SP\Domain\Core\Models\Action;
|
||||
use SP\Domain\Storage\Ports\FileCacheService;
|
||||
use SP\Domain\Storage\Ports\XmlFileStorageService;
|
||||
use SP\Infrastructure\File\FileException;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* @author nuxsmin
|
||||
* @link https://syspass.org
|
||||
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
|
||||
* @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
|
||||
*
|
||||
* This file is part of sysPass.
|
||||
*
|
||||
@@ -30,8 +30,8 @@ use PHPUnit\Framework\MockObject\Exception;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\Core\Crypt\CryptPKI;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
use SP\Domain\File\Ports\FileHandlerInterface;
|
||||
use SP\Infrastructure\File\FileException;
|
||||
use SP\Infrastructure\File\FileHandlerInterface;
|
||||
use SPT\UnitaryTestCase;
|
||||
|
||||
use function PHPUnit\Framework\once;
|
||||
|
||||
@@ -28,11 +28,11 @@ use League\Fractal\Manager;
|
||||
use League\Fractal\Resource\Item;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\Exception;
|
||||
use SP\DataModel\Action;
|
||||
use SP\Domain\Account\Adapters\Account;
|
||||
use SP\Domain\Core\Acl\AclActionsInterface;
|
||||
use SP\Domain\Core\Acl\ActionNotFoundException;
|
||||
use SP\Domain\Core\Acl\ActionsInterface;
|
||||
use SP\Domain\Core\Models\Action;
|
||||
use SP\Domain\CustomField\Ports\CustomFieldDataService;
|
||||
use SP\Mvc\View\Components\SelectItemAdapter;
|
||||
use SPT\Generators\AccountDataGenerator;
|
||||
|
||||
@@ -29,10 +29,10 @@ use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\Exception;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\Core\Acl\Acl;
|
||||
use SP\DataModel\Item;
|
||||
use SP\Domain\Account\Adapters\AccountPermission;
|
||||
use SP\Domain\Account\Dtos\AccountAclDto;
|
||||
use SP\Domain\Account\Services\AccountAcl;
|
||||
use SP\Domain\Common\Models\Item;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Core\Acl\AclActionsInterface;
|
||||
use SP\Domain\Core\Acl\ActionsInterface;
|
||||
|
||||
@@ -26,8 +26,8 @@ namespace SPT\Domain\Account\Services;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\File;
|
||||
use SP\DataModel\FileExtData;
|
||||
use SP\Domain\Account\Models\File;
|
||||
use SP\Domain\Account\Models\FileExtData;
|
||||
use SP\Domain\Account\Ports\AccountFileRepository;
|
||||
use SP\Domain\Account\Services\AccountFile;
|
||||
use SP\Domain\Common\Services\ServiceException;
|
||||
|
||||
@@ -26,13 +26,13 @@ namespace SPT\Domain\Account\Services;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Account\Dtos\AccountHistoryCreateDto;
|
||||
use SP\Domain\Account\Dtos\EncryptedPassword;
|
||||
use SP\Domain\Account\Models\AccountHistory as AccountHistoryModel;
|
||||
use SP\Domain\Account\Ports\AccountHistoryRepository;
|
||||
use SP\Domain\Account\Services\AccountHistory;
|
||||
use SP\Domain\Common\Services\ServiceException;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
use SP\Infrastructure\Common\Repositories\NoSuchItemException;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
@@ -168,7 +168,7 @@ class AccountHistoryTest extends UnitaryTestCase
|
||||
public function testSearch()
|
||||
{
|
||||
$itemSearchData =
|
||||
new ItemSearchData(self::$faker->text, self::$faker->randomNumber(), self::$faker->randomNumber());
|
||||
new ItemSearchDto(self::$faker->text, self::$faker->randomNumber(), self::$faker->randomNumber());
|
||||
|
||||
$this->accountHistoryRepository->expects(self::once())->method('search')->with($itemSearchData);
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@ namespace SPT\Domain\Account\Services;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\Item;
|
||||
use SP\Domain\Account\Ports\AccountToTagRepository;
|
||||
use SP\Domain\Account\Services\AccountToTag;
|
||||
use SP\Domain\Common\Models\Item;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
|
||||
@@ -26,9 +26,9 @@ namespace SPT\Domain\Account\Services;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\Item;
|
||||
use SP\Domain\Account\Ports\AccountToUserGroupRepository;
|
||||
use SP\Domain\Account\Services\AccountToUserGroup;
|
||||
use SP\Domain\Common\Models\Item;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
|
||||
@@ -26,9 +26,9 @@ namespace SPT\Domain\Account\Services;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\Item;
|
||||
use SP\Domain\Account\Ports\AccountToUserRepository;
|
||||
use SP\Domain\Account\Services\AccountToUser;
|
||||
use SP\Domain\Common\Models\Item;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
|
||||
@@ -27,11 +27,16 @@ namespace SPT\Domain\Account\Services\Builders;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\Exception;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use PHPUnit\Framework\MockObject\Rule\InvokedCount;
|
||||
use SP\Domain\Account\Dtos\AccountAclDto;
|
||||
use SP\Domain\Account\Dtos\AccountCacheDto;
|
||||
use SP\Domain\Account\Ports\AccountAclService;
|
||||
use SP\Domain\Account\Ports\AccountCacheService;
|
||||
use SP\Domain\Account\Ports\AccountToFavoriteService;
|
||||
use SP\Domain\Account\Ports\AccountToTagRepository;
|
||||
use SP\Domain\Account\Services\Builders\AccountSearchData;
|
||||
use SP\Domain\Common\Models\Item;
|
||||
use SP\Domain\Core\Acl\AclActionsInterface;
|
||||
use SP\Domain\Core\Bootstrap\UriContextInterface;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
@@ -67,11 +72,11 @@ class AccountSearchDataTest extends UnitaryTestCase
|
||||
*/
|
||||
public function testBuildFrom(): void
|
||||
{
|
||||
$accountSearchVData =
|
||||
$accountSearchView =
|
||||
array_map(static fn() => AccountDataGenerator::factory()->buildAccountSearchView(), range(0, 4));
|
||||
$numResults = count($accountSearchVData);
|
||||
$numResults = count($accountSearchView);
|
||||
|
||||
$queryResult = new QueryResult($accountSearchVData);
|
||||
$queryResult = new QueryResult($accountSearchView);
|
||||
|
||||
$this->accountToFavoriteService
|
||||
->expects(once())
|
||||
@@ -80,11 +85,22 @@ class AccountSearchDataTest extends UnitaryTestCase
|
||||
|
||||
$this->accountCacheService
|
||||
->expects(exactly($numResults))
|
||||
->method('getCacheForAccount');
|
||||
->method('getCacheForAccount')
|
||||
->willReturn(new AccountCacheDto(100, [new Item(['id' => 200])], [new Item(['id' => 300])]));
|
||||
|
||||
$invokedCount = new InvokedCount($numResults);
|
||||
$this->accountAclService
|
||||
->expects(exactly($numResults))
|
||||
->method('getAcl');
|
||||
->expects($invokedCount)
|
||||
->method('getAcl')
|
||||
->with(
|
||||
AclActionsInterface::ACCOUNT_SEARCH,
|
||||
self::callback(static function (AccountAclDto $current) use ($accountSearchView, $invokedCount) {
|
||||
return $current->getAccountId() ===
|
||||
$accountSearchView[$invokedCount->numberOfInvocations() - 1]->getId()
|
||||
&& $current->getUsersId() == [new Item(['id' => 200])]
|
||||
&& $current->getUserGroupsId() == [new Item(['id' => 300])];
|
||||
})
|
||||
);
|
||||
|
||||
$this->accountToTagRepository
|
||||
->expects(exactly($numResults))
|
||||
@@ -118,7 +134,8 @@ class AccountSearchDataTest extends UnitaryTestCase
|
||||
|
||||
$this->accountCacheService
|
||||
->expects(exactly($numResults))
|
||||
->method('getCacheForAccount');
|
||||
->method('getCacheForAccount')
|
||||
->willReturn(new AccountCacheDto(0, [], []));
|
||||
|
||||
$this->accountAclService
|
||||
->expects(exactly($numResults))
|
||||
|
||||
@@ -29,7 +29,6 @@ use Defuse\Crypto\Exception\EnvironmentIsBrokenException;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Account\Models\PublicLink as PublicLinkModel;
|
||||
use SP\Domain\Account\Ports\AccountService;
|
||||
use SP\Domain\Account\Ports\PublicLinkRepository;
|
||||
@@ -38,6 +37,7 @@ use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Common\Services\ServiceException;
|
||||
use SP\Domain\Core\Context\Context;
|
||||
use SP\Domain\Core\Crypt\CryptInterface;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
@@ -255,7 +255,7 @@ class PublicLinkTest extends UnitaryTestCase
|
||||
|
||||
public function testSearch()
|
||||
{
|
||||
$itemSearchData = new ItemSearchData(self::$faker->colorName);
|
||||
$itemSearchData = new ItemSearchDto(self::$faker->colorName);
|
||||
|
||||
$this->publicLinkRepository
|
||||
->expects(self::once())
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* sysPass
|
||||
*
|
||||
* @author nuxsmin
|
||||
* @link https://syspass.org
|
||||
* @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
|
||||
*
|
||||
* This file is part of sysPass.
|
||||
*
|
||||
* sysPass is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* sysPass is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with sysPass. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace SPT\Domain\Account\Services;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\PublickLinkOldData;
|
||||
use SP\Domain\Account\Ports\PublicLinkRepository;
|
||||
use SP\Domain\Account\Services\UpgradePublicLink;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SPT\Generators\PublicLinkDataGenerator;
|
||||
use SPT\Stubs\PublicLinkRepositoryStub;
|
||||
use SPT\UnitaryTestCase;
|
||||
|
||||
/**
|
||||
* Class UpgradePublicLinkServiceTest
|
||||
*
|
||||
*/
|
||||
#[Group('unitary')]
|
||||
class UpgradePublicLinkTest extends UnitaryTestCase
|
||||
{
|
||||
|
||||
private PublicLinkRepository|MockObject $publicLinkRepository;
|
||||
private UpgradePublicLink $upgradePublicLinkService;
|
||||
|
||||
public function testUpgradeV300B18010101()
|
||||
{
|
||||
$publicLink = PublicLinkDataGenerator::factory()->buildPublicLink();
|
||||
|
||||
$publicLinkOld = new PublickLinkOldData();
|
||||
$publicLinkOld->setItemId($publicLink->getItemId());
|
||||
$publicLinkOld->setLinkHash($publicLink->getHash());
|
||||
$publicLinkOld->setUserId($publicLink->getUserId());
|
||||
$publicLinkOld->setTypeId($publicLink->getTypeId());
|
||||
$publicLinkOld->setNotify($publicLink->isNotify());
|
||||
$publicLinkOld->setDateAdd($publicLink->getDateAdd());
|
||||
$publicLinkOld->setDateExpire($publicLink->getDateExpire());
|
||||
$publicLinkOld->setCountViews($publicLink->getCountViews());
|
||||
$publicLinkOld->setMaxCountViews($publicLink->getMaxCountViews());
|
||||
$publicLinkOld->setUseInfo(unserialize($publicLink->getUseInfo(), ['allowed_classes' => false]));
|
||||
$publicLinkOld->setData($publicLink->getData());
|
||||
|
||||
$result =
|
||||
new QueryResult([new Simple(['id' => $publicLink->getId(), 'data' => serialize($publicLinkOld)])]);
|
||||
|
||||
$this->publicLinkRepository->expects(self::once())
|
||||
->method('getAny')
|
||||
->with(['id', 'data'], 'PublicLink')
|
||||
->willReturn($result);
|
||||
|
||||
$this->publicLinkRepository
|
||||
->expects(self::once())
|
||||
->method('update')
|
||||
->with($publicLink->mutate(['dateUpdate' => null, 'totalCountViews' => null]));
|
||||
|
||||
$this->upgradePublicLinkService->upgradeV300B18010101();
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$publicLinkRepositoryMethods = array_filter(
|
||||
get_class_methods(PublicLinkRepositoryStub::class),
|
||||
static fn(string $method) => $method != 'transactionAware'
|
||||
);
|
||||
|
||||
$this->publicLinkRepository =
|
||||
$this->createPartialMock(PublicLinkRepositoryStub::class, $publicLinkRepositoryMethods);
|
||||
|
||||
$this->upgradePublicLinkService = new UpgradePublicLink($this->application, $this->publicLinkRepository);
|
||||
}
|
||||
}
|
||||
@@ -27,8 +27,8 @@ namespace SPT\Domain\Config\Services;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use RuntimeException;
|
||||
use SP\DataModel\Dto\ConfigRequest;
|
||||
use SP\Domain\Common\Services\ServiceException;
|
||||
use SP\Domain\Config\Dtos\ConfigRequest;
|
||||
use SP\Domain\Config\Ports\ConfigRepository;
|
||||
use SP\Domain\Config\Services\Config;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
|
||||
@@ -30,8 +30,8 @@ use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use RuntimeException;
|
||||
use SP\Core\Context\ContextException;
|
||||
use SP\DataModel\Dto\ConfigRequest;
|
||||
use SP\Domain\Common\Services\ServiceException;
|
||||
use SP\Domain\Config\Dtos\ConfigRequest;
|
||||
use SP\Domain\Config\Ports\ConfigService;
|
||||
use SP\Domain\Core\Context\Context;
|
||||
use SP\Domain\Core\Crypt\CryptInterface;
|
||||
|
||||
@@ -33,15 +33,15 @@ use SP\Core\Context\ContextException;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Common\Services\ServiceException;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Domain\Export\Ports\BackupFileHelperService;
|
||||
use SP\Domain\Export\Services\BackupFile;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Domain\File\Ports\ArchiveHandlerInterface;
|
||||
use SP\Domain\File\Ports\FileHandlerInterface;
|
||||
use SP\Infrastructure\Database\DatabaseUtil;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SP\Infrastructure\File\ArchiveHandlerInterface;
|
||||
use SP\Infrastructure\File\FileException;
|
||||
use SP\Infrastructure\File\FileHandlerInterface;
|
||||
use SPT\UnitaryTestCase;
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,18 +24,17 @@
|
||||
|
||||
namespace SPT\Domain\Export\Services;
|
||||
|
||||
use DOMDocument;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\Exception;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use RuntimeException;
|
||||
use SP\DataModel\Item;
|
||||
use SP\Domain\Account\Ports\AccountService;
|
||||
use SP\Domain\Account\Ports\AccountToTagService;
|
||||
use SP\Domain\Common\Models\Item;
|
||||
use SP\Domain\Common\Services\ServiceException;
|
||||
use SP\Domain\Export\Services\XmlAccountExport;
|
||||
use SPT\Generators\AccountDataGenerator;
|
||||
use SPT\UnitaryTestCase;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* Class XmlAccountExportTest
|
||||
|
||||
@@ -36,13 +36,13 @@ use SP\Domain\Client\Models\Client;
|
||||
use SP\Domain\Client\Ports\ClientService;
|
||||
use SP\Domain\Config\Ports\ConfigService;
|
||||
use SP\Domain\Core\Crypt\CryptInterface;
|
||||
use SP\Domain\File\Ports\FileHandlerInterface;
|
||||
use SP\Domain\Import\Dtos\CsvImportParamsDto;
|
||||
use SP\Domain\Import\Services\CsvImport;
|
||||
use SP\Domain\Import\Services\ImportException;
|
||||
use SP\Domain\Import\Services\ImportHelper;
|
||||
use SP\Domain\Tag\Ports\TagService;
|
||||
use SP\Infrastructure\File\FileException;
|
||||
use SP\Infrastructure\File\FileHandlerInterface;
|
||||
use SPT\UnitaryTestCase;
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,17 +30,17 @@ use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\Exception;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\Domain\Core\Crypt\CryptInterface;
|
||||
use SP\Domain\File\Ports\FileHandlerInterface;
|
||||
use SP\Domain\Import\Dtos\ImportParamsDto;
|
||||
use SP\Domain\Import\Ports\ImportHelperInterface;
|
||||
use SP\Domain\Import\Ports\XmlFileService;
|
||||
use SP\Domain\Import\Services\CsvImport;
|
||||
use SP\Domain\Import\Services\ImportException;
|
||||
use SP\Domain\Import\Services\ImportHelper;
|
||||
use SP\Domain\Import\Services\ImportStrategy;
|
||||
use SP\Domain\Import\Services\KeepassImport;
|
||||
use SP\Domain\Import\Services\SyspassImport;
|
||||
use SP\Domain\Import\Services\XmlFormat;
|
||||
use SP\Infrastructure\File\FileException;
|
||||
use SP\Infrastructure\File\FileHandlerInterface;
|
||||
use SPT\UnitaryTestCase;
|
||||
|
||||
/**
|
||||
@@ -231,7 +231,7 @@ class ImportStrategyTest extends UnitaryTestCase
|
||||
|
||||
$this->importStrategy = new ImportStrategy(
|
||||
$this->application,
|
||||
$this->createStub(ImportHelper::class),
|
||||
$this->createStub(ImportHelperInterface::class),
|
||||
$this->createStub(CryptInterface::class),
|
||||
$this->xmlFileService
|
||||
);
|
||||
|
||||
@@ -29,11 +29,11 @@ use PHPUnit\Framework\MockObject\Exception;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use RuntimeException;
|
||||
use SP\Domain\Common\Ports\Repository;
|
||||
use SP\Domain\File\Ports\FileHandlerInterface;
|
||||
use SP\Domain\Import\Dtos\ImportParamsDto;
|
||||
use SP\Domain\Import\Ports\ImportStrategyService;
|
||||
use SP\Domain\Import\Ports\ItemsImportService;
|
||||
use SP\Domain\Import\Services\Import;
|
||||
use SP\Infrastructure\File\FileHandlerInterface;
|
||||
use SPT\UnitaryTestCase;
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,9 +33,9 @@ use SP\Domain\Core\Exceptions\InvalidArgumentException;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
use SP\Domain\Http\RequestInterface;
|
||||
use SP\Domain\Install\Adapters\InstallData;
|
||||
use SP\Domain\Install\Ports\InstallerServiceInterface;
|
||||
use SP\Domain\Install\Ports\InstallerService;
|
||||
use SP\Domain\Install\Services\DatabaseSetupInterface;
|
||||
use SP\Domain\Install\Services\InstallerService;
|
||||
use SP\Domain\Install\Services\Installer;
|
||||
use SP\Domain\User\Ports\UserGroupService;
|
||||
use SP\Domain\User\Ports\UserProfileService;
|
||||
use SP\Domain\User\Ports\UserService;
|
||||
@@ -134,11 +134,11 @@ class InstallerTest extends UnitaryTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @return InstallerServiceInterface
|
||||
* @return InstallerService
|
||||
*/
|
||||
private function getDefaultInstaller(): InstallerServiceInterface
|
||||
private function getDefaultInstaller(): InstallerService
|
||||
{
|
||||
return new InstallerService(
|
||||
return new Installer(
|
||||
$this->request,
|
||||
$this->config,
|
||||
$this->userService,
|
||||
|
||||
@@ -33,11 +33,11 @@ use PHPUnit\Framework\MockObject\Exception;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\Domain\Config\Ports\ConfigDataInterface;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
use SP\Domain\Database\Ports\DatabaseFileInterface;
|
||||
use SP\Domain\Database\Ports\DbStorageHandler;
|
||||
use SP\Domain\Install\Adapters\InstallData;
|
||||
use SP\Domain\Install\Services\MysqlService;
|
||||
use SP\Infrastructure\Database\DatabaseFileInterface;
|
||||
use SP\Infrastructure\Database\DatabaseUtil;
|
||||
use SP\Infrastructure\Database\DbStorageHandler;
|
||||
use SP\Infrastructure\File\FileException;
|
||||
use SPT\UnitaryTestCase;
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ namespace SPT\Domain\Notification\Services;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\Exception;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Common\Services\ServiceException;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Notification\Models\Notification as NotificationModel;
|
||||
@@ -53,7 +53,7 @@ class NotificationTest extends UnitaryTestCase
|
||||
|
||||
public function testSearchForUserId()
|
||||
{
|
||||
$itemSearchData = new ItemSearchData();
|
||||
$itemSearchData = new ItemSearchDto();
|
||||
|
||||
$this->notificationRepository
|
||||
->expects($this->once())
|
||||
@@ -98,7 +98,7 @@ class NotificationTest extends UnitaryTestCase
|
||||
|
||||
$this->context->setUserData($userDataDto);
|
||||
|
||||
$itemSearchData = new ItemSearchData();
|
||||
$itemSearchData = new ItemSearchDto();
|
||||
|
||||
$this->notificationRepository
|
||||
->expects($this->once())
|
||||
@@ -112,7 +112,7 @@ class NotificationTest extends UnitaryTestCase
|
||||
{
|
||||
$userData = $this->context->getUserData();
|
||||
|
||||
$itemSearchData = new ItemSearchData();
|
||||
$itemSearchData = new ItemSearchDto();
|
||||
|
||||
$this->notificationRepository
|
||||
->expects($this->once())
|
||||
|
||||
@@ -28,8 +28,8 @@ use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\Exception;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\Core\Context\ContextException;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Common\Services\ServiceException;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
@@ -373,7 +373,7 @@ class PluginManagerTest extends UnitaryTestCase
|
||||
|
||||
public function testSearch()
|
||||
{
|
||||
$itemSearchData = new ItemSearchData();
|
||||
$itemSearchData = new ItemSearchDto();
|
||||
|
||||
$queryResult = new QueryResult([1]);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace SPT\Domain\Security\Services;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
@@ -54,7 +54,7 @@ class EventlogTest extends UnitaryTestCase
|
||||
*/
|
||||
public function testSearch()
|
||||
{
|
||||
$itemSearchData = new ItemSearchData('test');
|
||||
$itemSearchData = new ItemSearchDto('test');
|
||||
|
||||
$this->eventlogRepository
|
||||
->expects($this->once())
|
||||
|
||||
@@ -28,7 +28,7 @@ use Exception;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use RuntimeException;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\InvalidArgumentException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
@@ -54,7 +54,7 @@ class TrackTest extends UnitaryTestCase
|
||||
|
||||
public function testSearch()
|
||||
{
|
||||
$itemSearchData = new ItemSearchData('test');
|
||||
$itemSearchData = new ItemSearchDto('test');
|
||||
|
||||
$this->trackRepository
|
||||
->expects($this->once())
|
||||
|
||||
@@ -26,8 +26,8 @@ namespace SPT\Domain\User\Services;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Common\Services\ServiceException;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\User\Models\UserGroup as UserGroupModel;
|
||||
@@ -330,7 +330,7 @@ class UserGroupTest extends UnitaryTestCase
|
||||
|
||||
public function testSearch()
|
||||
{
|
||||
$itemSearchData = new ItemSearchData('test', 1, 10);
|
||||
$itemSearchData = new ItemSearchDto('test', 1, 10);
|
||||
|
||||
$queryResult = new QueryResult([1]);
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ namespace SPT\Domain\User\Services;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Common\Services\ServiceException;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\User\Models\User;
|
||||
@@ -200,7 +200,7 @@ class UserProfileTest extends UnitaryTestCase
|
||||
|
||||
public function testSearch()
|
||||
{
|
||||
$itemSearchData = new ItemSearchData(
|
||||
$itemSearchData = new ItemSearchDto(
|
||||
self::$faker->userName(),
|
||||
self::$faker->randomNumber(2),
|
||||
self::$faker->randomNumber(2)
|
||||
|
||||
@@ -28,8 +28,8 @@ use JsonException;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\Core\Crypt\Hash;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Common\Services\ServiceException;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
@@ -66,7 +66,7 @@ class UserTest extends UnitaryTestCase
|
||||
{
|
||||
$user = UserDataGenerator::factory()->buildUserData();
|
||||
|
||||
$itemSearchData = new ItemSearchData(
|
||||
$itemSearchData = new ItemSearchDto(
|
||||
self::$faker->text(),
|
||||
self::$faker->randomNumber(2),
|
||||
self::$faker->randomNumber(2)
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
namespace SPT\Generators;
|
||||
|
||||
use SP\DataModel\Item;
|
||||
use SP\Domain\Account\Dtos\AccountCreateDto;
|
||||
use SP\Domain\Account\Dtos\AccountEnrichedDto;
|
||||
use SP\Domain\Account\Dtos\AccountHistoryDto;
|
||||
@@ -32,6 +31,7 @@ use SP\Domain\Account\Dtos\AccountUpdateDto;
|
||||
use SP\Domain\Account\Models\Account;
|
||||
use SP\Domain\Account\Models\AccountSearchView;
|
||||
use SP\Domain\Account\Models\AccountView;
|
||||
use SP\Domain\Common\Models\Item;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
|
||||
/**
|
||||
@@ -94,7 +94,7 @@ final class AccountDataGenerator extends DataGenerator
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Item[]
|
||||
* @return \SP\Domain\Common\Models\Item[]
|
||||
*/
|
||||
public function buildItemData(): array
|
||||
{
|
||||
|
||||
@@ -24,16 +24,16 @@
|
||||
|
||||
namespace SPT\Generators;
|
||||
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
|
||||
/**
|
||||
* Class ItemSearchDataGenerator
|
||||
*/
|
||||
final class ItemSearchDataGenerator extends DataGenerator
|
||||
{
|
||||
public function buildItemSearchData(): ItemSearchData
|
||||
public function buildItemSearchData(): ItemSearchDto
|
||||
{
|
||||
return new ItemSearchData(
|
||||
return new ItemSearchDto(
|
||||
$this->faker->name(),
|
||||
$this->faker->randomNumber(3),
|
||||
$this->faker->randomNumber(3)
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
|
||||
namespace SPT\Generators;
|
||||
|
||||
use SP\DataModel\PublicLinkList;
|
||||
use SP\Domain\Account\Models\PublicLink;
|
||||
use SP\Domain\Account\Models\PublicLinkList;
|
||||
|
||||
/**
|
||||
* Class PublicLinkDataGenerator
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* @author nuxsmin
|
||||
* @link https://syspass.org
|
||||
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
|
||||
* @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
|
||||
*
|
||||
* This file is part of sysPass.
|
||||
*
|
||||
@@ -32,10 +32,10 @@ use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\Exception;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\Domain\File\Ports\FileHandlerInterface;
|
||||
use SP\Domain\Html\Header;
|
||||
use SP\Html\MinifyCss;
|
||||
use SP\Infrastructure\File\FileException;
|
||||
use SP\Infrastructure\File\FileHandlerInterface;
|
||||
use SPT\UnitaryTestCase;
|
||||
use TypeError;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* @author nuxsmin
|
||||
* @link https://syspass.org
|
||||
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
|
||||
* @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
|
||||
*
|
||||
* This file is part of sysPass.
|
||||
*
|
||||
@@ -32,10 +32,10 @@ use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\Exception;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\Domain\File\Ports\FileHandlerInterface;
|
||||
use SP\Domain\Html\Header;
|
||||
use SP\Html\MinifyJs;
|
||||
use SP\Infrastructure\File\FileException;
|
||||
use SP\Infrastructure\File\FileHandlerInterface;
|
||||
use SPT\UnitaryTestCase;
|
||||
use TypeError;
|
||||
|
||||
|
||||
@@ -28,13 +28,13 @@ use Aura\SqlQuery\QueryFactory;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\File;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Account\Models\File;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Infrastructure\Account\Repositories\AccountFile;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SPT\Generators\FileDataGenerator;
|
||||
@@ -198,7 +198,7 @@ class AccountFileTest extends UnitaryTestCase
|
||||
|
||||
public function testSearch(): void
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
|
||||
@@ -28,14 +28,14 @@ use Aura\SqlQuery\QueryFactory;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Account\Dtos\AccountHistoryCreateDto;
|
||||
use SP\Domain\Account\Dtos\EncryptedPassword;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Infrastructure\Account\Repositories\AccountHistory;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SPT\Generators\AccountDataGenerator;
|
||||
@@ -162,7 +162,7 @@ class AccountHistoryTest extends UnitaryTestCase
|
||||
|
||||
public function testSearch(): void
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
@@ -201,7 +201,7 @@ class AccountHistoryTest extends UnitaryTestCase
|
||||
->with($callback)
|
||||
->willReturn(new QueryResult());
|
||||
|
||||
$this->accountHistory->search(new ItemSearchData());
|
||||
$this->accountHistory->search(new ItemSearchDto());
|
||||
}
|
||||
|
||||
public function testGetAccountsPassData(): void
|
||||
|
||||
@@ -32,8 +32,8 @@ use SP\Domain\Account\Dtos\AccountSearchFilterDto;
|
||||
use SP\Domain\Account\Models\AccountSearchView;
|
||||
use SP\Domain\Account\Ports\AccountFilterBuilder;
|
||||
use SP\Domain\Account\Ports\AccountSearchConstants;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Infrastructure\Account\Repositories\AccountSearch;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SPT\UnitaryTestCase;
|
||||
|
||||
|
||||
@@ -28,18 +28,18 @@ use Aura\SqlQuery\QueryFactory;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Account\Dtos\EncryptedPassword;
|
||||
use SP\Domain\Account\Models\Account as AccountModel;
|
||||
use SP\Domain\Account\Models\AccountSearchView;
|
||||
use SP\Domain\Account\Models\AccountView;
|
||||
use SP\Domain\Account\Ports\AccountFilterBuilder;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Infrastructure\Account\Repositories\Account;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SPT\Generators\AccountDataGenerator;
|
||||
use SPT\UnitaryTestCase;
|
||||
@@ -642,7 +642,7 @@ class AccountTest extends UnitaryTestCase
|
||||
|
||||
public function testSearch(): void
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
@@ -677,7 +677,7 @@ class AccountTest extends UnitaryTestCase
|
||||
|
||||
$this->database->expects(self::once())->method('runQuery')->with($callback, true);
|
||||
|
||||
$this->account->search(new ItemSearchData());
|
||||
$this->account->search(new ItemSearchDto());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,8 +31,8 @@ use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Infrastructure\Account\Repositories\AccountToFavorite;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SPT\UnitaryTestCase;
|
||||
|
||||
@@ -33,8 +33,8 @@ use SP\Core\Context\ContextException;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Infrastructure\Account\Repositories\AccountToTag;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SPT\UnitaryTestCase;
|
||||
|
||||
@@ -28,11 +28,11 @@ use Aura\SqlQuery\QueryFactory;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\Item;
|
||||
use SP\Domain\Common\Models\Item;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Infrastructure\Account\Repositories\AccountToUserGroup;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SPT\UnitaryTestCase;
|
||||
|
||||
@@ -28,11 +28,11 @@ use Aura\SqlQuery\QueryFactory;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\Item;
|
||||
use SP\Domain\Common\Models\Item;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Infrastructure\Account\Repositories\AccountToUser;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SPT\UnitaryTestCase;
|
||||
|
||||
@@ -28,15 +28,15 @@ use Aura\SqlQuery\QueryFactory;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Account\Models\PublicLink as PublicLinkModel;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Infrastructure\Account\Repositories\PublicLink;
|
||||
use SP\Infrastructure\Common\Repositories\DuplicatedItemException;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SPT\UnitaryTestCase;
|
||||
@@ -75,7 +75,7 @@ class PublicLinkTest extends UnitaryTestCase
|
||||
|
||||
public function testSearch(): void
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
@@ -420,7 +420,7 @@ class PublicLinkTest extends UnitaryTestCase
|
||||
->with($callback)
|
||||
->willReturn(new QueryResult());
|
||||
|
||||
$this->publicLink->search(new ItemSearchData());
|
||||
$this->publicLink->search(new ItemSearchDto());
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
|
||||
@@ -32,14 +32,14 @@ use Aura\SqlQuery\QueryFactory;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Auth\Models\AuthToken as AuthTokenModel;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Infrastructure\Auth\Repositories\AuthToken;
|
||||
use SP\Infrastructure\Common\Repositories\DuplicatedItemException;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SPT\Generators\AuthTokenGenerator;
|
||||
@@ -62,7 +62,7 @@ class AuthTokenTest extends UnitaryTestCase
|
||||
*/
|
||||
public function testSearch()
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
@@ -108,7 +108,7 @@ class AuthTokenTest extends UnitaryTestCase
|
||||
->method('runQuery')
|
||||
->with($callback, true);
|
||||
|
||||
$this->authToken->search(new ItemSearchData());
|
||||
$this->authToken->search(new ItemSearchDto());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,14 +33,14 @@ use Exception;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Category\Models\Category as CategoryModel;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Infrastructure\Category\Repositories\Category;
|
||||
use SP\Infrastructure\Common\Repositories\DuplicatedItemException;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SPT\Generators\CategoryGenerator;
|
||||
@@ -233,7 +233,7 @@ class CategoryTest extends UnitaryTestCase
|
||||
*/
|
||||
public function testSearch()
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
@@ -278,7 +278,7 @@ class CategoryTest extends UnitaryTestCase
|
||||
->method('runQuery')
|
||||
->with($callback, true);
|
||||
|
||||
$this->category->search(new ItemSearchData());
|
||||
$this->category->search(new ItemSearchDto());
|
||||
}
|
||||
|
||||
public function testGetAll()
|
||||
|
||||
@@ -33,16 +33,16 @@ use Exception;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Account\Ports\AccountFilterBuilder;
|
||||
use SP\Domain\Client\Models\Client as ClientModel;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Infrastructure\Client\Repositories\Client;
|
||||
use SP\Infrastructure\Common\Repositories\DuplicatedItemException;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SPT\Generators\ClientGenerator;
|
||||
@@ -236,7 +236,7 @@ class ClientTest extends UnitaryTestCase
|
||||
*/
|
||||
public function testSearch()
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
@@ -281,7 +281,7 @@ class ClientTest extends UnitaryTestCase
|
||||
->method('runQuery')
|
||||
->with($callback, true);
|
||||
|
||||
$this->client->search(new ItemSearchData());
|
||||
$this->client->search(new ItemSearchDto());
|
||||
}
|
||||
|
||||
public function testGetAll()
|
||||
|
||||
@@ -34,8 +34,8 @@ use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Config\Models\Config as ConfigModel;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Infrastructure\Config\Repositories\Config;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SPT\Generators\ConfigGenerator;
|
||||
|
||||
@@ -36,8 +36,8 @@ use SP\Domain\Common\Models\Simple as SimpleModel;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\CustomField\Models\CustomFieldData as CustomFieldDataModel;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Infrastructure\CustomField\Repositories\CustomFieldData;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SPT\Generators\CustomFieldDataGenerator;
|
||||
|
||||
@@ -32,12 +32,12 @@ use Aura\SqlQuery\QueryFactory;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\CustomField\Models\CustomFieldDefinition as CustomFieldDefinitionModel;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Infrastructure\CustomField\Repositories\CustomFieldDefinition;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SPT\Generators\CustomFieldDefinitionGenerator;
|
||||
@@ -218,7 +218,7 @@ class CustomFieldDefinitionTest extends UnitaryTestCase
|
||||
*/
|
||||
public function testSearch()
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
@@ -266,7 +266,7 @@ class CustomFieldDefinitionTest extends UnitaryTestCase
|
||||
->method('runQuery')
|
||||
->with($callback, true);
|
||||
|
||||
$this->customFieldDefinition->search(new ItemSearchData());
|
||||
$this->customFieldDefinition->search(new ItemSearchDto());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,8 +30,8 @@ use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\Domain\CustomField\Models\CustomFieldType as CustomFieldTypeModel;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Infrastructure\CustomField\Repositories\CustomFieldType;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SPT\UnitaryTestCase;
|
||||
|
||||
|
||||
@@ -37,10 +37,10 @@ use RuntimeException;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Database\Ports\DbStorageHandler;
|
||||
use SP\Domain\Database\Ports\QueryDataInterface;
|
||||
use SP\Infrastructure\Database\Database;
|
||||
use SP\Infrastructure\Database\DbStorageDriver;
|
||||
use SP\Infrastructure\Database\DbStorageHandler;
|
||||
use SP\Infrastructure\Database\QueryDataInterface;
|
||||
use SPT\UnitaryTestCase;
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,9 +26,9 @@ namespace SPT\Infrastructure\Database;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\Exception;
|
||||
use SP\Domain\File\Ports\FileHandlerInterface;
|
||||
use SP\Infrastructure\Database\MysqlFileParser;
|
||||
use SP\Infrastructure\File\FileException;
|
||||
use SP\Infrastructure\File\FileHandlerInterface;
|
||||
use SPT\UnitaryTestCase;
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,8 +29,8 @@ use DOMException;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\Domain\Common\Services\ServiceException;
|
||||
use SP\Domain\File\Ports\FileHandlerInterface;
|
||||
use SP\Infrastructure\File\FileException;
|
||||
use SP\Infrastructure\File\FileHandlerInterface;
|
||||
use SP\Infrastructure\File\XmlFileStorage;
|
||||
use SPT\UnitaryTestCase;
|
||||
|
||||
|
||||
@@ -32,12 +32,12 @@ use Aura\SqlQuery\QueryFactory;
|
||||
use Exception;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Domain\ItemPreset\Models\ItemPreset as ItemPresetModel;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SP\Infrastructure\ItemPreset\Repositories\ItemPreset;
|
||||
@@ -57,7 +57,7 @@ class ItemPresetTest extends UnitaryTestCase
|
||||
|
||||
public function testGetByFilter()
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
@@ -204,7 +204,7 @@ class ItemPresetTest extends UnitaryTestCase
|
||||
*/
|
||||
public function testSearch()
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
@@ -251,7 +251,7 @@ class ItemPresetTest extends UnitaryTestCase
|
||||
->method('runQuery')
|
||||
->with($callback, true);
|
||||
|
||||
$this->itemPreset->search(new ItemSearchData());
|
||||
$this->itemPreset->search(new ItemSearchDto());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,12 +31,12 @@ use Aura\SqlQuery\Common\UpdateInterface;
|
||||
use Aura\SqlQuery\QueryFactory;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Domain\Notification\Models\Notification as NotificationModel;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SP\Infrastructure\Notification\Repositories\Notification;
|
||||
@@ -386,7 +386,7 @@ class NotificationTest extends UnitaryTestCase
|
||||
|
||||
public function testSearchForUserId()
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
@@ -414,7 +414,7 @@ class NotificationTest extends UnitaryTestCase
|
||||
|
||||
public function testSearchForAdmin()
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
|
||||
@@ -34,8 +34,8 @@ use PHPUnit\Framework\Constraint\Callback;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Domain\Plugin\Models\PluginData as PluginDataModel;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SP\Infrastructure\Plugin\Repositories\PluginData;
|
||||
|
||||
@@ -31,13 +31,13 @@ use Aura\SqlQuery\Common\UpdateInterface;
|
||||
use Aura\SqlQuery\QueryFactory;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Domain\Plugin\Models\Plugin as PluginModel;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SP\Infrastructure\Plugin\Repositories\Plugin;
|
||||
@@ -266,7 +266,7 @@ class PluginTest extends UnitaryTestCase
|
||||
|
||||
public function testSearch()
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
@@ -292,7 +292,7 @@ class PluginTest extends UnitaryTestCase
|
||||
|
||||
public function testSearchWithEmptyString()
|
||||
{
|
||||
$item = new ItemSearchData();
|
||||
$item = new ItemSearchDto();
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
|
||||
@@ -31,11 +31,11 @@ use Aura\SqlQuery\QueryFactory;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Domain\Security\Models\Eventlog as EventlogModel;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SP\Infrastructure\Security\Repositories\Eventlog;
|
||||
@@ -109,7 +109,7 @@ class EventlogTest extends UnitaryTestCase
|
||||
|
||||
public function testSearch()
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
@@ -137,7 +137,7 @@ class EventlogTest extends UnitaryTestCase
|
||||
|
||||
public function testSearchWithEmptyString()
|
||||
{
|
||||
$item = new ItemSearchData();
|
||||
$item = new ItemSearchDto();
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
|
||||
@@ -32,11 +32,11 @@ use Aura\SqlQuery\QueryFactory;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Domain\Security\Models\Track as TrackModel;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SP\Infrastructure\Security\Repositories\Track;
|
||||
@@ -133,7 +133,7 @@ class TrackTest extends UnitaryTestCase
|
||||
|
||||
public function testSearch()
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
@@ -160,7 +160,7 @@ class TrackTest extends UnitaryTestCase
|
||||
|
||||
public function testSearchWithEmptyString()
|
||||
{
|
||||
$item = new ItemSearchData();
|
||||
$item = new ItemSearchDto();
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
|
||||
@@ -33,14 +33,14 @@ use Exception;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Domain\Tag\Models\Tag as TagModel;
|
||||
use SP\Infrastructure\Common\Repositories\DuplicatedItemException;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SP\Infrastructure\Tag\Repositories\Tag;
|
||||
@@ -78,7 +78,7 @@ class TagTest extends UnitaryTestCase
|
||||
|
||||
public function testSearch()
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
@@ -122,7 +122,7 @@ class TagTest extends UnitaryTestCase
|
||||
->method('runQuery')
|
||||
->with($callback, true);
|
||||
|
||||
$this->tag->search(new ItemSearchData());
|
||||
$this->tag->search(new ItemSearchDto());
|
||||
}
|
||||
|
||||
public function testGetById()
|
||||
|
||||
@@ -32,13 +32,13 @@ use Aura\SqlQuery\QueryFactory;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Common\Models\Simple as SimpleModel;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Domain\User\Models\UserGroup as UserGroupModel;
|
||||
use SP\Infrastructure\Common\Repositories\DuplicatedItemException;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SP\Infrastructure\User\Repositories\UserGroup;
|
||||
@@ -258,7 +258,7 @@ class UserGroupTest extends UnitaryTestCase
|
||||
|
||||
public function testSearch()
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
@@ -285,7 +285,7 @@ class UserGroupTest extends UnitaryTestCase
|
||||
|
||||
public function testSearchWithNoString()
|
||||
{
|
||||
$item = new ItemSearchData();
|
||||
$item = new ItemSearchDto();
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
|
||||
@@ -34,8 +34,8 @@ use SP\Domain\Common\Models\Simple;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Domain\User\Models\UserPassRecover as UserPassRecoverModel;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SP\Infrastructure\User\Repositories\UserPassRecover;
|
||||
|
||||
@@ -32,13 +32,13 @@ use Aura\SqlQuery\QueryFactory;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Common\Models\Simple as SimpleModel;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Domain\User\Models\UserProfile as UserProfileModel;
|
||||
use SP\Infrastructure\Common\Repositories\DuplicatedItemException;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SP\Infrastructure\User\Repositories\UserProfile;
|
||||
@@ -57,7 +57,7 @@ class UserProfileTest extends UnitaryTestCase
|
||||
|
||||
public function testSearch()
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
@@ -83,7 +83,7 @@ class UserProfileTest extends UnitaryTestCase
|
||||
|
||||
public function testSearchWithNoString()
|
||||
{
|
||||
$item = new ItemSearchData();
|
||||
$item = new ItemSearchDto();
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
|
||||
@@ -33,15 +33,15 @@ use JsonException;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\Constraint\Callback;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\DataModel\ItemSearchData;
|
||||
use SP\Domain\Common\Models\Simple as SimpleModel;
|
||||
use SP\Domain\Core\Dtos\ItemSearchDto;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Domain\User\Dtos\UserDataDto;
|
||||
use SP\Domain\User\Models\User as UserModel;
|
||||
use SP\Infrastructure\Common\Repositories\DuplicatedItemException;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SP\Infrastructure\User\Repositories\User;
|
||||
@@ -541,7 +541,7 @@ class UserTest extends UnitaryTestCase
|
||||
*/
|
||||
public function testSearch()
|
||||
{
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
@@ -572,7 +572,7 @@ class UserTest extends UnitaryTestCase
|
||||
*/
|
||||
public function testSearchWithNoString()
|
||||
{
|
||||
$item = new ItemSearchData();
|
||||
$item = new ItemSearchDto();
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
@@ -612,7 +612,7 @@ class UserTest extends UnitaryTestCase
|
||||
)
|
||||
);
|
||||
|
||||
$item = new ItemSearchData(self::$faker->name);
|
||||
$item = new ItemSearchDto(self::$faker->name);
|
||||
|
||||
$callback = new Callback(
|
||||
static function (QueryData $arg) use ($item) {
|
||||
|
||||
@@ -33,8 +33,8 @@ use PHPUnit\Framework\MockObject\MockObject;
|
||||
use SP\Domain\Common\Services\ServiceException;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Database\Ports\DatabaseInterface;
|
||||
use SP\Domain\User\Models\UserToUserGroup as UserToUserGroupModel;
|
||||
use SP\Infrastructure\Database\DatabaseInterface;
|
||||
use SP\Infrastructure\Database\QueryData;
|
||||
use SP\Infrastructure\Database\QueryResult;
|
||||
use SP\Infrastructure\User\Repositories\UserToUserGroup;
|
||||
|
||||
@@ -48,8 +48,8 @@ use SP\Domain\Core\Context\Context;
|
||||
use SP\Domain\Core\Exceptions\ConstraintException;
|
||||
use SP\Domain\Core\Exceptions\QueryException;
|
||||
use SP\Domain\Core\Exceptions\SPException;
|
||||
use SP\Domain\Database\Ports\DbStorageHandler;
|
||||
use SP\Infrastructure\Database\DatabaseConnectionData;
|
||||
use SP\Infrastructure\Database\DbStorageHandler;
|
||||
use SP\Infrastructure\Database\MysqlHandler;
|
||||
use SPT\DatabaseTrait;
|
||||
use stdClass;
|
||||
|
||||
@@ -31,7 +31,7 @@ use Exception;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use SP\Domain\Core\Context\Context;
|
||||
use SP\Infrastructure\Database\DbStorageHandler;
|
||||
use SP\Domain\Database\Ports\DbStorageHandler;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
|
||||
use function SPT\getDbHandler;
|
||||
|
||||
@@ -32,9 +32,9 @@ use SP\Core\Context\ContextException;
|
||||
use SP\DataModel\ProfileData;
|
||||
use SP\Domain\Core\Context\Context;
|
||||
use SP\Domain\Core\Exceptions\FileNotFoundException;
|
||||
use SP\Domain\Database\Ports\DbStorageHandler;
|
||||
use SP\Domain\User\Dtos\UserDataDto;
|
||||
use SP\Infrastructure\Database\DatabaseConnectionData;
|
||||
use SP\Infrastructure\Database\DbStorageHandler;
|
||||
use SP\Infrastructure\Database\MysqlHandler;
|
||||
use SP\Util\FileUtil;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user