diff --git a/config-templates/module_accounting.php b/config-templates/module_accounting.php index 7a78f1e7af56f3ac9bf04e9fca3a235d142562c3..479c2f626c39062ae89f57dddaa8919cff665a79 100644 --- a/config-templates/module_accounting.php +++ b/config-templates/module_accounting.php @@ -58,7 +58,7 @@ $config = [ /** * Providers * - * DataProvider classes are used to fetch data about users in order to show it in users profile page UI. + * VersionedDataProvider classes are used to fetch data about users in order to show it in users profile page UI. * Each provider can also include tracking capability, which will be triggered / used automatically. * * Connected services provider is a class which will be used to provide summary data about services that user @@ -73,8 +73,8 @@ $config = [ /** * Default connected services provider which expects Doctrine DBAL compatible connection to be set below. */ - //Providers\ConnectedServices\DoctrineDbal\Versioned\DataProvider::class, - Providers\ConnectedServices\DoctrineDbal\Current\DataProvider::class, + //Providers\ConnectedServices\DoctrineDbal\VersionedDataProvider\VersionedDataProvider::class, + Providers\ConnectedServices\DoctrineDbal\CurrentDataProvider::class, /** * Activity provider is a class which will be used to provide list of authentication events which includes info @@ -88,7 +88,7 @@ $config = [ /** * Default activity provider which expects Doctrine DBAL compatible connection to be set below. */ - Providers\Activity\Versioned\DoctrineDbal\DataProvider::class, + Providers\Activity\DoctrineDbal\VersionedDataProvider::class, /** * Trackers @@ -117,19 +117,19 @@ $config = [ /** * Data provider connection keys. */ - Providers\ConnectedServices\DoctrineDbal\Versioned\DataProvider::class => [ + Providers\ConnectedServices\DoctrineDbal\VersionedDataProvider::class => [ ModuleConfiguration\ConnectionType::MASTER => 'doctrine_dbal_pdo_mysql', ModuleConfiguration\ConnectionType::SLAVE => [ 'doctrine_dbal_pdo_mysql', ], ], - Providers\ConnectedServices\DoctrineDbal\Current\DataProvider::class => [ + Providers\ConnectedServices\DoctrineDbal\CurrentDataProvider::class => [ ModuleConfiguration\ConnectionType::MASTER => 'doctrine_dbal_pdo_mysql', ModuleConfiguration\ConnectionType::SLAVE => [ 'doctrine_dbal_pdo_mysql', ], ], - Providers\Activity\Versioned\DoctrineDbal\DataProvider::class => [ + Providers\Activity\DoctrineDbal\VersionedDataProvider::class => [ ModuleConfiguration\ConnectionType::MASTER => 'doctrine_dbal_pdo_mysql', ModuleConfiguration\ConnectionType::SLAVE => [ 'doctrine_dbal_pdo_mysql', @@ -209,7 +209,7 @@ $config = [ ModuleConfiguration::OPTION_JOB_RUNNER_SHOULD_PAUSE_AFTER_NUMBER_OF_JOBS_PROCESSED => 10, /** - * DataTracker data retention policy. + * VersionedDataTracker data retention policy. * * Determines how long the tracked data will be stored. If null, data will be stored indefinitely. Otherwise, it * can be set as a duration for DateInterval, examples being below. For this to work, a cron tag must also @@ -230,8 +230,9 @@ $config = [ ModuleConfiguration::OPTION_CRON_TAG_FOR_JOB_RUNNER => 'accounting_job_runner', /** - * DataTracker data retention policy tag designates the cron tag to use for enforcing data retention policy. - * Make sure to add this tag to the cron module configuration if data retention policy is different from null. + * VersionedDataTracker data retention policy tag designates the cron tag to use for enforcing data retention + * policy. Make sure to add this tag to the cron module configuration if data retention policy is different + * from null. */ ModuleConfiguration::OPTION_CRON_TAG_FOR_TRACKER_DATA_RETENTION_POLICY => 'accounting_tracker_data_retention_policy', diff --git a/hooks/hook_cron.php b/hooks/hook_cron.php index 1972fb0b92b2a52e2e49545c8d31c77d23d4333e..d045e20d903bbf7886e36f378e7b8a5aefcc1c2b 100644 --- a/hooks/hook_cron.php +++ b/hooks/hook_cron.php @@ -51,7 +51,7 @@ function accounting_hook_cron(array &$cronInfo): void } /** - * DataTracker data retention policy handling. + * VersionedDataTracker data retention policy handling. */ $cronTagForTrackerDataRetentionPolicy = $moduleConfiguration->getCronTagForTrackerDataRetentionPolicy(); try { diff --git a/src/Data/Providers/Activity/Versioned/DoctrineDbal/DataProvider.php b/src/Data/Providers/Activity/DoctrineDbal/VersionedDataProvider.php similarity index 89% rename from src/Data/Providers/Activity/Versioned/DoctrineDbal/DataProvider.php rename to src/Data/Providers/Activity/DoctrineDbal/VersionedDataProvider.php index 1dd84197b50725100e1afe58528178dad0789ee1..e0b6f63d5b6abcceb4f281f203c7332374a7d6e3 100644 --- a/src/Data/Providers/Activity/Versioned/DoctrineDbal/DataProvider.php +++ b/src/Data/Providers/Activity/DoctrineDbal/VersionedDataProvider.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Providers\Activity\Versioned\DoctrineDbal; +namespace SimpleSAML\Module\accounting\Data\Providers\Activity\DoctrineDbal; use Psr\Log\LoggerInterface; use SimpleSAML\Module\accounting\Data\Providers\Interfaces\ActivityInterface; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store; -use SimpleSAML\Module\accounting\Data\Trackers\Activity\Versioned\DoctrineDbal\DataTracker; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store; +use SimpleSAML\Module\accounting\Data\Trackers\Activity\DoctrineDbal\VersionedDataTracker; use SimpleSAML\Module\accounting\Data\Trackers\Interfaces\DataTrackerInterface; use SimpleSAML\Module\accounting\Entities\Activity; use SimpleSAML\Module\accounting\Exceptions\StoreException; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use SimpleSAML\Module\accounting\ModuleConfiguration; -class DataProvider implements ActivityInterface +class VersionedDataProvider implements ActivityInterface { protected ModuleConfiguration $moduleConfiguration; protected LoggerInterface $logger; @@ -86,7 +86,7 @@ class DataProvider implements ActivityInterface */ public function getTracker(): ?DataTrackerInterface { - return new DataTracker( + return new VersionedDataTracker( $this->moduleConfiguration, $this->logger, ModuleConfiguration\ConnectionType::MASTER, diff --git a/src/Data/Providers/ConnectedServices/DoctrineDbal/Current/DataProvider.php b/src/Data/Providers/ConnectedServices/DoctrineDbal/CurrentDataProvider.php similarity index 94% rename from src/Data/Providers/ConnectedServices/DoctrineDbal/Current/DataProvider.php rename to src/Data/Providers/ConnectedServices/DoctrineDbal/CurrentDataProvider.php index d3e5a7210a9a8945587d8d96bd6e88dd9b28195d..323c867f28d892d77cfb0d912b82ab25f3a68867 100644 --- a/src/Data/Providers/ConnectedServices/DoctrineDbal/Current/DataProvider.php +++ b/src/Data/Providers/ConnectedServices/DoctrineDbal/CurrentDataProvider.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Providers\ConnectedServices\DoctrineDbal\Current; +namespace SimpleSAML\Module\accounting\Data\Providers\ConnectedServices\DoctrineDbal; use Psr\Log\LoggerInterface; use SimpleSAML\Module\accounting\Data\Providers\Interfaces\ConnectedServicesInterface; use SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Current\Store; -use SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\Current\DataTracker; +use SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\CurrentDataTracker; use SimpleSAML\Module\accounting\Data\Trackers\Interfaces\DataTrackerInterface; use SimpleSAML\Module\accounting\Entities\ConnectedService; use SimpleSAML\Module\accounting\Exceptions\StoreException; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use SimpleSAML\Module\accounting\ModuleConfiguration; -class DataProvider implements ConnectedServicesInterface +class CurrentDataProvider implements ConnectedServicesInterface { protected ModuleConfiguration $moduleConfiguration; protected LoggerInterface $logger; @@ -86,7 +86,7 @@ class DataProvider implements ConnectedServicesInterface */ public function getTracker(): ?DataTrackerInterface { - return new DataTracker( + return new CurrentDataTracker( $this->moduleConfiguration, $this->logger, ModuleConfiguration\ConnectionType::MASTER, diff --git a/src/Data/Providers/ConnectedServices/DoctrineDbal/Versioned/DataProvider.php b/src/Data/Providers/ConnectedServices/DoctrineDbal/VersionedDataProvider.php similarity index 80% rename from src/Data/Providers/ConnectedServices/DoctrineDbal/Versioned/DataProvider.php rename to src/Data/Providers/ConnectedServices/DoctrineDbal/VersionedDataProvider.php index 08e0247239ee03b7ff7391eba2f142679608e500..788da2731d09dc013ab59f1e2ec4e631730d03b2 100644 --- a/src/Data/Providers/ConnectedServices/DoctrineDbal/Versioned/DataProvider.php +++ b/src/Data/Providers/ConnectedServices/DoctrineDbal/VersionedDataProvider.php @@ -2,21 +2,23 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Providers\ConnectedServices\DoctrineDbal\Versioned; +namespace SimpleSAML\Module\accounting\Data\Providers\ConnectedServices\DoctrineDbal; use Psr\Log\LoggerInterface; use SimpleSAML\Module\accounting\Data\Providers\Interfaces\ConnectedServicesInterface; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store; +use SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\VersionedDataTracker; use SimpleSAML\Module\accounting\Data\Trackers\Interfaces\DataTrackerInterface; use SimpleSAML\Module\accounting\Entities\ConnectedService; use SimpleSAML\Module\accounting\Exceptions\StoreException; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use SimpleSAML\Module\accounting\ModuleConfiguration; -class DataProvider implements ConnectedServicesInterface +class VersionedDataProvider implements ConnectedServicesInterface { protected ModuleConfiguration $moduleConfiguration; protected LoggerInterface $logger; - protected \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store $store; + protected Store $store; /** * @throws StoreException @@ -25,12 +27,12 @@ class DataProvider implements ConnectedServicesInterface ModuleConfiguration $moduleConfiguration, LoggerInterface $logger, string $connectionType = ModuleConfiguration\ConnectionType::SLAVE, - \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store $store = null + Store $store = null ) { $this->moduleConfiguration = $moduleConfiguration; $this->logger = $logger; - $this->store = $store ?? new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store( + $this->store = $store ?? new Store( $this->moduleConfiguration, $this->logger, $this->moduleConfiguration->getClassConnectionKey(self::class), @@ -84,7 +86,7 @@ class DataProvider implements ConnectedServicesInterface */ public function getTracker(): ?DataTrackerInterface { - return new \SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\Versioned\DataTracker( + return new VersionedDataTracker( $this->moduleConfiguration, $this->logger, ModuleConfiguration\ConnectionType::MASTER, diff --git a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store.php b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store.php similarity index 93% rename from src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store.php rename to src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store.php index 7b4e290be3132c745a502f79968ad69a503648a7..149b8bca2b4f74c4707bdbdbeb1afd7e7864e7a0 100644 --- a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store.php +++ b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned; use DateTimeImmutable; use Psr\Log\LoggerInterface; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\RawActivity; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Repository; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\RawActivity; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Repository; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store as BaseStore; use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\HashDecoratedState; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store as BaseStore; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Factory; use SimpleSAML\Module\accounting\Data\Stores\Interfaces\ActivityInterface; use SimpleSAML\Module\accounting\Entities\Activity; @@ -140,7 +140,7 @@ class Store extends BaseStore implements ActivityInterface */ public function deleteDataOlderThan(DateTimeImmutable $dateTime): void { - // Only delete authentication events. Versioned data (IdP / SP metadata, user attributes) remain. + // Only delete authentication events. VersionedDataProvider data (IdP / SP metadata, user attributes) remain. $this->repository->deleteAuthenticationEventsOlderThan($dateTime); } } diff --git a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000000CreateIdpTable.php b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000000CreateIdpTable.php similarity index 50% rename from src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000000CreateIdpTable.php rename to src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000000CreateIdpTable.php index bc43464e0f5fc26081cb908c037e7527ca4cf364..ad3f84c692e40dacdf99f7224d2686f537d81475 100644 --- a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000000CreateIdpTable.php +++ b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000000CreateIdpTable.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpTable; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpTable; class Version20220801000000CreateIdpTable extends CreateIdpTable { diff --git a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000100CreateIdpVersionTable.php b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000100CreateIdpVersionTable.php similarity index 56% rename from src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000100CreateIdpVersionTable.php rename to src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000100CreateIdpVersionTable.php index 2f867a4940ed854b1384dabdbd4f759fd3e4db1a..31bb2d4188dd14eea75114169b41ad50e72004cc 100644 --- a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000100CreateIdpVersionTable.php +++ b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000100CreateIdpVersionTable.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; class Version20220801000100CreateIdpVersionTable extends Migrations\CreateIdpVersionTable { diff --git a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000200CreateSpTable.php b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000200CreateSpTable.php similarity index 50% rename from src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000200CreateSpTable.php rename to src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000200CreateSpTable.php index fec8fd4e2056d617919fa3f098c2d4df186a435e..a3405603163cdaf4219bd0ef97ea94f1c149b9b7 100644 --- a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000200CreateSpTable.php +++ b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000200CreateSpTable.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateSpTable; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateSpTable; class Version20220801000200CreateSpTable extends CreateSpTable { diff --git a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000300CreateSpVersionTable.php b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000300CreateSpVersionTable.php similarity index 55% rename from src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000300CreateSpVersionTable.php rename to src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000300CreateSpVersionTable.php index acaa365e93cf6df36eda857c2c8cbe38e3fa2be3..846629b48927de0e1372f68376d31bfd555a5a53 100644 --- a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000300CreateSpVersionTable.php +++ b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000300CreateSpVersionTable.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; class Version20220801000300CreateSpVersionTable extends Migrations\CreateSpVersionTable { diff --git a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000400CreateUserTable.php b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000400CreateUserTable.php similarity index 50% rename from src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000400CreateUserTable.php rename to src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000400CreateUserTable.php index fef4576d38dfdce0347be786f7e209b7a378a80f..de24d65d8b8ae9658aaf15e7c276ebc67f1375c3 100644 --- a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000400CreateUserTable.php +++ b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000400CreateUserTable.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateUserTable; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateUserTable; class Version20220801000400CreateUserTable extends CreateUserTable { diff --git a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000500CreateUserVersionTable.php b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000500CreateUserVersionTable.php similarity index 56% rename from src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000500CreateUserVersionTable.php rename to src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000500CreateUserVersionTable.php index 9e2bee65a7d836c8d4ee9162c30110445144b69c..bd429eefab28380449f6228ec96d42628e606d0f 100644 --- a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000500CreateUserVersionTable.php +++ b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000500CreateUserVersionTable.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; class Version20220801000500CreateUserVersionTable extends Migrations\CreateUserVersionTable { diff --git a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000600CreateIdpSpUserVersionTable.php b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000600CreateIdpSpUserVersionTable.php similarity index 57% rename from src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000600CreateIdpSpUserVersionTable.php rename to src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000600CreateIdpSpUserVersionTable.php index c372d5bd3c210dcde00ac8bf82d50ee895ac530a..4ac4a698e8cc96e2d877fc7ee3367aa7ce26c7a8 100644 --- a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000600CreateIdpSpUserVersionTable.php +++ b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000600CreateIdpSpUserVersionTable.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; class Version20220801000600CreateIdpSpUserVersionTable extends Migrations\CreateIdpSpUserVersionTable { diff --git a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000700CreateAuthenticationEventTable.php b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000700CreateAuthenticationEventTable.php similarity index 94% rename from src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000700CreateAuthenticationEventTable.php rename to src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000700CreateAuthenticationEventTable.php index b838ec669756b4d8f2147a29b3eb60ffb4e60a04..d477b56c40326e5cc546c33aaba8b098c4a7b839 100644 --- a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000700CreateAuthenticationEventTable.php +++ b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000700CreateAuthenticationEventTable.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Types; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\TableConstants; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\TableConstants; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use Throwable; diff --git a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/RawActivity.php b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/RawActivity.php similarity index 99% rename from src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/RawActivity.php rename to src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/RawActivity.php index 3498626e53c9fa25a2e33ebed49c97e895c24a50..ed7b42cba9e6d162f0f6b194f92508eb186fdc98 100644 --- a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/RawActivity.php +++ b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/RawActivity.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store; use DateTimeImmutable; use Doctrine\DBAL\Platforms\AbstractPlatform; diff --git a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Repository.php b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Repository.php similarity index 97% rename from src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Repository.php rename to src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Repository.php index 7a523961565763f9267a1c1bb1e8dca7f8673ee9..7071f0095aae17cde4e04b0d3c709c56d64f1da9 100644 --- a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Repository.php +++ b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Repository.php @@ -2,17 +2,15 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store; use DateTimeImmutable; -use Doctrine\DBAL\ParameterType; -use Doctrine\DBAL\Result; use Doctrine\DBAL\Types\Types; use Psr\Log\LoggerInterface; -use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Repository as BaseRepository; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\TableConstants +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Repository as BaseRepository; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\TableConstants as BaseTableConstants; +use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection; use SimpleSAML\Module\accounting\Exceptions\StoreException; use Throwable; diff --git a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/TableConstants.php b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/TableConstants.php similarity index 89% rename from src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/TableConstants.php rename to src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/TableConstants.php index 91b778dab5f9f661730ea26c855a1c3b51bb3120..df5b36c75d946c921b31f98f26f0358903be457b 100644 --- a/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/TableConstants.php +++ b/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/TableConstants.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\TableConstants as - BaseTableConstants; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\TableConstants + as BaseTableConstants; class TableConstants { diff --git a/src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store.php b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store.php similarity index 65% rename from src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store.php rename to src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store.php index 50b159312f9266d16409f374a4f92d8921da2837..0090783a3631b033a6cf8aa1589180587cdd7066 100644 --- a/src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store.php +++ b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store.php @@ -2,11 +2,12 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Current\DoctrineDbal; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current; use Psr\Log\LoggerInterface; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current\Store\Repository; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current\Store\TableConstants; use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\HashDecoratedState; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Current\DoctrineDbal\Store\Repository; use SimpleSAML\Module\accounting\Data\Stores\Bases\DoctrineDbal\AbstractStore; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Factory; use SimpleSAML\Module\accounting\Data\Stores\Interfaces\StoreInterface; @@ -57,62 +58,6 @@ class Store extends AbstractStore implements StoreInterface ); } - /** - * @throws StoreException - */ - public function resolveIdpId(HashDecoratedState $hashDecoratedState): int - { - $idpEntityIdHashSha256 = $hashDecoratedState->getIdentityProviderEntityIdHashSha256(); - - // Check if it already exists. - try { - $result = $this->repository->getIdp($idpEntityIdHashSha256); - $idpId = $result->fetchOne(); - - if ($idpId !== false) { - return (int)$idpId; - } - } catch (Throwable $exception) { - $message = sprintf('Error resolving Idp ID. Error was: %s.', $exception->getMessage()); - throw new StoreException($message, (int)$exception->getCode(), $exception); - } - - // Create new - try { - $this->repository->insertIdp( - $hashDecoratedState->getState()->getIdentityProviderEntityId(), - $idpEntityIdHashSha256, - serialize($hashDecoratedState->getState()->getIdentityProviderMetadata()), - $hashDecoratedState->getIdentityProviderMetadataArrayHashSha256(), - ); - } catch (Throwable $exception) { - $message = sprintf( - 'Error inserting new IdP, however, continuing in case of race condition. Error was: %s.', - $exception->getMessage() - ); - $this->logger->warning($message); - } - - // Try again, this time it should exist... - try { - $result = $this->repository->getIdp($idpEntityIdHashSha256); - $idpIdNew = $result->fetchOne(); - - if ($idpIdNew !== false) { - return (int)$idpIdNew; - } - - $message = sprintf( - 'Error fetching IdP ID even after insertion for entity ID hash SHA256 %s.', - $idpEntityIdHashSha256 - ); - throw new StoreException($message); - } catch (Throwable $exception) { - $message = sprintf('Error resolving Idp ID. Error was: %s.', $exception->getMessage()); - throw new StoreException($message, (int)$exception->getCode(), $exception); - } - } - /** * @throws StoreException */ @@ -123,10 +68,22 @@ class Store extends AbstractStore implements StoreInterface // Check if it already exists. try { $result = $this->repository->getSp($spEntityIdHashSha256); - $spId = $result->fetchOne(); - - if ($spId !== false) { - return (int)$spId; + $sp = $result->fetchAssociative(); + + if ($sp !== false) { + $spId = (int)$sp[TableConstants::TABLE_SP_COLUMN_NAME_ID]; + // If metadata hash is different, update metadata. + if ( + $sp[TableConstants::TABLE_SP_COLUMN_NAME_METADATA_HASH_SHA256] !== + $hashDecoratedState->getServiceProviderMetadataArrayHashSha256() + ) { + $this->repository->updateSp( + $spId, + serialize($hashDecoratedState->getState()->getServiceProviderMetadata()), + $hashDecoratedState->getServiceProviderMetadataArrayHashSha256() + ); + } + return $spId; } } catch (Throwable $exception) { $message = sprintf('Error resolving SP ID. Error was: %s.', $exception->getMessage()); @@ -282,57 +239,4 @@ class Store extends AbstractStore implements StoreInterface throw new StoreException($message, (int)$exception->getCode(), $exception); } } - - /** - * @throws StoreException - */ - public function resolveIdpSpUserVersionId(int $idpVersionId, int $spVersionId, int $userVersionId): int - { - // Check if it already exists. - try { - $result = $this->repository->getIdpSpUserVersion($idpVersionId, $spVersionId, $userVersionId); - $IdpSpUserVersionId = $result->fetchOne(); - - if ($IdpSpUserVersionId !== false) { - return (int)$IdpSpUserVersionId; - } - } catch (Throwable $exception) { - $message = sprintf('Error resolving IdpSpUserVersion ID. Error was: %s.', $exception->getMessage()); - throw new StoreException($message, (int)$exception->getCode(), $exception); - } - - // Create new - try { - $this->repository->insertIdpSpUserVersion($idpVersionId, $spVersionId, $userVersionId); - } catch (Throwable $exception) { - $message = sprintf( - 'Error inserting new IdpSpUserVersion, however, continuing in case of race condition. ' . - 'Error was: %s.', - $exception->getMessage() - ); - $this->logger->warning($message); - } - - // Try again, this time it should exist... - try { - $result = $this->repository->getIdpSpUserVersion($idpVersionId, $spVersionId, $userVersionId); - $IdpSpUserVersionIdNew = $result->fetchOne(); - - if ($IdpSpUserVersionIdNew !== false) { - return (int)$IdpSpUserVersionIdNew; - } - - $message = sprintf( - 'Error fetching IdpSpUserVersion ID even after insertion for IdpVersion %s, SpVersion ID %s and ' . - 'UserVersion ID %s.', - $idpVersionId, - $spVersionId, - $userVersionId - ); - throw new StoreException($message); - } catch (Throwable $exception) { - $message = sprintf('Error resolving IdpSpUserVersion ID. Error was: %s.', $exception->getMessage()); - throw new StoreException($message, (int)$exception->getCode(), $exception); - } - } } diff --git a/src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store/Migrations/CreateIdpTable.php b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store/Migrations/CreateIdpTable.php similarity index 94% rename from src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store/Migrations/CreateIdpTable.php rename to src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store/Migrations/CreateIdpTable.php index e9e37dde7e5161d13a9d25eb5e43d47da7322651..840cd8fbe8c9b98870bb6b36ff8f035ea6a4f314 100644 --- a/src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store/Migrations/CreateIdpTable.php +++ b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store/Migrations/CreateIdpTable.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Current\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current\Store\Migrations; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Types; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current\Store\TableConstants; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Current\DoctrineDbal\Store\TableConstants; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use Throwable; diff --git a/src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store/Migrations/CreateSpTable.php b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store/Migrations/CreateSpTable.php similarity index 94% rename from src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store/Migrations/CreateSpTable.php rename to src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store/Migrations/CreateSpTable.php index 1fbdb92c1649653e00dc4560ad751fedbaa7c464..5551faf0e6b12907fbb4b1d8d0e02e6b53174a30 100644 --- a/src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store/Migrations/CreateSpTable.php +++ b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store/Migrations/CreateSpTable.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Current\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current\Store\Migrations; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Types; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current\Store\TableConstants; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Current\DoctrineDbal\Store\TableConstants; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use Throwable; diff --git a/src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store/Migrations/CreateUserTable.php b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store/Migrations/CreateUserTable.php similarity index 93% rename from src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store/Migrations/CreateUserTable.php rename to src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store/Migrations/CreateUserTable.php index 538fa91ca90bccd584dc84bfbe9baee7b94045bb..090357d69e9484499309c44a5ca737c4f62b8496 100644 --- a/src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store/Migrations/CreateUserTable.php +++ b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store/Migrations/CreateUserTable.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Current\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current\Store\Migrations; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Types; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current\Store\TableConstants; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Current\DoctrineDbal\Store\TableConstants; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use Throwable; diff --git a/src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store/Migrations/CreateUserVersionTable.php b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store/Migrations/CreateUserVersionTable.php similarity index 63% rename from src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store/Migrations/CreateUserVersionTable.php rename to src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store/Migrations/CreateUserVersionTable.php index 94bffff18c103bacde93b3927fba68ed2b5cdfc8..4bfee438cc4df6b76537bd166a3c96e94d63fca5 100644 --- a/src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store/Migrations/CreateUserVersionTable.php +++ b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store/Migrations/CreateUserVersionTable.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Current\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current\Store\Migrations; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateUserTable +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateUserTable as VersionedCreateUserTable; class CreateUserVersionTable extends VersionedCreateUserTable diff --git a/src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store/Repository.php b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store/Repository.php similarity index 99% rename from src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store/Repository.php rename to src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store/Repository.php index 20eb0a57b0858974b10fd57da057791f2fddde34..7ec179ccefcacbee5ca94ad50a9c9afa03dd3ecf 100644 --- a/src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store/Repository.php +++ b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store/Repository.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Current\DoctrineDbal\Store; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current\Store; use DateTimeImmutable; use Doctrine\DBAL\ParameterType; @@ -291,7 +291,7 @@ class Repository * @throws StoreException */ public function updateSp( - string $spId, + int $spId, string $metadata, string $metadataHashSha256, DateTimeImmutable $updatedAt = null @@ -341,7 +341,7 @@ class Repository $queryBuilder->executeStatement(); } catch (Throwable $exception) { $message = sprintf('Error executing query to update SP. Error was: %s.', $exception->getMessage()); - $this->logger->error($message, compact('spId','metadata', 'metadataHashSha256')); + $this->logger->error($message, compact('spId', 'metadata', 'metadataHashSha256')); throw new StoreException($message, (int)$exception->getCode(), $exception); } } diff --git a/src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store/TableConstants.php b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store/TableConstants.php similarity index 98% rename from src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store/TableConstants.php rename to src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store/TableConstants.php index 1b71f8068e7b71bec87f33b446db5474e94047b4..40b45a00b61dc6f2ec2ea4d6119d7e01c6544d8e 100644 --- a/src/Data/Stores/Accounting/Bases/Current/DoctrineDbal/Store/TableConstants.php +++ b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Current/Store/TableConstants.php @@ -2,7 +2,8 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Current\DoctrineDbal\Store; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current\Store; + use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\TableConstants as BaseTableConstants; class TableConstants extends BaseTableConstants diff --git a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store.php b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store.php similarity index 99% rename from src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store.php rename to src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store.php index cc6a9acb85edec505237dd855dba49d5de236b0a..6c3214b6565d5629f0d4a7d272159b63a325688e 100644 --- a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store.php +++ b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned; use Psr\Log\LoggerInterface; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Repository; use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\HashDecoratedState; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Repository; use SimpleSAML\Module\accounting\Data\Stores\Bases\DoctrineDbal\AbstractStore; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Factory; use SimpleSAML\Module\accounting\Data\Stores\Interfaces\StoreInterface; diff --git a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateIdpSpUserVersionTable.php b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateIdpSpUserVersionTable.php similarity index 98% rename from src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateIdpSpUserVersionTable.php rename to src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateIdpSpUserVersionTable.php index 7037e257d6b1f3b072a3b660ba5984df548e8f0e..dd05d1d3396f692e71464b975054a7493975980b 100644 --- a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateIdpSpUserVersionTable.php +++ b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateIdpSpUserVersionTable.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Types; diff --git a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateIdpTable.php b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateIdpTable.php similarity index 93% rename from src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateIdpTable.php rename to src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateIdpTable.php index 917f957a78bab10ebf3f2942407f23c01af35747..7a37729835d79bc1dc1269406081ffd19215cf91 100644 --- a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateIdpTable.php +++ b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateIdpTable.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Types; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\TableConstants; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\TableConstants; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use Throwable; diff --git a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateIdpVersionTable.php b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateIdpVersionTable.php similarity index 93% rename from src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateIdpVersionTable.php rename to src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateIdpVersionTable.php index ae72dc4a9d818b0701ed292823796ad7b12fa188..fdbd7c5240b20734e02756c8940db0ab2717d70d 100644 --- a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateIdpVersionTable.php +++ b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateIdpVersionTable.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Types; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\TableConstants; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\TableConstants; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use Throwable; diff --git a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateSpTable.php b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateSpTable.php similarity index 93% rename from src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateSpTable.php rename to src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateSpTable.php index ab7221171f9c8e23ccbb09df2b3499da6e211256..a168bdfc1f1dd0c3225cf92a7196f0f07504de3e 100644 --- a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateSpTable.php +++ b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateSpTable.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Types; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\TableConstants; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\TableConstants; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use Throwable; diff --git a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateSpVersionTable.php b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateSpVersionTable.php similarity index 93% rename from src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateSpVersionTable.php rename to src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateSpVersionTable.php index 9eb05f508c13843cb353b87fcec15eb88722c6e3..6f7a4c097d3bcd08b5b46885c50af2cbf8fa4260 100644 --- a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateSpVersionTable.php +++ b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateSpVersionTable.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Types; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\TableConstants; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\TableConstants; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use Throwable; diff --git a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateUserTable.php b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateUserTable.php similarity index 93% rename from src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateUserTable.php rename to src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateUserTable.php index 410af1376c532a54bffea3ce055c1e585fa9fbdb..511bf5b71e3b3dddb0b7cafdb1964055d1fe638a 100644 --- a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateUserTable.php +++ b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateUserTable.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Types; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\TableConstants; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\TableConstants; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use Throwable; diff --git a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateUserVersionTable.php b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateUserVersionTable.php similarity index 94% rename from src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateUserVersionTable.php rename to src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateUserVersionTable.php index 8781957e52837c3aa6f8a5270712746050b3b836..54b2693c37cdccdd75c9e33ae3c721b29c64ad7c 100644 --- a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateUserVersionTable.php +++ b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateUserVersionTable.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Types; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\TableConstants; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\TableConstants; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use Throwable; diff --git a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Repository.php b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Repository.php similarity index 99% rename from src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Repository.php rename to src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Repository.php index 7b70cb9daf25eeefcae441a2c2a3b2b64877eb3d..0284c4e585714741f9582fbbf404e52d4501c0ab 100644 --- a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Repository.php +++ b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Repository.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store; use DateTimeImmutable; use Doctrine\DBAL\ParameterType; diff --git a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/TableConstants.php b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/TableConstants.php similarity index 99% rename from src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/TableConstants.php rename to src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/TableConstants.php index 178ce1c9719d75b45a720237c12ae368a64605fd..72da4602674a14fae4187777f9c9ff45f759938c 100644 --- a/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/TableConstants.php +++ b/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/TableConstants.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store; +namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store; use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\TableConstants as BaseTableConstants; diff --git a/src/Data/Stores/Accounting/Bases/TableConstants.php b/src/Data/Stores/Accounting/Bases/TableConstants.php index a21e461c1dffbdf2a2fe64bbabb35c1dfa5b2639..5f5d656ce9f24ed0223294a69fd1d0530ef638d2 100644 --- a/src/Data/Stores/Accounting/Bases/TableConstants.php +++ b/src/Data/Stores/Accounting/Bases/TableConstants.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases; class TableConstants diff --git a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store.php b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store.php index 4f8427f7705781f159a26ab037cc80b2d331bc97..8e84d9cd328ef6c07bee3931c53064d738eb49bf 100644 --- a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store.php +++ b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store.php @@ -6,7 +6,7 @@ namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\ use DateTimeImmutable; use Psr\Log\LoggerInterface; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Current\DoctrineDbal\Store as BaseStore; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current\Store as BaseStore; use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\HashDecoratedState; use SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Current\Store\Repository; use SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\RawConnectedService; @@ -80,7 +80,7 @@ class Store extends BaseStore implements ConnectedServicesInterface /** @psalm-suppress MixedAssignment */ $connectedServiceId = $this->repository->getConnectedService($spId, $userId)->fetchOne(); - if ($connectedServiceId!== false) { + if ($connectedServiceId !== false) { $this->repository->updateConnectedServiceVersionCount( (int)$connectedServiceId, $userVersionId, diff --git a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/Migrations/Version20240505100CreateSpTable.php b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/Migrations/Version20240505100CreateSpTable.php index 1362d3e4e751745d42619a04a99c187b49478c0b..8f5d2ee52b349a4424a247ba17b988dc6ef14345 100644 --- a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/Migrations/Version20240505100CreateSpTable.php +++ b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/Migrations/Version20240505100CreateSpTable.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Current\Store\Migrations; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Current\DoctrineDbal\Store\Migrations\CreateSpTable; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current\Store\Migrations\CreateSpTable; class Version20240505100CreateSpTable extends CreateSpTable { diff --git a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/Migrations/Version20240505200CreateUserTable.php b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/Migrations/Version20240505200CreateUserTable.php index 0e0772ea570c287440580772bceba4deef407f45..2120b20dc5c4b7d231c0410a1b6a56fd321c43a1 100644 --- a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/Migrations/Version20240505200CreateUserTable.php +++ b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/Migrations/Version20240505200CreateUserTable.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Current\Store\Migrations; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Current\DoctrineDbal\Store\Migrations\CreateUserTable; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current\Store\Migrations\CreateUserTable; class Version20240505200CreateUserTable extends CreateUserTable { diff --git a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/Migrations/Version20240505300CreateUserVersionTable.php b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/Migrations/Version20240505300CreateUserVersionTable.php index 510edc44e5e20f546eb95e5fd008bae0f480bc63..f3a60f29c4618a965ef55ee4d58a03b9873a0168 100644 --- a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/Migrations/Version20240505300CreateUserVersionTable.php +++ b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/Migrations/Version20240505300CreateUserVersionTable.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Current\Store\Migrations; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Current\DoctrineDbal\Store\Migrations\CreateUserVersionTable; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current\Store\Migrations; -class Version20240505300CreateUserVersionTable extends CreateUserVersionTable +class Version20240505300CreateUserVersionTable extends Migrations\CreateUserVersionTable { } diff --git a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/Repository.php b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/Repository.php index f36c77d805bb6a0cbc7fb6255ea31f549ac6b8a7..74a8e6264d64dd2f33bbe01513e1315b9acf8120 100644 --- a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/Repository.php +++ b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/Repository.php @@ -9,8 +9,9 @@ use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\Result; use Doctrine\DBAL\Types\Types; use Psr\Log\LoggerInterface; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Current\DoctrineDbal\Store\Repository as BaseRepository; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Current\DoctrineDbal\Store\TableConstants as BaseTableConstants; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current\Store\Repository as BaseRepository; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current\Store\TableConstants + as BaseTableConstants; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection; use SimpleSAML\Module\accounting\Exceptions\StoreException; use Throwable; @@ -68,7 +69,7 @@ class Repository extends BaseRepository 'Error executing query to get connected service. Error was: %s.', $exception->getMessage() ); - $this->logger->error($message, compact( 'spId', 'userId')); + $this->logger->error($message, compact('spId', 'userId')); throw new StoreException($message, (int)$exception->getCode(), $exception); } } @@ -237,27 +238,21 @@ class Repository extends BaseRepository BaseTableConstants::TABLE_ALIAS_SP . '.' . BaseTableConstants::TABLE_SP_COLUMN_NAME_ENTITY_ID . ' AS ' . TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_SP_ENTITY_ID, - TableConstants::TABLE_ALIAS_CONNECTED_SERVICE . '.' . TableConstants::TABLE_CONNECTED_SERVICE_COLUMN_NAME_COUNT . ' AS ' . TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_NUMBER_OF_AUTHENTICATIONS, - TableConstants::TABLE_ALIAS_CONNECTED_SERVICE . '.' . TableConstants::TABLE_CONNECTED_SERVICE_COLUMN_NAME_LAST_AUTHENTICATION_AT . ' AS ' . TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_LAST_AUTHENTICATION_AT, - TableConstants::TABLE_ALIAS_CONNECTED_SERVICE . '.' . TableConstants::TABLE_CONNECTED_SERVICE_COLUMN_NAME_FIRST_AUTHENTICATION_AT . ' AS ' . TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_FIRST_AUTHENTICATION_AT, - BaseTableConstants::TABLE_ALIAS_SP . '.' . BaseTableConstants::TABLE_SP_COLUMN_NAME_METADATA . ' AS ' . TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_SP_METADATA, - BaseTableConstants::TABLE_ALIAS_USER_VERSION . '.' . BaseTableConstants::TABLE_USER_VERSION_COLUMN_NAME_ATTRIBUTES . ' AS ' . TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_USER_ATTRIBUTES, - )->from($this->tableNameConnectedService, TableConstants::TABLE_ALIAS_CONNECTED_SERVICE) ->innerJoin( //'ccs', diff --git a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/TableConstants.php b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/TableConstants.php index 3e221104820e3fa6319fb49310ae4be2c4294c71..d0331be7b040900eca9b549e26e09bdc11bec9e0 100644 --- a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/TableConstants.php +++ b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Current/Store/TableConstants.php @@ -4,7 +4,8 @@ declare(strict_types=1); namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Current\Store; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Current\DoctrineDbal\Store\TableConstants as BaseTableConstants; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Current\Store\TableConstants + as BaseTableConstants; class TableConstants { diff --git a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store.php b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store.php index 2038d7ba242997b151e88bf84e5e02c5ca1743c4..6887a5bff291b1b36398e09e0cb633b9a6c94de7 100644 --- a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store.php +++ b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store.php @@ -6,8 +6,9 @@ namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\ use DateTimeImmutable; use Psr\Log\LoggerInterface; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store as BaseStore; use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\HashDecoratedState; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store as BaseStore; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\RawConnectedService; use SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Repository; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Factory; use SimpleSAML\Module\accounting\Data\Stores\Interfaces\ConnectedServicesInterface; @@ -115,7 +116,7 @@ class Store extends BaseStore implements ConnectedServicesInterface /** @var array $result */ foreach ($results as $result) { - $rawConnectedServiceProvider = new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\RawConnectedService($result, $databasePlatform); + $rawConnectedServiceProvider = new RawConnectedService($result, $databasePlatform); $serviceProvider = $this->helpersManager ->getProviderResolver() diff --git a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000000CreateIdpTable.php b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000000CreateIdpTable.php index 3f33791316f876245c4da977b7a9091a561c1b58..69e5d76ecd74ca9c29d542f05c5347a5ae6581f2 100644 --- a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000000CreateIdpTable.php +++ b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000000CreateIdpTable.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Migrations; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpTable; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; -class Version20220801000000CreateIdpTable extends CreateIdpTable +class Version20220801000000CreateIdpTable extends Migrations\CreateIdpTable { } diff --git a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000100CreateIdpVersionTable.php b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000100CreateIdpVersionTable.php index 4bc4702095cc334bd79b18304ecbb250897debbd..70d4af584a1fe613ecd5f6bdcc10a9eab73a8717 100644 --- a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000100CreateIdpVersionTable.php +++ b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000100CreateIdpVersionTable.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Migrations; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; class Version20220801000100CreateIdpVersionTable extends Migrations\CreateIdpVersionTable { diff --git a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000200CreateSpTable.php b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000200CreateSpTable.php index c1c207d59da3aa3439b26dd95d85db062a1b6274..7a23c8e2d04ef925576f5562d3c0a060429f67f5 100644 --- a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000200CreateSpTable.php +++ b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000200CreateSpTable.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Migrations; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateSpTable; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; -class Version20220801000200CreateSpTable extends CreateSpTable +class Version20220801000200CreateSpTable extends Migrations\CreateSpTable { } diff --git a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000300CreateSpVersionTable.php b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000300CreateSpVersionTable.php index e49f8a8c5608e7d12608604d695d865c3893bf54..4a300071485ccee1eb28fcdba9997c295ffdfee0 100644 --- a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000300CreateSpVersionTable.php +++ b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000300CreateSpVersionTable.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Migrations; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; class Version20220801000300CreateSpVersionTable extends Migrations\CreateSpVersionTable { diff --git a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000400CreateUserTable.php b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000400CreateUserTable.php index 4ebc64756db415ae494da3622df0bc0ba514c5d3..30b6b9d0a242c20e4c21f95da9c4a8ab7b34abfa 100644 --- a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000400CreateUserTable.php +++ b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000400CreateUserTable.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Migrations; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateUserTable; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; -class Version20220801000400CreateUserTable extends CreateUserTable +class Version20220801000400CreateUserTable extends Migrations\CreateUserTable { } diff --git a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000500CreateUserVersionTable.php b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000500CreateUserVersionTable.php index 93fb271ee40ed590de3944408629253eed864d7d..71c01901baa4bd83bd033ecfdc4a1e6258198c69 100644 --- a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000500CreateUserVersionTable.php +++ b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000500CreateUserVersionTable.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Migrations; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; class Version20220801000500CreateUserVersionTable extends Migrations\CreateUserVersionTable { diff --git a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000600CreateIdpSpUserVersionTable.php b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000600CreateIdpSpUserVersionTable.php index 69fa2d3d973ff9efeec1c8a8ba8f3afbdaa37913..6d4427b40392a097f3ae3ed7bb7178f4e3782498 100644 --- a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000600CreateIdpSpUserVersionTable.php +++ b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Migrations/Version20220801000600CreateIdpSpUserVersionTable.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Migrations; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; class Version20220801000600CreateIdpSpUserVersionTable extends Migrations\CreateIdpSpUserVersionTable { diff --git a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Repository.php b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Repository.php index 38d99c22310795adbe05263b4058a79ccc365f36..51f2f5a849382ce83cd96284b461e06bc1a098eb 100644 --- a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Repository.php +++ b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/Repository.php @@ -9,8 +9,9 @@ use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\Result; use Doctrine\DBAL\Types\Types; use Psr\Log\LoggerInterface; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Repository as BaseRepository; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\TableConstants as BaseTableConstants; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Repository as BaseRepository; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\TableConstants + as BaseTableConstants; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection; use SimpleSAML\Module\accounting\Exceptions\StoreException; use Throwable; diff --git a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/TableConstants.php b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/TableConstants.php index 350428f28f5ac734b7446ea1256e92904a62280b..028c4d501dc256f2363b09af35a46891b2ba7cf2 100644 --- a/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/TableConstants.php +++ b/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/TableConstants.php @@ -4,7 +4,8 @@ declare(strict_types=1); namespace SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\TableConstants as BaseTableConstants; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\TableConstants + as BaseTableConstants; class TableConstants { diff --git a/src/Data/Trackers/Activity/Versioned/DoctrineDbal/DataTracker.php b/src/Data/Trackers/Activity/DoctrineDbal/VersionedDataTracker.php similarity index 63% rename from src/Data/Trackers/Activity/Versioned/DoctrineDbal/DataTracker.php rename to src/Data/Trackers/Activity/DoctrineDbal/VersionedDataTracker.php index 5d1c786a303606e260fa18fb0cacd289c3c8b871..8f30682233ad5f30284d94da2d16c25a15ef8f40 100644 --- a/src/Data/Trackers/Activity/Versioned/DoctrineDbal/DataTracker.php +++ b/src/Data/Trackers/Activity/DoctrineDbal/VersionedDataTracker.php @@ -2,23 +2,18 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Trackers\Activity\Versioned\DoctrineDbal; +namespace SimpleSAML\Module\accounting\Data\Trackers\Activity\DoctrineDbal; use DateInterval; use DateTimeImmutable; use Psr\Log\LoggerInterface; -use SimpleSAML\Module\accounting\Data\Providers\Activity\Versioned\DoctrineDbal\DataProvider; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store; -use SimpleSAML\Module\accounting\Data\Stores\Interfaces\DataStoreInterface; +use SimpleSAML\Module\accounting\Data\Providers\Activity\DoctrineDbal\VersionedDataProvider; use SimpleSAML\Module\accounting\Data\Trackers\Interfaces\DataTrackerInterface; -use SimpleSAML\Module\accounting\Entities\Activity; use SimpleSAML\Module\accounting\Entities\Authentication\Event; -use SimpleSAML\Module\accounting\Entities\ConnectedService; use SimpleSAML\Module\accounting\Exceptions\StoreException; use SimpleSAML\Module\accounting\ModuleConfiguration; -use SimpleSAML\Module\accounting\Services\HelpersManager; -class DataTracker extends DataProvider implements DataTrackerInterface +class VersionedDataTracker extends VersionedDataProvider implements DataTrackerInterface { /** * @throws StoreException diff --git a/src/Data/Trackers/ConnectedServices/DoctrineDbal/Versioned/DataTracker.php b/src/Data/Trackers/ConnectedServices/DoctrineDbal/CurrentDataTracker.php similarity index 89% rename from src/Data/Trackers/ConnectedServices/DoctrineDbal/Versioned/DataTracker.php rename to src/Data/Trackers/ConnectedServices/DoctrineDbal/CurrentDataTracker.php index 1e6a8199a8754fe455820290bfe2c1e65613d45e..0ff530fcada5f5aa1916c2efc5fad8e3eb95d89b 100644 --- a/src/Data/Trackers/ConnectedServices/DoctrineDbal/Versioned/DataTracker.php +++ b/src/Data/Trackers/ConnectedServices/DoctrineDbal/CurrentDataTracker.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\Versioned; +namespace SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal; use DateInterval; use DateTimeImmutable; use Psr\Log\LoggerInterface; -use SimpleSAML\Module\accounting\Data\Providers\ConnectedServices\DoctrineDbal\Versioned\DataProvider; +use SimpleSAML\Module\accounting\Data\Providers\ConnectedServices\DoctrineDbal\CurrentDataProvider; use SimpleSAML\Module\accounting\Data\Trackers\Interfaces\DataTrackerInterface; use SimpleSAML\Module\accounting\Entities\Authentication\Event; use SimpleSAML\Module\accounting\Exceptions\StoreException; use SimpleSAML\Module\accounting\ModuleConfiguration; -class DataTracker extends DataProvider implements DataTrackerInterface +class CurrentDataTracker extends CurrentDataProvider implements DataTrackerInterface { /** * @throws StoreException diff --git a/src/Data/Trackers/ConnectedServices/DoctrineDbal/Current/DataTracker.php b/src/Data/Trackers/ConnectedServices/DoctrineDbal/VersionedDataTracker.php similarity index 88% rename from src/Data/Trackers/ConnectedServices/DoctrineDbal/Current/DataTracker.php rename to src/Data/Trackers/ConnectedServices/DoctrineDbal/VersionedDataTracker.php index ae18ff1006d0c79655697485024c477538c96d67..96013b0974ac4eed693db57b36d8a4a7634c432b 100644 --- a/src/Data/Trackers/ConnectedServices/DoctrineDbal/Current/DataTracker.php +++ b/src/Data/Trackers/ConnectedServices/DoctrineDbal/VersionedDataTracker.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\Current; +namespace SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal; use DateInterval; use DateTimeImmutable; use Psr\Log\LoggerInterface; -use SimpleSAML\Module\accounting\Data\Providers\ConnectedServices\DoctrineDbal\Current\DataProvider; +use SimpleSAML\Module\accounting\Data\Providers\ConnectedServices\DoctrineDbal\VersionedDataProvider; use SimpleSAML\Module\accounting\Data\Trackers\Interfaces\DataTrackerInterface; use SimpleSAML\Module\accounting\Entities\Authentication\Event; use SimpleSAML\Module\accounting\Exceptions\StoreException; use SimpleSAML\Module\accounting\ModuleConfiguration; -class DataTracker extends DataProvider implements DataTrackerInterface +class VersionedDataTracker extends VersionedDataProvider implements DataTrackerInterface { /** * @throws StoreException diff --git a/src/Entities/Authentication/Event/State/Oidc.php b/src/Entities/Authentication/Event/State/Oidc.php index 3e7df9296d72942d7c506d34c96eb5ab7af3704e..a2243145d4dabca63fcee02a29900d9598e62699 100644 --- a/src/Entities/Authentication/Event/State/Oidc.php +++ b/src/Entities/Authentication/Event/State/Oidc.php @@ -31,7 +31,7 @@ class Oidc extends AbstractState return $oidcState[self::KEY_OPEN_ID_PROVIDER_METADATA]; } - throw new UnexpectedValueException('State array does not contain OpenID DataProvider metadata.'); + throw new UnexpectedValueException('State array does not contain OpenID VersionedDataProvider metadata.'); } protected function resolveIdentityProviderEntityId(): string @@ -43,7 +43,7 @@ class Oidc extends AbstractState return $this->identityProviderMetadata[Identity\Oidc::METADATA_KEY_ENTITY_ID]; } - throw new UnexpectedValueException('OpenID DataProvider metadata array does not contain issuer.'); + throw new UnexpectedValueException('OpenID VersionedDataProvider metadata array does not contain issuer.'); } protected function resolveServiceProviderMetadata(array $state): array diff --git a/src/Entities/ConnectedService.php b/src/Entities/ConnectedService.php index 948e2c5e9592e6cc2526bed82843b5d35a743641..2a6347b02c7178bf58ed7d98439ea47bbcdfa735 100644 --- a/src/Entities/ConnectedService.php +++ b/src/Entities/ConnectedService.php @@ -8,7 +8,7 @@ use DateTimeImmutable; use SimpleSAML\Module\accounting\Entities\Interfaces\ServiceProviderInterface; /** - * Represents a Service DataProvider to which a user has authenticated at least once. + * Represents a Service VersionedDataProvider to which a user has authenticated at least once. */ class ConnectedService { diff --git a/src/Entities/Providers/Identity/Oidc.php b/src/Entities/Providers/Identity/Oidc.php index 16df50e44f66c6a19d550aaee4288e16c7951734..c662f78753be98476d0c03d8086fb94a0dafa24b 100644 --- a/src/Entities/Providers/Identity/Oidc.php +++ b/src/Entities/Providers/Identity/Oidc.php @@ -36,7 +36,7 @@ class Oidc extends AbstractProvider implements IdentityProviderInterface return $this->metadata[self::METADATA_KEY_ENTITY_ID]; } - throw new MetadataException('OpenID DataProvider metadata does not contain entity ID.'); + throw new MetadataException('OpenID VersionedDataProvider metadata does not contain entity ID.'); } public function getProtocol(): AuthenticationProtocolInterface diff --git a/src/Entities/Providers/Service/Oidc.php b/src/Entities/Providers/Service/Oidc.php index 37332306a37d0222bb16e01c3ca3d72de896fbfd..5f5ff82477128169db5708b40932172d79b54a6d 100644 --- a/src/Entities/Providers/Service/Oidc.php +++ b/src/Entities/Providers/Service/Oidc.php @@ -38,7 +38,7 @@ class Oidc extends AbstractProvider implements ServiceProviderInterface return $this->metadata[self::METADATA_KEY_ENTITY_ID]; } - throw new MetadataException('Relying DataProvider metadata does not contain entity ID.'); + throw new MetadataException('Relying VersionedDataProvider metadata does not contain entity ID.'); } public function getProtocol(): AuthenticationProtocolInterface diff --git a/src/ModuleConfiguration.php b/src/ModuleConfiguration.php index b1cf74407e7bb1b3484e03a552841b868b9ec23f..7926be502059222a03bc413f2c0ee60f49654b44 100644 --- a/src/ModuleConfiguration.php +++ b/src/ModuleConfiguration.php @@ -337,7 +337,7 @@ class ModuleConfiguration foreach ($this->getProviderClasses() as $providerClass) { if (!is_subclass_of($providerClass, DataProviderInterface::class)) { $errors[] = sprintf( - 'DataProvider class \'%s\' does not implement interface \'%s\'.', + 'VersionedDataProvider class \'%s\' does not implement interface \'%s\'.', $providerClass, DataProviderInterface::class ); @@ -363,7 +363,7 @@ class ModuleConfiguration $errors[] = 'Additional trackers array must contain class strings only.'; } elseif (!is_subclass_of($trackerClass, DataTrackerInterface::class)) { $errors[] = sprintf( - 'DataTracker class \'%s\' does not implement interface \'%s\'.', + 'VersionedDataTracker class \'%s\' does not implement interface \'%s\'.', $trackerClass, DataTrackerInterface::class ); diff --git a/src/Services/JobRunner.php b/src/Services/JobRunner.php index 65e46f024300571e30d75cc182a9a8c415a77ffa..f73796c97b3d1b0b6b8d345940856e8a4e0e0b04 100644 --- a/src/Services/JobRunner.php +++ b/src/Services/JobRunner.php @@ -312,7 +312,7 @@ class JobRunner } if ($cachedState->getJobRunnerId() !== $this->jobRunnerId) { - $message = 'Current job runner ID differs from the ID in the cached state.'; + $message = 'CurrentDataProvider job runner ID differs from the ID in the cached state.'; throw new Exception($message); } diff --git a/tests/config-templates/config.php b/tests/config-templates/config.php index 5cdba7904a171cb76404044753802e2f92728d6d..d9f238c718dbf009c84c74c425337f8931fbd223 100644 --- a/tests/config-templates/config.php +++ b/tests/config-templates/config.php @@ -906,7 +906,7 @@ $config = [ *************************************/ /* - * DataTracker processing filters that will be executed for all IdPs + * VersionedDataTracker processing filters that will be executed for all IdPs */ 'authproc.idp' => [ /* Enable the authproc filter below to add URN prefixes to all attributes @@ -961,7 +961,7 @@ $config = [ ], /* - * DataTracker processing filters that will be executed for all SPs + * VersionedDataTracker processing filters that will be executed for all SPs */ 'authproc.sp' => [ /* diff --git a/tests/config-templates/module_accounting.php b/tests/config-templates/module_accounting.php index c0c0f8799aee451bc34e06490e5df6fae0f6ed7c..014f2e51d17f002891a5f9312833b4fb0e3198fa 100644 --- a/tests/config-templates/module_accounting.php +++ b/tests/config-templates/module_accounting.php @@ -19,10 +19,10 @@ $config = [ ModuleConfiguration::OPTION_JOBS_STORE => Stores\Jobs\DoctrineDbal\Store::class, ModuleConfiguration::OPTION_PROVIDER_FOR_ACTIVITY => - Providers\Activity\Versioned\DoctrineDbal\DataProvider::class, + Providers\Activity\DoctrineDbal\VersionedDataProvider::class, ModuleConfiguration::OPTION_PROVIDER_FOR_CONNECTED_SERVICES => - Providers\ConnectedServices\DoctrineDbal\Versioned\DataProvider::class, + Providers\ConnectedServices\DoctrineDbal\VersionedDataProvider::class, ModuleConfiguration::OPTION_ADDITIONAL_TRACKERS => [ // @@ -30,13 +30,13 @@ $config = [ ModuleConfiguration::OPTION_CLASS_TO_CONNECTION_MAP => [ Stores\Jobs\DoctrineDbal\Store::class => 'doctrine_dbal_pdo_sqlite', - Providers\Activity\Versioned\DoctrineDbal\DataProvider::class => [ + Providers\Activity\DoctrineDbal\VersionedDataProvider::class => [ ModuleConfiguration\ConnectionType::MASTER => 'doctrine_dbal_pdo_sqlite', ModuleConfiguration\ConnectionType::SLAVE => [ 'doctrine_dbal_pdo_sqlite_slave', ], ], - Providers\ConnectedServices\DoctrineDbal\Versioned\DataProvider::class => [ + Providers\ConnectedServices\DoctrineDbal\VersionedDataProvider::class => [ ModuleConfiguration\ConnectionType::MASTER => 'doctrine_dbal_pdo_sqlite', ModuleConfiguration\ConnectionType::SLAVE => [ 'doctrine_dbal_pdo_sqlite_slave', diff --git a/tests/src/Auth/Process/AccountingTest.php b/tests/src/Auth/Process/AccountingTest.php index 98ea4a865463a7f0287e36fc9ce1167c0e77b667..2db27bae1e592e092825ea423332acbb36bd3536 100644 --- a/tests/src/Auth/Process/AccountingTest.php +++ b/tests/src/Auth/Process/AccountingTest.php @@ -9,10 +9,10 @@ use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use SimpleSAML\Module\accounting\Auth\Process\Accounting; -use SimpleSAML\Module\accounting\Data\Providers\Activity\Versioned\DoctrineDbal\DataProvider; +use SimpleSAML\Module\accounting\Data\Providers\Activity\DoctrineDbal\VersionedDataProvider; use SimpleSAML\Module\accounting\Data\Stores\Builders\JobsStoreBuilder; use SimpleSAML\Module\accounting\Data\Stores\Jobs\DoctrineDbal\Store; -use SimpleSAML\Module\accounting\Data\Trackers\Activity\Versioned\DoctrineDbal\DataTracker; +use SimpleSAML\Module\accounting\Data\Trackers\Activity\DoctrineDbal\VersionedDataTracker; use SimpleSAML\Module\accounting\Entities\Authentication\Event; use SimpleSAML\Module\accounting\Exceptions\InvalidConfigurationException; use SimpleSAML\Module\accounting\ModuleConfiguration; @@ -61,7 +61,7 @@ class AccountingTest extends TestCase $this->jobsStoreBuilderMock = $this->createMock(JobsStoreBuilder::class); $this->jobsStoreMock = $this->createMock(Store::class); - $this->trackerMock = $this->createMock(DataTracker::class); + $this->trackerMock = $this->createMock(VersionedDataTracker::class); $this->sampleState = StateArrays::SAML2_FULL; @@ -134,7 +134,7 @@ class AccountingTest extends TestCase ->willReturn(ModuleConfiguration\AccountingProcessingType::VALUE_SYNCHRONOUS); $this->moduleConfigurationStub->method('getProviderClasses') - ->willReturn([DataProvider::class]); + ->willReturn([VersionedDataProvider::class]); $this->moduleConfigurationStub->method('getAdditionalTrackers')->willReturn([]); $this->jobsStoreBuilderMock->expects($this->never()) diff --git a/tests/src/Constants/RawRowResult.php b/tests/src/Constants/RawRowResult.php index 45ecab9cddd405fb3cc3f6b106d530ca6f225daa..faa0e7ee6d652fd07c8fe8d7038f65a0c7f5b93b 100644 --- a/tests/src/Constants/RawRowResult.php +++ b/tests/src/Constants/RawRowResult.php @@ -5,7 +5,7 @@ declare(strict_types=1); namespace SimpleSAML\Test\Module\accounting\Constants; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\TableConstants as ActivityTableConstants; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\TableConstants as ActivityTableConstants; use SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants as ConnectedServicesTableConstants; class RawRowResult diff --git a/tests/src/Data/Providers/Builders/DataProviderBuilderTest.php b/tests/src/Data/Providers/Builders/DataProviderBuilderTest.php index 1de01d6b06bbe1dcc6044501b066f51fa88fe992..7b2b5ac7a031a3b6cad82420c15a3b94a3d607d7 100644 --- a/tests/src/Data/Providers/Builders/DataProviderBuilderTest.php +++ b/tests/src/Data/Providers/Builders/DataProviderBuilderTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use SimpleSAML\Module\accounting\Data\Providers\Builders\DataProviderBuilder; -use SimpleSAML\Module\accounting\Data\Trackers\Activity\Versioned\DoctrineDbal\DataTracker; +use SimpleSAML\Module\accounting\Data\Trackers\Activity\DoctrineDbal\VersionedDataTracker; use SimpleSAML\Module\accounting\Exceptions\Exception; use SimpleSAML\Module\accounting\ModuleConfiguration; use SimpleSAML\Module\accounting\Services\HelpersManager; @@ -21,17 +21,17 @@ use SimpleSAML\Test\Module\accounting\Constants\ConnectionParameters; * @uses \SimpleSAML\Module\accounting\Data\Stores\Bases\DoctrineDbal\AbstractStore * @uses \SimpleSAML\Module\accounting\Data\Stores\Builders\DataStoreBuilder * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Migrator - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Repository + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Repository * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Factory - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store - * @uses \SimpleSAML\Module\accounting\Data\Trackers\Activity\Versioned\DoctrineDbal\DataTracker + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store + * @uses \SimpleSAML\Module\accounting\Data\Trackers\Activity\DoctrineDbal\VersionedDataTracker * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\Bases\AbstractMigrator * @uses \SimpleSAML\Module\accounting\Services\HelpersManager * @uses \SimpleSAML\Module\accounting\Data\Stores\Bases\AbstractStore - * @uses \SimpleSAML\Module\accounting\Data\Providers\Activity\Versioned\DoctrineDbal\DataProvider - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Repository + * @uses \SimpleSAML\Module\accounting\Data\Providers\Activity\DoctrineDbal\VersionedDataProvider + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Repository */ class DataProviderBuilderTest extends TestCase { @@ -74,7 +74,7 @@ class DataProviderBuilderTest extends TestCase $this->helpersManager ); - $this->assertInstanceOf(DataTracker::class, $builder->build(DataTracker::class)); + $this->assertInstanceOf(VersionedDataTracker::class, $builder->build(VersionedDataTracker::class)); } public function testThrowsForInvalidClass(): void diff --git a/tests/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000700CreateAuthenticationEventTableTest.php b/tests/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000700CreateAuthenticationEventTableTest.php similarity index 96% rename from tests/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000700CreateAuthenticationEventTableTest.php rename to tests/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000700CreateAuthenticationEventTableTest.php index 98a0382e1804cfdafe551bfe1642919a17a46547..c1a790da8f33eec01139a93657b63b220fd83916 100644 --- a/tests/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/Migrations/Version20220801000700CreateAuthenticationEventTableTest.php +++ b/tests/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/Migrations/Version20220801000700CreateAuthenticationEventTableTest.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations; use Doctrine\DBAL\Exception; use Doctrine\DBAL\Schema\AbstractSchemaManager; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection; use SimpleSAML\Module\accounting\Exceptions\StoreException; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use SimpleSAML\Test\Module\accounting\Constants\ConnectionParameters; /** - * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations\Version20220801000700CreateAuthenticationEventTable + * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations\Version20220801000700CreateAuthenticationEventTable * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection */ diff --git a/tests/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/RawActivityTest.php b/tests/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/RawActivityTest.php similarity index 95% rename from tests/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/RawActivityTest.php rename to tests/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/RawActivityTest.php index 958f839531c477eb6ebc9158987e41d75dda5bcb..73f332287d4c4a83a5b22bb8fb6f7394a86a4896 100644 --- a/tests/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/RawActivityTest.php +++ b/tests/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/RawActivityTest.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store; +namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store; use DateTimeImmutable; use Doctrine\DBAL\Platforms\AbstractPlatform; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\RawActivity; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\TableConstants; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\RawActivity; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\TableConstants; use SimpleSAML\Module\accounting\Entities\Authentication\Protocol\Saml2; use SimpleSAML\Module\accounting\Exceptions\UnexpectedValueException; use SimpleSAML\Test\Module\accounting\Constants\DateTime; /** - * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\RawActivity + * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\RawActivity * @uses \SimpleSAML\Module\accounting\Data\Stores\Bases\DoctrineDbal\AbstractRawEntity */ class RawActivityTest extends TestCase @@ -62,7 +62,10 @@ class RawActivityTest extends TestCase { $rawActivity = new RawActivity($this->rawRow, $this->abstractPlatformStub); - $this->assertInstanceOf(RawActivity::class, $rawActivity); + $this->assertInstanceOf( + RawActivity::class, + $rawActivity + ); } public function testCanGetProperties(): void diff --git a/tests/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/RepositoryTest.php b/tests/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/RepositoryTest.php similarity index 91% rename from tests/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/RepositoryTest.php rename to tests/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/RepositoryTest.php index b61016734915b5722518a147a2fe300721e6363c..fbf3b363d4e880503412afeaf56cccfb89aac73a 100644 --- a/tests/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/Store/RepositoryTest.php +++ b/tests/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/Store/RepositoryTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store; +namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store; use DateInterval; use DateTimeImmutable; @@ -10,13 +10,13 @@ use Exception; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Repository; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\TableConstants + as BaseTableConstants; use SimpleSAML\Module\accounting\Data\Stores\Connections\Bases\AbstractMigrator; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Migrator; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Repository; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\TableConstants - as BaseTableConstants; use SimpleSAML\Module\accounting\Entities\Authentication\Protocol\Saml2; use SimpleSAML\Module\accounting\Exceptions\StoreException; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; @@ -25,29 +25,29 @@ use SimpleSAML\Test\Module\accounting\Constants\ConnectionParameters; use SimpleSAML\Test\Module\accounting\Constants\DateTime; /** - * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Repository + * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Repository * @uses \SimpleSAML\Module\accounting\Helpers\Filesystem * @uses \SimpleSAML\Module\accounting\ModuleConfiguration * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\Bases\AbstractMigrator * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Migrator - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations\Version20220801000000CreateIdpTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations\Version20220801000100CreateIdpVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations\Version20220801000200CreateSpTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations\Version20220801000300CreateSpVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations\Version20220801000400CreateUserTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations\Version20220801000500CreateUserVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations\Version20220801000600CreateIdpSpUserVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations\Version20220801000700CreateAuthenticationEventTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateSpTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateSpVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateUserTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateUserVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpSpUserVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Repository + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations\Version20220801000000CreateIdpTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations\Version20220801000100CreateIdpVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations\Version20220801000200CreateSpTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations\Version20220801000300CreateSpVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations\Version20220801000400CreateUserTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations\Version20220801000500CreateUserVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations\Version20220801000600CreateIdpSpUserVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations\Version20220801000700CreateAuthenticationEventTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateSpTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateSpVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateUserTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateUserVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpSpUserVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Repository * @uses \SimpleSAML\Module\accounting\Services\HelpersManager */ class RepositoryTest extends TestCase @@ -70,7 +70,7 @@ class RepositoryTest extends TestCase protected string $userIdentifierHash; protected string $userAttributes; protected string $userAttributesHash; - protected Store\Repository $repository; + protected Repository $repository; protected DateTimeImmutable $createdAt; /** * @var Stub @@ -101,8 +101,8 @@ class RepositoryTest extends TestCase 'Stores' . DIRECTORY_SEPARATOR . 'Accounting' . DIRECTORY_SEPARATOR . 'Activity' . DIRECTORY_SEPARATOR . - 'Versioned' . DIRECTORY_SEPARATOR . 'DoctrineDbal' . DIRECTORY_SEPARATOR . + 'Versioned' . DIRECTORY_SEPARATOR . 'Store' . DIRECTORY_SEPARATOR . AbstractMigrator::DEFAULT_MIGRATIONS_DIRECTORY_NAME; $namespace = Store::class . '\\' . AbstractMigrator::DEFAULT_MIGRATIONS_DIRECTORY_NAME; @@ -148,7 +148,7 @@ class RepositoryTest extends TestCase public function testInsertAuthenticationEventThrowsOnInvalidDbal(): void { $this->connectionStub->method('dbal')->willThrowException(new Exception('test')); - $repository = new Store\Repository($this->connectionStub, $this->loggerStub); + $repository = new Repository($this->connectionStub, $this->loggerStub); $this->expectException(StoreException::class); $repository->insertAuthenticationEvent(1, $this->createdAt); diff --git a/tests/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/StoreTest.php b/tests/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/StoreTest.php similarity index 92% rename from tests/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/StoreTest.php rename to tests/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/StoreTest.php index 766b898b7aba6e70f5d1a54b1a7efb2ad23fd04b..d86650ef30a2ef7892dbd7f1d904350f8a359e0e 100644 --- a/tests/src/Data/Stores/Accounting/Activity/Versioned/DoctrineDbal/StoreTest.php +++ b/tests/src/Data/Stores/Accounting/Activity/DoctrineDbal/Versioned/StoreTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal; +namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned; use DateTimeImmutable; use Doctrine\DBAL\Result; @@ -11,11 +11,11 @@ use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\TableConstants; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\HashDecoratedState; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\TableConstants +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\TableConstants; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\TableConstants as BaseTableConstants; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\HashDecoratedState; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Factory; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Migrator; @@ -30,35 +30,35 @@ use SimpleSAML\Test\Module\accounting\Constants\RawRowResult; use SimpleSAML\Test\Module\accounting\Constants\StateArrays; /** - * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store + * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store * @uses \SimpleSAML\Module\accounting\Data\Stores\Bases\DoctrineDbal\AbstractStore * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Migrator * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Factory - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Repository + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Repository * @uses \SimpleSAML\Module\accounting\Entities\Authentication\Event * @uses \SimpleSAML\Module\accounting\Entities\Bases\AbstractState * @uses \SimpleSAML\Module\accounting\Entities\Authentication\Event\State\Saml2 * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\Bases\AbstractMigrator * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations\Version20220801000000CreateIdpTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations\Version20220801000100CreateIdpVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations\Version20220801000200CreateSpTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations\Version20220801000300CreateSpVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations\Version20220801000400CreateUserTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations\Version20220801000500CreateUserVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations\Version20220801000600CreateIdpSpUserVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Migrations\Version20220801000700CreateAuthenticationEventTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations\Version20220801000000CreateIdpTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations\Version20220801000100CreateIdpVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations\Version20220801000200CreateSpTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations\Version20220801000300CreateSpVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations\Version20220801000400CreateUserTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations\Version20220801000500CreateUserVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations\Version20220801000600CreateIdpSpUserVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Migrations\Version20220801000700CreateAuthenticationEventTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\HashDecoratedState - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Repository - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateSpTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateSpVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateUserTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateUserVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpSpUserVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Repository + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateSpTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateSpVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateUserTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateUserVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpSpUserVersionTable * @uses \SimpleSAML\Module\accounting\Data\Stores\Bases\AbstractStore * @uses \SimpleSAML\Module\accounting\Helpers\Filesystem * @uses \SimpleSAML\Module\accounting\Helpers\Hash @@ -71,7 +71,7 @@ use SimpleSAML\Test\Module\accounting\Constants\StateArrays; * @uses \SimpleSAML\Module\accounting\Data\Stores\Bases\DoctrineDbal\AbstractRawEntity * @uses \SimpleSAML\Module\accounting\Entities\Activity\Bag * @uses \SimpleSAML\Module\accounting\Entities\Activity - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\RawActivity + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\RawActivity * @uses \SimpleSAML\Module\accounting\Services\HelpersManager * @uses \SimpleSAML\Module\accounting\Data\Stores\Bases\AbstractStore * @uses \SimpleSAML\Module\accounting\Entities\Providers\Service\Saml2 diff --git a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateIdpSpUserVersionTableTest.php b/tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateIdpSpUserVersionTableTest.php similarity index 94% rename from tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateIdpSpUserVersionTableTest.php rename to tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateIdpSpUserVersionTableTest.php index 2f13d4fd8b84496a10773c85e030f918c4fcf474..cba763ee83600ed71f2ea590c97f92b932f71903 100644 --- a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateIdpSpUserVersionTableTest.php +++ b/tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateIdpSpUserVersionTableTest.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; use Doctrine\DBAL\Exception; use Doctrine\DBAL\Schema\AbstractSchemaManager; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection; use SimpleSAML\Module\accounting\Exceptions\StoreException; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use SimpleSAML\Test\Module\accounting\Constants\ConnectionParameters; /** - * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpSpUserVersionTable + * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpSpUserVersionTable * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection */ diff --git a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateIdpTableTest.php b/tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateIdpTableTest.php similarity index 94% rename from tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateIdpTableTest.php rename to tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateIdpTableTest.php index e57524d615f5c0f2bbf97f3621ac8561c0f27281..41792f86f6861354ed66e07c1ac2a551dc0b77f3 100644 --- a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateIdpTableTest.php +++ b/tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateIdpTableTest.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; use Doctrine\DBAL\Exception; use Doctrine\DBAL\Schema\AbstractSchemaManager; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpTable; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpTable; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection; use SimpleSAML\Module\accounting\Exceptions\StoreException; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use SimpleSAML\Test\Module\accounting\Constants\ConnectionParameters; /** - * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpTable + * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpTable * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection */ diff --git a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateIdpVersionTableTest.php b/tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateIdpVersionTableTest.php similarity index 94% rename from tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateIdpVersionTableTest.php rename to tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateIdpVersionTableTest.php index 6d9599ab36eb35863be13933b192c7710433de2c..cc8c07955ca5c3cf20baf32023b0d63a33e729ef 100644 --- a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateIdpVersionTableTest.php +++ b/tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateIdpVersionTableTest.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; use Doctrine\DBAL\Exception; use Doctrine\DBAL\Schema\AbstractSchemaManager; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection; use SimpleSAML\Module\accounting\Exceptions\StoreException; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use SimpleSAML\Test\Module\accounting\Constants\ConnectionParameters; /** - * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpVersionTable + * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpVersionTable * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection * */ diff --git a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateSpTableTest.php b/tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateSpTableTest.php similarity index 94% rename from tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateSpTableTest.php rename to tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateSpTableTest.php index 6b9c0e0ac4949804e3065f6615442e36b6fae7c1..a388427bcce0c087d1475f9f9e7edf861c9565a5 100644 --- a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateSpTableTest.php +++ b/tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateSpTableTest.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; use Doctrine\DBAL\Exception; use Doctrine\DBAL\Schema\AbstractSchemaManager; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateSpTable; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateSpTable; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection; use SimpleSAML\Module\accounting\Exceptions\StoreException; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use SimpleSAML\Test\Module\accounting\Constants\ConnectionParameters; /** - * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateSpTable + * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateSpTable * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection */ diff --git a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateSpVersionTableTest.php b/tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateSpVersionTableTest.php similarity index 94% rename from tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateSpVersionTableTest.php rename to tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateSpVersionTableTest.php index fe2d6a83fe0c12a67c3831be79aeedb057a6f6f1..44e4151b76452401805973642318f4247631f528 100644 --- a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateSpVersionTableTest.php +++ b/tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateSpVersionTableTest.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; use Doctrine\DBAL\Exception; use Doctrine\DBAL\Schema\AbstractSchemaManager; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection; use SimpleSAML\Module\accounting\Exceptions\StoreException; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use SimpleSAML\Test\Module\accounting\Constants\ConnectionParameters; /** - * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateSpVersionTable + * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateSpVersionTable * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection */ diff --git a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateUserTableTest.php b/tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateUserTableTest.php similarity index 94% rename from tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateUserTableTest.php rename to tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateUserTableTest.php index 732eb0e1eb3397b019fd83e7ab976d9cbd2bde85..786ff8bf0450b059855cd3929d23bbc755e734ae 100644 --- a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateUserTableTest.php +++ b/tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateUserTableTest.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; use Doctrine\DBAL\Exception; use Doctrine\DBAL\Schema\AbstractSchemaManager; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateUserTable; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateUserTable; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection; use SimpleSAML\Module\accounting\Exceptions\StoreException; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; @@ -16,7 +16,7 @@ use SimpleSAML\Test\Module\accounting\Constants\ConnectionParameters; /** * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Migrations\Version20220801000400CreateUserTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateUserTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateUserTable * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection */ diff --git a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateUserVersionTableTest.php b/tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateUserVersionTableTest.php similarity index 94% rename from tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateUserVersionTableTest.php rename to tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateUserVersionTableTest.php index 210b780a77689900289eed4a4ac9f9330b7668a1..a1515049e9d08b38455305ffae22c037609f9b56 100644 --- a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/Migrations/CreateUserVersionTableTest.php +++ b/tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/Migrations/CreateUserVersionTableTest.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; use Doctrine\DBAL\Exception; use Doctrine\DBAL\Schema\AbstractSchemaManager; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection; use SimpleSAML\Module\accounting\Exceptions\StoreException; use SimpleSAML\Module\accounting\Exceptions\StoreException\MigrationException; use SimpleSAML\Test\Module\accounting\Constants\ConnectionParameters; /** - * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateUserVersionTable + * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateUserVersionTable * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection */ diff --git a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/RepositoryTest.php b/tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/RepositoryTest.php similarity index 94% rename from tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/RepositoryTest.php rename to tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/RepositoryTest.php index c515e9ca1e0819084e8e4becf69a48f24149d602..2007a264ba492429d3c84296034793adfe1f0adb 100644 --- a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/RepositoryTest.php +++ b/tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/Store/RepositoryTest.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store; +namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store; use DateTimeImmutable; use Exception; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\TableConstants +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Repository; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\TableConstants as BaseTableConstants; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Repository; use SimpleSAML\Module\accounting\Data\Stores\Connections\Bases\AbstractMigrator; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Migrator; @@ -24,20 +24,20 @@ use SimpleSAML\Test\Module\accounting\Constants\ConnectionParameters; use SimpleSAML\Test\Module\accounting\Constants\DateTime; /** - * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Repository + * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Repository * @uses \SimpleSAML\Module\accounting\Helpers\Filesystem * @uses \SimpleSAML\Module\accounting\ModuleConfiguration * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\Bases\AbstractMigrator * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Migrator - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateSpTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateSpVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateUserTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateUserVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpSpUserVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateSpTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateSpVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateUserTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateUserVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpSpUserVersionTable * @uses \SimpleSAML\Module\accounting\Services\HelpersManager */ class RepositoryTest extends TestCase @@ -91,8 +91,8 @@ class RepositoryTest extends TestCase 'Stores' . DIRECTORY_SEPARATOR . 'Accounting' . DIRECTORY_SEPARATOR . 'Bases' . DIRECTORY_SEPARATOR . - 'Versioned' . DIRECTORY_SEPARATOR . 'DoctrineDbal' . DIRECTORY_SEPARATOR . + 'Versioned' . DIRECTORY_SEPARATOR . 'Store' . DIRECTORY_SEPARATOR . AbstractMigrator::DEFAULT_MIGRATIONS_DIRECTORY_NAME; $namespace = Store::class . '\\' . AbstractMigrator::DEFAULT_MIGRATIONS_DIRECTORY_NAME; diff --git a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/StoreTest.php b/tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/StoreTest.php similarity index 95% rename from tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/StoreTest.php rename to tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/StoreTest.php index 15c686110ff8c125fd101d35661025b5ab916df5..10c9068482d3bea1fb5755285ead9c118cba32fa 100644 --- a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/StoreTest.php +++ b/tests/src/Data/Stores/Accounting/Bases/DoctrineDbal/Versioned/StoreTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal; +namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned; use Doctrine\DBAL\Result; use Exception; @@ -10,9 +10,9 @@ use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\TableConstants; use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\HashDecoratedState; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\TableConstants; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Factory; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Migrator; @@ -27,27 +27,26 @@ use SimpleSAML\Test\Module\accounting\Constants\ConnectionParameters; use SimpleSAML\Test\Module\accounting\Constants\StateArrays; /** - * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store + * @covers \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store * @uses \SimpleSAML\Module\accounting\Data\Stores\Bases\DoctrineDbal\AbstractStore * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Migrator * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Factory - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Repository + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Repository * @uses \SimpleSAML\Module\accounting\Entities\Authentication\Event * @uses \SimpleSAML\Module\accounting\Entities\Bases\AbstractState * @uses \SimpleSAML\Module\accounting\Entities\Authentication\Event\State\Saml2 * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\Bases\AbstractMigrator * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Bases\AbstractMigration - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateSpTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateSpVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateUserTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateUserVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpSpUserVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateSpTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateSpVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateUserTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateUserVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpSpUserVersionTable * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\HashDecoratedState - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Repository + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Repository * @uses \SimpleSAML\Module\accounting\Data\Stores\Bases\AbstractStore * @uses \SimpleSAML\Module\accounting\Helpers\Filesystem * @uses \SimpleSAML\Module\accounting\Helpers\Hash @@ -115,7 +114,7 @@ class StoreTest extends TestCase $this->hashDecoratedState = new HashDecoratedState($this->state); $this->repositoryMock = $this->createMock( - Store\Repository::class + \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Repository::class ); $this->resultStub = $this->createStub(Result::class); diff --git a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/HashDecoratedStateTest.php b/tests/src/Data/Stores/Accounting/Bases/HashDecoratedStateTest.php similarity index 98% rename from tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/HashDecoratedStateTest.php rename to tests/src/Data/Stores/Accounting/Bases/HashDecoratedStateTest.php index 0a80b9cb4e640c21cb3128e521b177956a7a2d83..0585513007738502c9c322c4ddd935449603f479 100644 --- a/tests/src/Data/Stores/Accounting/Bases/Versioned/DoctrineDbal/Store/HashDecoratedStateTest.php +++ b/tests/src/Data/Stores/Accounting/Bases/HashDecoratedStateTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store; +namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\Bases; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; diff --git a/tests/src/Data/Stores/Accounting/ConnectedServices/Versioned/DoctrineDbal/Store/RawConnectedServiceTest.php b/tests/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/RawConnectedServiceTest.php similarity index 51% rename from tests/src/Data/Stores/Accounting/ConnectedServices/Versioned/DoctrineDbal/Store/RawConnectedServiceTest.php rename to tests/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/RawConnectedServiceTest.php index a8db934314b141ad843098eb98c40094e85a3db4..a9dc48e2fd26ebd50f97919fb8ac6dfb62376984 100644 --- a/tests/src/Data/Stores/Accounting/ConnectedServices/Versioned/DoctrineDbal/Store/RawConnectedServiceTest.php +++ b/tests/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/RawConnectedServiceTest.php @@ -2,12 +2,14 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\ConnectedServices\Versioned\DoctrineDbal\Store; +namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal; use DateTimeImmutable; use Doctrine\DBAL\Platforms\AbstractPlatform; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\RawConnectedService; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants; use SimpleSAML\Module\accounting\Exceptions\UnexpectedValueException; use SimpleSAML\Test\Module\accounting\Constants\DateTime; @@ -43,15 +45,15 @@ class RawConnectedServiceTest extends TestCase $this->serviceProviderMetadata = ['sp' => 'metadata']; $this->userAttributes = ['user' => 'attribute']; $this->rawRow = [ - \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_NUMBER_OF_AUTHENTICATIONS => + TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_NUMBER_OF_AUTHENTICATIONS => $this->numberOfAuthentications, - \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_LAST_AUTHENTICATION_AT => + TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_LAST_AUTHENTICATION_AT => $this->lastAuthenticationAt, - \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_FIRST_AUTHENTICATION_AT => + TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_FIRST_AUTHENTICATION_AT => $this->firstAuthenticationAt, - \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_SP_METADATA => + TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_SP_METADATA => serialize($this->serviceProviderMetadata), - \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_USER_ATTRIBUTES => + TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_USER_ATTRIBUTES => serialize($this->userAttributes), ]; $this->dateTimeFormat = DateTime::DEFAULT_FORMAT; @@ -63,14 +65,14 @@ class RawConnectedServiceTest extends TestCase public function testCanCreateInstance(): void { $this->assertInstanceOf( - \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\RawConnectedService::class, - new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\RawConnectedService($this->rawRow, $this->abstractPlatformStub) + RawConnectedService::class, + new RawConnectedService($this->rawRow, $this->abstractPlatformStub) ); } public function testCanGetProperties(): void { - $rawConnectedServiceProvider = new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\RawConnectedService( + $rawConnectedServiceProvider = new RawConnectedService( $this->rawRow, $this->abstractPlatformStub ); @@ -93,80 +95,80 @@ class RawConnectedServiceTest extends TestCase public function testThrowsIfColumnNotSet(): void { $rawRow = $this->rawRow; - unset($rawRow[\SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_USER_ATTRIBUTES]); + unset($rawRow[TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_USER_ATTRIBUTES]); $this->expectException(UnexpectedValueException::class); - new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\RawConnectedService($rawRow, $this->abstractPlatformStub); + new RawConnectedService($rawRow, $this->abstractPlatformStub); } public function testThrowsIfNumberOfAuthenticationsNotNumeric(): void { $rawRow = $this->rawRow; - $rawRow[\SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_NUMBER_OF_AUTHENTICATIONS] = 'a'; + $rawRow[TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_NUMBER_OF_AUTHENTICATIONS] = 'a'; $this->expectException(UnexpectedValueException::class); - new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\RawConnectedService($rawRow, $this->abstractPlatformStub); + new RawConnectedService($rawRow, $this->abstractPlatformStub); } public function testThrowsIfLastAuthenticationAtNotString(): void { $rawRow = $this->rawRow; - $rawRow[\SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_LAST_AUTHENTICATION_AT] = 1; + $rawRow[TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_LAST_AUTHENTICATION_AT] = 1; $this->expectException(UnexpectedValueException::class); - new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\RawConnectedService($rawRow, $this->abstractPlatformStub); + new RawConnectedService($rawRow, $this->abstractPlatformStub); } public function testThrowsIfFirstAuthenticationAtNotString(): void { $rawRow = $this->rawRow; - $rawRow[\SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_FIRST_AUTHENTICATION_AT] = 1; + $rawRow[TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_FIRST_AUTHENTICATION_AT] = 1; $this->expectException(UnexpectedValueException::class); - new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\RawConnectedService($rawRow, $this->abstractPlatformStub); + new RawConnectedService($rawRow, $this->abstractPlatformStub); } public function testThrowsIfSpMetadataNotString(): void { $rawRow = $this->rawRow; - $rawRow[\SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_SP_METADATA] = 1; + $rawRow[TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_SP_METADATA] = 1; $this->expectException(UnexpectedValueException::class); - new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\RawConnectedService($rawRow, $this->abstractPlatformStub); + new RawConnectedService($rawRow, $this->abstractPlatformStub); } public function testThrowsIfUserAttributesNotString(): void { $rawRow = $this->rawRow; - $rawRow[\SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_USER_ATTRIBUTES] = 1; + $rawRow[TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_USER_ATTRIBUTES] = 1; $this->expectException(UnexpectedValueException::class); - new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\RawConnectedService($rawRow, $this->abstractPlatformStub); + new RawConnectedService($rawRow, $this->abstractPlatformStub); } public function testThrowsIfSpMetadataNotValid(): void { $rawRow = $this->rawRow; - $rawRow[\SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_SP_METADATA] = serialize(1); + $rawRow[TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_SP_METADATA] = serialize(1); $this->expectException(UnexpectedValueException::class); - new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\RawConnectedService($rawRow, $this->abstractPlatformStub); + new RawConnectedService($rawRow, $this->abstractPlatformStub); } public function testThrowsIfUserAttributesNotValid(): void { $rawRow = $this->rawRow; - $rawRow[\SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_USER_ATTRIBUTES] = serialize(1); + $rawRow[TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_USER_ATTRIBUTES] = serialize(1); $this->expectException(UnexpectedValueException::class); - new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\RawConnectedService($rawRow, $this->abstractPlatformStub); + new RawConnectedService($rawRow, $this->abstractPlatformStub); } } diff --git a/tests/src/Data/Stores/Accounting/ConnectedServices/Versioned/DoctrineDbal/Store/RepositoryTest.php b/tests/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/RepositoryTest.php similarity index 87% rename from tests/src/Data/Stores/Accounting/ConnectedServices/Versioned/DoctrineDbal/Store/RepositoryTest.php rename to tests/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/RepositoryTest.php index 769a72768ac12e53426a4159c2307a06668614a7..aac918695cb0dd8c438fe6de50b1dba813b47445 100644 --- a/tests/src/Data/Stores/Accounting/ConnectedServices/Versioned/DoctrineDbal/Store/RepositoryTest.php +++ b/tests/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/Store/RepositoryTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\ConnectedServices\Versioned\DoctrineDbal\Store; +namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store; use DateInterval; use DateTimeImmutable; @@ -10,7 +10,8 @@ use Exception; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\TableConstants as BaseTableConstants; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\TableConstants + as BaseTableConstants; use SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store; use SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Repository; use SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants; @@ -39,14 +40,14 @@ use SimpleSAML\Test\Module\accounting\Constants\DateTime; * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Migrations\Version20220801000400CreateUserTable * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Migrations\Version20220801000500CreateUserVersionTable * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Migrations\Version20220801000700CreateConnectedServiceTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateSpTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateSpVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateUserTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateUserVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpSpUserVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Repository + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateSpTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateSpVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateUserTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateUserVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpSpUserVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Repository * @uses \SimpleSAML\Module\accounting\Services\HelpersManager */ class RepositoryTest extends TestCase @@ -69,7 +70,7 @@ class RepositoryTest extends TestCase protected string $userIdentifierHash; protected string $userAttributes; protected string $userAttributesHash; - protected Store\Repository $repository; + protected Repository $repository; protected DateTimeImmutable $createdAt; /** * @var Stub @@ -100,8 +101,8 @@ class RepositoryTest extends TestCase 'Stores' . DIRECTORY_SEPARATOR . 'Accounting' . DIRECTORY_SEPARATOR . 'ConnectedServices' . DIRECTORY_SEPARATOR . - 'Versioned' . DIRECTORY_SEPARATOR . 'DoctrineDbal' . DIRECTORY_SEPARATOR . + 'Versioned' . DIRECTORY_SEPARATOR . 'Store' . DIRECTORY_SEPARATOR . AbstractMigrator::DEFAULT_MIGRATIONS_DIRECTORY_NAME; $namespace = Store::class . '\\' . AbstractMigrator::DEFAULT_MIGRATIONS_DIRECTORY_NAME; @@ -139,8 +140,8 @@ class RepositoryTest extends TestCase public function testCanCreateInstance(): void { $this->assertInstanceOf( - \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Repository::class, - new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Repository($this->connection, $this->loggerStub) + Repository::class, + new Repository($this->connection, $this->loggerStub) ); } @@ -193,7 +194,7 @@ class RepositoryTest extends TestCase $this->assertEquals( '1', $resultArray[$this->spEntityId] - [Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_NUMBER_OF_AUTHENTICATIONS] + [TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_NUMBER_OF_AUTHENTICATIONS] ); $this->assertSame( $this->spMetadata, @@ -203,7 +204,7 @@ class RepositoryTest extends TestCase $this->assertSame( $this->userAttributes, $resultArray[$this->spEntityId] - [\SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_USER_ATTRIBUTES] + [TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_USER_ATTRIBUTES] ); $connectedServiceId = (int)$this->repository->getConnectedService($idpSpUserVersionId)->fetchOne(); @@ -218,17 +219,17 @@ class RepositoryTest extends TestCase $this->assertEquals( '2', $resultArray[$this->spEntityId] - [\SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_NUMBER_OF_AUTHENTICATIONS] + [TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_NUMBER_OF_AUTHENTICATIONS] ); $this->assertSame( $this->spMetadata, $resultArray[$this->spEntityId] - [\SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_SP_METADATA] + [TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_SP_METADATA] ); $this->assertSame( $this->userAttributes, $resultArray[$this->spEntityId] - [\SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_USER_ATTRIBUTES] + [TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_USER_ATTRIBUTES] ); // Simulate another SP @@ -262,7 +263,7 @@ class RepositoryTest extends TestCase $this->assertSame( $spMetadataNew, $resultArray[$spEntityIdNew] - [\SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_SP_METADATA] + [TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_SP_METADATA] ); $this->assertSame( $this->userAttributes, @@ -295,7 +296,7 @@ class RepositoryTest extends TestCase $this->assertSame( $spMetadataNew, $resultArray[$spEntityIdNew] - [\SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_SP_METADATA] + [TableConstants::ENTITY_CONNECTED_SERVICE_COLUMN_NAME_SP_METADATA] ); // New SP with new user attributes version.. $this->assertSame( @@ -315,7 +316,7 @@ class RepositoryTest extends TestCase public function testGetConnectedServiceProvidersThrowsOnInvalidDbal(): void { $this->connectionStub->method('dbal')->willThrowException(new Exception('test')); - $repository = new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Repository($this->connectionStub, $this->loggerStub); + $repository = new Repository($this->connectionStub, $this->loggerStub); $this->expectException(StoreException::class); $repository->getConnectedServices($this->userIdentifierHash); @@ -374,7 +375,7 @@ class RepositoryTest extends TestCase public function testDeleteAuthenticationEventsOlderThanThrowsOnInvalidDbal(): void { $this->connectionStub->method('dbal')->willThrowException(new Exception('test')); - $repository = new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Repository($this->connectionStub, $this->loggerStub); + $repository = new Repository($this->connectionStub, $this->loggerStub); $this->expectException(StoreException::class); $repository->deleteConnectedServicesOlderThan(new DateTimeImmutable()); diff --git a/tests/src/Data/Stores/Accounting/ConnectedServices/Versioned/DoctrineDbal/StoreTest.php b/tests/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/StoreTest.php similarity index 85% rename from tests/src/Data/Stores/Accounting/ConnectedServices/Versioned/DoctrineDbal/StoreTest.php rename to tests/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/StoreTest.php index 3cae4da5ac1ad13187cd300ecc6de6b59316cf88..3e810e1698ad9eee4d79d8af17f0d6fdefb1bbac 100644 --- a/tests/src/Data/Stores/Accounting/ConnectedServices/Versioned/DoctrineDbal/StoreTest.php +++ b/tests/src/Data/Stores/Accounting/ConnectedServices/DoctrineDbal/Versioned/StoreTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\ConnectedServices\Versioned\DoctrineDbal; +namespace SimpleSAML\Test\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned; use DateTimeImmutable; use Doctrine\DBAL\Result; @@ -11,6 +11,8 @@ use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\HashDecoratedState; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Repository; use SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\TableConstants; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection; use SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Factory; @@ -45,15 +47,15 @@ use SimpleSAML\Test\Module\accounting\Constants\StateArrays; * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Migrations\Version20220801000700CreateConnectedServiceTable * @uses \SimpleSAML\Module\accounting\Helpers\Filesystem * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\HashDecoratedState - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateSpTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateSpVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateUserTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateUserVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Migrations\CreateIdpSpUserVersionTable - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Repository - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateSpTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateSpVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateUserTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateUserVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Migrations\CreateIdpSpUserVersionTable + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Repository + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store * @uses \SimpleSAML\Module\accounting\Data\Stores\Bases\AbstractStore * @uses \SimpleSAML\Module\accounting\Helpers\Hash * @uses \SimpleSAML\Module\accounting\Helpers\Arr @@ -124,7 +126,7 @@ class StoreTest extends TestCase $this->hashDecoratedState = new HashDecoratedState($this->state); $this->repositoryMock = $this->createMock( - \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store\Repository::class + Repository::class ); $this->resultStub = $this->createStub(Result::class); @@ -137,8 +139,8 @@ class StoreTest extends TestCase public function testCanConstructInstance(): void { $this->assertInstanceOf( - \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store::class, - new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store( + Store::class, + new Store( $this->moduleConfigurationStub, $this->loggerMock, null, @@ -154,8 +156,8 @@ class StoreTest extends TestCase public function testCanBuildInstance(): void { $this->assertInstanceOf( - \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store::class, - \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store::build($this->moduleConfigurationStub, $this->loggerMock) + Store::class, + Store::build($this->moduleConfigurationStub, $this->loggerMock) ); } @@ -166,7 +168,7 @@ class StoreTest extends TestCase { $this->repositoryMock->method('getConnectedServices')->willReturn([]); - $store = new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store( + $store = new Store( $this->moduleConfigurationStub, $this->loggerMock, null, @@ -189,7 +191,7 @@ class StoreTest extends TestCase $this->repositoryMock->method('getConnectedServices') ->willReturn([RawRowResult::CONNECTED_SERVICE]); - $store = new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store( + $store = new Store( $this->moduleConfigurationStub, $this->loggerMock, null, @@ -215,7 +217,7 @@ class StoreTest extends TestCase $this->repositoryMock->method('getConnectedServices') ->willReturn([$rawResult]); - $store = new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store( + $store = new Store( $this->moduleConfigurationStub, $this->loggerMock, null, @@ -240,7 +242,7 @@ class StoreTest extends TestCase ->method('deleteConnectedServicesOlderThan') ->with($dateTime); - $store = new \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store( + $store = new Store( $this->moduleConfigurationStub, $this->loggerMock, null, diff --git a/tests/src/Data/Stores/Builders/DataStoreBuilderTest.php b/tests/src/Data/Stores/Builders/DataStoreBuilderTest.php index 4d886bbbd384bf0e9f94d1e33cb9a01040d1e519..91ed81cac41042fb082f5d5bfe9095156987ea0d 100644 --- a/tests/src/Data/Stores/Builders/DataStoreBuilderTest.php +++ b/tests/src/Data/Stores/Builders/DataStoreBuilderTest.php @@ -7,7 +7,7 @@ namespace SimpleSAML\Test\Module\accounting\Data\Stores\Builders; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store; use SimpleSAML\Module\accounting\Data\Stores\Builders\DataStoreBuilder; use SimpleSAML\Module\accounting\Exceptions\StoreException; use SimpleSAML\Module\accounting\ModuleConfiguration; @@ -16,20 +16,20 @@ use SimpleSAML\Test\Module\accounting\Constants\ConnectionParameters; /** * @covers \SimpleSAML\Module\accounting\Data\Stores\Builders\DataStoreBuilder - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store * @uses \SimpleSAML\Module\accounting\Helpers\InstanceBuilderUsingModuleConfiguration * @uses \SimpleSAML\Module\accounting\Data\Stores\Bases\DoctrineDbal\AbstractStore * @uses \SimpleSAML\Module\accounting\Data\Stores\Builders\Bases\AbstractStoreBuilder * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Connection * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Factory * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Migrator - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Repository + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Repository * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\Bases\AbstractMigrator * @uses \SimpleSAML\Module\accounting\Services\HelpersManager * @uses \SimpleSAML\Module\accounting\Data\Stores\Bases\AbstractStore - * @uses \SimpleSAML\Module\accounting\Data\Providers\Activity\Versioned\DoctrineDbal\DataProvider - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Repository + * @uses \SimpleSAML\Module\accounting\Data\Providers\Activity\DoctrineDbal\VersionedDataProvider + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Repository */ class DataStoreBuilderTest extends TestCase { diff --git a/tests/src/Data/Trackers/Activity/Versioned/DoctrineDbal/DataTrackerTest.php b/tests/src/Data/Trackers/Activity/DoctrineDbal/Versioned/DataTrackerTest.php similarity index 84% rename from tests/src/Data/Trackers/Activity/Versioned/DoctrineDbal/DataTrackerTest.php rename to tests/src/Data/Trackers/Activity/DoctrineDbal/Versioned/DataTrackerTest.php index efc952e5403c9fda22440cb90c7230124ec4e310..4a9caee04e1f2b4be41883299e6275cb1b08674f 100644 --- a/tests/src/Data/Trackers/Activity/Versioned/DoctrineDbal/DataTrackerTest.php +++ b/tests/src/Data/Trackers/Activity/DoctrineDbal/Versioned/DataTrackerTest.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Trackers\Activity\Versioned\DoctrineDbal; +namespace SimpleSAML\Test\Module\accounting\Data\Trackers\Activity\DoctrineDbal\Versioned; use DateInterval; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; -use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store; -use SimpleSAML\Module\accounting\Data\Trackers\Activity\Versioned\DoctrineDbal\DataTracker; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store; +use SimpleSAML\Module\accounting\Data\Trackers\Activity\DoctrineDbal\VersionedDataTracker; use SimpleSAML\Module\accounting\Entities\Activity; use SimpleSAML\Module\accounting\Entities\Authentication\Event; use SimpleSAML\Module\accounting\Exceptions\StoreException; @@ -18,7 +18,7 @@ use SimpleSAML\Module\accounting\ModuleConfiguration; use SimpleSAML\Test\Module\accounting\Constants\ConnectionParameters; /** - * @covers \SimpleSAML\Module\accounting\Data\Trackers\Activity\Versioned\DoctrineDbal\DataTracker + * @covers \SimpleSAML\Module\accounting\Data\Trackers\Activity\DoctrineDbal\VersionedDataTracker * @uses \SimpleSAML\Module\accounting\Helpers\InstanceBuilderUsingModuleConfiguration * @uses \SimpleSAML\Module\accounting\Data\Stores\Builders\Bases\AbstractStoreBuilder * @uses \SimpleSAML\Module\accounting\Data\Stores\Builders\DataStoreBuilder @@ -26,15 +26,15 @@ use SimpleSAML\Test\Module\accounting\Constants\ConnectionParameters; * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Factory * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\DoctrineDbal\Migrator * @uses \SimpleSAML\Module\accounting\Data\Stores\Bases\DoctrineDbal\AbstractStore - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\Versioned\DoctrineDbal\Store\Repository + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Activity\DoctrineDbal\Versioned\Store\Repository * @uses \SimpleSAML\Module\accounting\Helpers\Hash * @uses \SimpleSAML\Module\accounting\Services\HelpersManager * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\Bases\AbstractMigrator * @uses \SimpleSAML\Module\accounting\Data\Stores\Bases\AbstractStore - * @uses \SimpleSAML\Module\accounting\Data\Providers\Activity\Versioned\DoctrineDbal\DataProvider - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Repository + * @uses \SimpleSAML\Module\accounting\Data\Providers\Activity\DoctrineDbal\VersionedDataProvider + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Repository */ class DataTrackerTest extends TestCase { @@ -66,8 +66,8 @@ class DataTrackerTest extends TestCase public function testCanCreateInstance(): void { $this->assertInstanceOf( - DataTracker::class, - new DataTracker( + VersionedDataTracker::class, + new VersionedDataTracker( $this->moduleConfigurationStub, $this->loggerMock, ModuleConfiguration\ConnectionType::MASTER, @@ -76,13 +76,13 @@ class DataTrackerTest extends TestCase ); $this->assertInstanceOf( - DataTracker::class, - new DataTracker($this->moduleConfigurationStub, $this->loggerMock) + VersionedDataTracker::class, + new VersionedDataTracker($this->moduleConfigurationStub, $this->loggerMock) ); $this->assertInstanceOf( - DataTracker::class, - DataTracker::build($this->moduleConfigurationStub, $this->loggerMock) + VersionedDataTracker::class, + VersionedDataTracker::build($this->moduleConfigurationStub, $this->loggerMock) ); } @@ -97,7 +97,7 @@ class DataTrackerTest extends TestCase ->method('persist') ->with($authenticationEventStub); - $tracker = new DataTracker( + $tracker = new VersionedDataTracker( $this->moduleConfigurationStub, $this->loggerMock, ModuleConfiguration\ConnectionType::MASTER, @@ -119,7 +119,7 @@ class DataTrackerTest extends TestCase $this->store->expects($this->once()) ->method('runSetup'); - $tracker = new DataTracker( + $tracker = new VersionedDataTracker( $this->moduleConfigurationStub, $this->loggerMock, ModuleConfiguration\ConnectionType::MASTER, @@ -142,7 +142,7 @@ class DataTrackerTest extends TestCase $this->loggerMock->expects($this->once()) ->method('warning'); - $tracker = new DataTracker( + $tracker = new VersionedDataTracker( $this->moduleConfigurationStub, $this->loggerMock, ModuleConfiguration\ConnectionType::MASTER, @@ -162,7 +162,7 @@ class DataTrackerTest extends TestCase ->method('getActivity') ->willReturn($activityBag); - $tracker = new DataTracker( + $tracker = new VersionedDataTracker( $this->moduleConfigurationStub, $this->loggerMock, ModuleConfiguration\ConnectionType::MASTER, @@ -185,7 +185,7 @@ class DataTrackerTest extends TestCase $this->store->expects($this->once()) ->method('deleteDataOlderThan'); - $tracker = new DataTracker( + $tracker = new VersionedDataTracker( $this->moduleConfigurationStub, $this->loggerMock, ModuleConfiguration\ConnectionType::MASTER, diff --git a/tests/src/Data/Trackers/ConnectedServices/Versioned/DoctrineDbal/DataTrackerTest.php b/tests/src/Data/Trackers/ConnectedServices/DoctrineDbal/Versioned/DataTrackerTest.php similarity index 78% rename from tests/src/Data/Trackers/ConnectedServices/Versioned/DoctrineDbal/DataTrackerTest.php rename to tests/src/Data/Trackers/ConnectedServices/DoctrineDbal/Versioned/DataTrackerTest.php index a3dc78db7cff2bd19ed7e63c2ab6c482b1e353cd..29fef34efba4c9110df8eed522144d690e0423f2 100644 --- a/tests/src/Data/Trackers/ConnectedServices/Versioned/DoctrineDbal/DataTrackerTest.php +++ b/tests/src/Data/Trackers/ConnectedServices/DoctrineDbal/Versioned/DataTrackerTest.php @@ -2,14 +2,15 @@ declare(strict_types=1); -namespace SimpleSAML\Test\Module\accounting\Data\Trackers\ConnectedServices\Versioned\DoctrineDbal; +namespace SimpleSAML\Test\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\Versioned; use DateInterval; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; -use SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\Versioned\DataTracker; +use SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store; +use SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\VersionedDataTracker; use SimpleSAML\Module\accounting\Entities\Authentication\Event; use SimpleSAML\Module\accounting\Entities\ConnectedService; use SimpleSAML\Module\accounting\Exceptions\StoreException; @@ -17,7 +18,7 @@ use SimpleSAML\Module\accounting\ModuleConfiguration; use SimpleSAML\Test\Module\accounting\Constants\ConnectionParameters; /** - * @covers \SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\Versioned\DataTracker + * @covers \SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\VersionedDataTracker * @uses \SimpleSAML\Module\accounting\Helpers\InstanceBuilderUsingModuleConfiguration * @uses \SimpleSAML\Module\accounting\Data\Stores\Builders\Bases\AbstractStoreBuilder * @uses \SimpleSAML\Module\accounting\Data\Stores\Builders\DataStoreBuilder @@ -31,9 +32,9 @@ use SimpleSAML\Test\Module\accounting\Constants\ConnectionParameters; * @uses \SimpleSAML\Module\accounting\Services\HelpersManager * @uses \SimpleSAML\Module\accounting\Data\Stores\Connections\Bases\AbstractMigrator * @uses \SimpleSAML\Module\accounting\Data\Stores\Bases\AbstractStore - * @uses \SimpleSAML\Module\accounting\Data\Providers\ConnectedServices\DoctrineDbal\Versioned\DataProvider - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store - * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\Versioned\DoctrineDbal\Store\Repository + * @uses \SimpleSAML\Module\accounting\Data\Providers\ConnectedServices\DoctrineDbal\VersionedDataProvider + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store + * @uses \SimpleSAML\Module\accounting\Data\Stores\Accounting\Bases\DoctrineDbal\Versioned\Store\Repository */ class DataTrackerTest extends TestCase { @@ -57,7 +58,7 @@ class DataTrackerTest extends TestCase ->willReturn(ConnectionParameters::DBAL_SQLITE_MEMORY); $this->loggerMock = $this->createMock(LoggerInterface::class); $this->store = $this->createMock( - \SimpleSAML\Module\accounting\Data\Stores\Accounting\ConnectedServices\DoctrineDbal\Versioned\Store::class + Store::class ); } @@ -67,8 +68,8 @@ class DataTrackerTest extends TestCase public function testCanCreateInstance(): void { $this->assertInstanceOf( - \SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\Versioned\DataTracker::class, - new DataTracker( + VersionedDataTracker::class, + new VersionedDataTracker( $this->moduleConfigurationStub, $this->loggerMock, ModuleConfiguration\ConnectionType::MASTER, @@ -77,13 +78,13 @@ class DataTrackerTest extends TestCase ); $this->assertInstanceOf( - \SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\Versioned\DataTracker::class, - new \SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\Versioned\DataTracker($this->moduleConfigurationStub, $this->loggerMock) + VersionedDataTracker::class, + new VersionedDataTracker($this->moduleConfigurationStub, $this->loggerMock) ); $this->assertInstanceOf( - \SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\Versioned\DataTracker::class, - \SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\Versioned\DataTracker::build($this->moduleConfigurationStub, $this->loggerMock) + VersionedDataTracker::class, + VersionedDataTracker::build($this->moduleConfigurationStub, $this->loggerMock) ); } @@ -98,7 +99,7 @@ class DataTrackerTest extends TestCase ->method('persist') ->with($authenticationEventStub); - $tracker = new \SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\Versioned\DataTracker( + $tracker = new VersionedDataTracker( $this->moduleConfigurationStub, $this->loggerMock, ModuleConfiguration\ConnectionType::MASTER, @@ -120,7 +121,7 @@ class DataTrackerTest extends TestCase $this->store->expects($this->once()) ->method('runSetup'); - $tracker = new DataTracker( + $tracker = new VersionedDataTracker( $this->moduleConfigurationStub, $this->loggerMock, ModuleConfiguration\ConnectionType::MASTER, @@ -143,7 +144,7 @@ class DataTrackerTest extends TestCase $this->loggerMock->expects($this->once()) ->method('warning'); - $tracker = new \SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\Versioned\DataTracker( + $tracker = new VersionedDataTracker( $this->moduleConfigurationStub, $this->loggerMock, ModuleConfiguration\ConnectionType::MASTER, @@ -163,7 +164,7 @@ class DataTrackerTest extends TestCase ->method('getConnectedServices') ->willReturn($connectedOrganizationsBagStub); - $tracker = new \SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\Versioned\DataTracker( + $tracker = new VersionedDataTracker( $this->moduleConfigurationStub, $this->loggerMock, ModuleConfiguration\ConnectionType::MASTER, @@ -186,7 +187,7 @@ class DataTrackerTest extends TestCase $this->store->expects($this->once()) ->method('deleteDataOlderThan'); - $tracker = new \SimpleSAML\Module\accounting\Data\Trackers\ConnectedServices\DoctrineDbal\Versioned\DataTracker( + $tracker = new VersionedDataTracker( $this->moduleConfigurationStub, $this->loggerMock, ModuleConfiguration\ConnectionType::MASTER, diff --git a/tests/src/ModuleConfigurationTest.php b/tests/src/ModuleConfigurationTest.php index 86a0960dde36c7fbc3dd394b1073f8c3dc3ea3ee..77a9114d9cd948b7fcc6fecf29ef15e54423b57e 100644 --- a/tests/src/ModuleConfigurationTest.php +++ b/tests/src/ModuleConfigurationTest.php @@ -6,14 +6,13 @@ namespace SimpleSAML\Test\Module\accounting; use PHPUnit\Framework\TestCase; use SimpleSAML\Configuration; -use SimpleSAML\Module\accounting\Data\Providers\Activity\Versioned\DoctrineDbal\DataProvider; +use SimpleSAML\Module\accounting\Data\Providers\Activity\DoctrineDbal\VersionedDataProvider; +use SimpleSAML\Module\accounting\Data\Stores; use SimpleSAML\Module\accounting\Data\Stores\Interfaces\JobsStoreInterface; use SimpleSAML\Module\accounting\Data\Stores\Jobs\DoctrineDbal\Store; -use SimpleSAML\Module\accounting\Data\Trackers\Activity\Versioned\DoctrineDbal\DataTracker; +use SimpleSAML\Module\accounting\Data\Trackers; use SimpleSAML\Module\accounting\Exceptions\InvalidConfigurationException; use SimpleSAML\Module\accounting\ModuleConfiguration; -use SimpleSAML\Module\accounting\Data\Stores; -use SimpleSAML\Module\accounting\Data\Trackers; use stdClass; /** @@ -111,7 +110,7 @@ class ModuleConfigurationTest extends TestCase $this->assertSame( 'doctrine_dbal_pdo_sqlite_slave', $this->moduleConfiguration->getClassConnectionKey( - DataProvider::class, + VersionedDataProvider::class, ModuleConfiguration\ConnectionType::SLAVE ) ); diff --git a/tests/src/Services/JobRunnerTest.php b/tests/src/Services/JobRunnerTest.php index 7d8ebd6c4c93f663acdbbe3c521b1cea1aac374e..35b40026840382e2e8f07c85eb0015f973bb8d18 100644 --- a/tests/src/Services/JobRunnerTest.php +++ b/tests/src/Services/JobRunnerTest.php @@ -642,7 +642,7 @@ class JobRunnerTest extends TestCase $this->cacheMock->expects($this->once())->method('delete'); $this->loggerMock->expects($this->once())->method('warning') - ->with($this->stringContains('Current job runner ID differs from the ID in the cached state.')); + ->with($this->stringContains('CurrentDataProvider job runner ID differs from the ID in the cached state.')); $jobRunner = new JobRunner( $this->moduleConfigurationStub,