diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aaf12c14e..6358d9c63 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: CI on: [push, pull_request] jobs: - general_module_workflow: + general_module_workflow_php: uses: Karaka-Management/Karaka/.github/workflows/php_template.yml@develop secrets: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Account/Account.php b/Account/Account.php index a55bbf6fe..0e051d9ed 100755 --- a/Account/Account.php +++ b/Account/Account.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Account * @copyright Dennis Eichhorn diff --git a/Account/AccountManager.php b/Account/AccountManager.php index 5942c9013..580473a4f 100755 --- a/Account/AccountManager.php +++ b/Account/AccountManager.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Account * @copyright Dennis Eichhorn diff --git a/Account/AccountStatus.php b/Account/AccountStatus.php index b45791aa0..9cc5ec6b5 100755 --- a/Account/AccountStatus.php +++ b/Account/AccountStatus.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Account * @copyright Dennis Eichhorn diff --git a/Account/AccountType.php b/Account/AccountType.php index 21b240af8..94383dbd5 100755 --- a/Account/AccountType.php +++ b/Account/AccountType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Account * @copyright Dennis Eichhorn diff --git a/Account/Group.php b/Account/Group.php index 9f7405d8b..4c93edf9e 100755 --- a/Account/Group.php +++ b/Account/Group.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Account * @copyright Dennis Eichhorn diff --git a/Account/GroupStatus.php b/Account/GroupStatus.php index 96ebc9315..fe41da448 100755 --- a/Account/GroupStatus.php +++ b/Account/GroupStatus.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Account * @copyright Dennis Eichhorn diff --git a/Account/NullAccount.php b/Account/NullAccount.php index 1bf4d5630..5f8ebe47a 100755 --- a/Account/NullAccount.php +++ b/Account/NullAccount.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Account * @copyright Dennis Eichhorn diff --git a/Account/NullGroup.php b/Account/NullGroup.php index f3f2f94cc..3a7d84136 100755 --- a/Account/NullGroup.php +++ b/Account/NullGroup.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Account * @copyright Dennis Eichhorn diff --git a/Account/PermissionAbstract.php b/Account/PermissionAbstract.php index 5f677810f..5e1f52bcd 100755 --- a/Account/PermissionAbstract.php +++ b/Account/PermissionAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Account * @copyright Dennis Eichhorn diff --git a/Account/PermissionHandlingTrait.php b/Account/PermissionHandlingTrait.php index 725d92f9c..309e452bd 100755 --- a/Account/PermissionHandlingTrait.php +++ b/Account/PermissionHandlingTrait.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Account * @copyright Dennis Eichhorn diff --git a/Account/PermissionOwner.php b/Account/PermissionOwner.php index 45cef3a73..7e292809b 100755 --- a/Account/PermissionOwner.php +++ b/Account/PermissionOwner.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Account * @copyright Dennis Eichhorn diff --git a/Account/PermissionType.php b/Account/PermissionType.php index d004306e0..66264d90a 100755 --- a/Account/PermissionType.php +++ b/Account/PermissionType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Account * @copyright Dennis Eichhorn diff --git a/Ai/NeuralNetwork/Neuron.php b/Ai/NeuralNetwork/Neuron.php index bdb5aa566..ea253927d 100755 --- a/Ai/NeuralNetwork/Neuron.php +++ b/Ai/NeuralNetwork/Neuron.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Ai\NeuralNetwork * @copyright Dennis Eichhorn diff --git a/Ai/Ocr/BasicOcr.php b/Ai/Ocr/BasicOcr.php index 260298e7f..f6c0b868e 100755 --- a/Ai/Ocr/BasicOcr.php +++ b/Ai/Ocr/BasicOcr.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Ai\Ocr * @copyright Dennis Eichhorn diff --git a/Ai/Ocr/Tesseract/TesseractOcr.php b/Ai/Ocr/Tesseract/TesseractOcr.php index 03aaf34c6..51642f8fc 100755 --- a/Ai/Ocr/Tesseract/TesseractOcr.php +++ b/Ai/Ocr/Tesseract/TesseractOcr.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Ai\Ocr\Tesseract * @copyright Dennis Eichhorn diff --git a/Algorithm/Clustering/AffinityPropagation.php b/Algorithm/Clustering/AffinityPropagation.php index 489a8b6e8..9851fb837 100644 --- a/Algorithm/Clustering/AffinityPropagation.php +++ b/Algorithm/Clustering/AffinityPropagation.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Clustering * @copyright Dennis Eichhorn @@ -22,244 +22,9 @@ namespace phpOMS\Algorithm\Clustering; * @link https://jingga.app * @see ./clustering_overview.png * @since 1.0.0 + * + * @todo Implement */ -final class AffinityPropagation implements ClusteringInterface +final class AffinityPropagation { - /** - * Points of the cluster centers - * - * @var PointInterface[] - * @since 1.0.0 - */ - private array $clusterCenters = []; - - /** - * Cluster points - * - * Points in clusters (helper to avoid looping the cluster array) - * - * @var array - * @since 1.0.0 - */ - private array $clusters = []; - - private array $similarityMatrix = []; - - private array $responsibilityMatrix = []; - - private array $availabilityMatrix = []; - - /** - * Original points used for clusters - * - * @var PointInterface[] - * @since 1.0.0 - */ - private array $points = []; - - /** - * Create similarity matrix from points - * - * @param PointInterface[] $points Points to create the similarity matrix for - * - * @return array> - * - * @since 1.0.0 - */ - private function createSimilarityMatrix(array $points) : array - { - $n = \count($points); - $coordinates = \count($points[0]->coordinates); - $similarityMatrix = \array_fill(0, $n, []); - - $temp = []; - for ($i = 0; $i < $n - 1; ++$i) { - for ($j = $i + 1; $j < $n; ++$j) { - $sum = 0.0; - for ($c = 0; $c < $coordinates; ++$c) { - $sum += ($points[$i]->getCoordinate($c) - $points[$j]->getCoordinate($c)) * ($points[$i]->getCoordinate($c) - $points[$j]->getCoordinate($c)); - } - - $similarityMatrix[$i][$j] = -$sum; - $similarityMatrix[$j][$i] = -$sum; - $temp[] = $similarityMatrix[$i][$j]; - } - } - - \sort($temp); - - $size = $n * ($n - 1) / 2; - $median = $size % 2 === 0 - ? ($temp[(int) ($size / 2)] + $temp[(int) ($size / 2 - 1)]) / 2 - : $temp[(int) ($size / 2)]; - - for ($i = 0; $i < $n; ++$i) { - $similarityMatrix[$i][$i] = $median; - } - - return $similarityMatrix; - } - - /** - * Generate clusters for points - * - * @param PointInterface[] $points Points to cluster - * @param int $iterations Iterations for cluster generation - * - * @return void - * - * @since 1.0.0 - */ - public function generateClusters(array $points, int $iterations = 100) : void - { - $this->points = $points; - $n = \count($points); - - $this->similarityMatrix = $this->createSimilarityMatrix($points); - $this->responsibilityMatrix = $this->similarityMatrix; - $this->availabilityMatrix = $this->similarityMatrix; - - for ($c = 0; $c < $iterations; ++$c) { - for ($i = 0; $i < $n; ++$i) { - for ($k = 0; $k < $n; ++$k) { - $max = \PHP_INT_MIN; - for ($j = 0; $j < $k; ++$j) { - if (($temp = $this->similarityMatrix[$i][$j] + $this->availabilityMatrix[$i][$j]) > $max) { - $max = $temp; - } - } - - for ($j = $k + 1; $j < $n; ++$j) { - if (($temp = $this->similarityMatrix[$i][$j] + $this->availabilityMatrix[$i][$j]) > $max) { - $max = $temp; - } - } - - $this->responsibilityMatrix[$i][$k] = (1 - 0.9) * ($this->similarityMatrix[$i][$k] - $max) + 0.9 * $this->responsibilityMatrix[$i][$k]; - } - } - - for ($i = 0; $i < $n; ++$i) { - for ($k = 0; $k < $n; ++$k) { - $sum = 0.0; - - if ($i === $k) { - for ($j = 0; $j < $i; ++$j) { - $sum += \max(0.0, $this->responsibilityMatrix[$j][$k]); - } - - for (++$j; $j < $n; ++$j) { - $sum += \max(0.0, $this->responsibilityMatrix[$j][$k]); - } - - $this->availabilityMatrix[$i][$k] = (1 - 0.9) * $sum + 0.9 * $this->availabilityMatrix[$i][$k]; - } else { - $max = \max($i, $k); - $min = \min($i, $k); - - for ($j = 0; $j < $min; ++$j) { - $sum += \max(0.0, $this->responsibilityMatrix[$j][$k]); - } - - for ($j = $min + 1; $j < $max; ++$j) { - $sum += \max(0.0, $this->responsibilityMatrix[$j][$k]); - } - - for ($j = $max + 1; $j < $n; ++$j) { - $sum += \max(0.0, $this->responsibilityMatrix[$j][$k]); - } - - $this->availabilityMatrix[$i][$k] = (1 - 0.9) * \min(0.0, $this->responsibilityMatrix[$k][$k] + $sum) + 0.9 * $this->availabilityMatrix[$i][$k]; - } - } - } - } - - // find center points (exemplar) - for ($i = 0; $i < $n; ++$i) { - $temp = $this->responsibilityMatrix[$i][$i] + $this->availabilityMatrix[$i][$i]; - - if ($temp > 0) { - $this->clusterCenters[$i] = $this->points[$i]; - } - } - } - - /** - * Find the nearest group for a point - * - * @param array> $similarityMatrix Similarity matrix - * @param int $point Point id in the similarity matrix to compare - * - * @return int - * - * @since 1.0.0 - */ - private function findNearestGroup(array $similarityMatrix, int $point) : int - { - $maxSim = \PHP_INT_MIN; - $group = 0; - - foreach ($this->clusterCenters as $c => $_) { - if ($similarityMatrix[$point][$c] > $maxSim) { - $maxSim = $similarityMatrix[$point][$c]; - $group = $c; - } - } - - return $group; - } - - /** - * {@inheritdoc} - */ - public function cluster(PointInterface $point) : ?PointInterface - { - $points = $this->points; - $points[] = $point; - - $similarityMatrix = $this->createSimilarityMatrix($points); - - $c = $this->findNearestGroup( - $similarityMatrix, - \count($points) - 1, - ); - - return $this->clusterCenters[$c]; - } - - /** - * {@inheritdoc} - */ - public function getClusters() : array - { - if (!empty($this->clusters)) { - return $this->clusters; - } - - $n = \count($this->points); - for ($i = 0; $i < $n; ++$i) { - $group = $this->findNearestGroup($this->points, $i); - - $this->clusters[$group] = $this->points[$i]; - } - - return $this->clusters; - } - - /** - * {@inheritdoc} - */ - public function getCentroids() : array - { - return $this->clusterCenters; - } - - /** - * {@inheritdoc} - */ - public function getNoise() : array - { - return []; - } } diff --git a/Algorithm/Clustering/AgglomerativeClustering.php b/Algorithm/Clustering/AgglomerativeClustering.php index f5176fecf..b65901773 100644 --- a/Algorithm/Clustering/AgglomerativeClustering.php +++ b/Algorithm/Clustering/AgglomerativeClustering.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Clustering * @copyright Dennis Eichhorn @@ -42,7 +42,7 @@ final class AgglomerativeClustering implements ClusteringInterface * @var \Closure * @since 1.0.0 */ - private \Closure $metric; + public \Closure $metric; /** * Metric to calculate the distance between two points @@ -50,7 +50,7 @@ final class AgglomerativeClustering implements ClusteringInterface * @var \Closure * @since 1.0.0 */ - private \Closure $linkage; + public \Closure $linkage; /** * Constructor @@ -61,7 +61,7 @@ final class AgglomerativeClustering implements ClusteringInterface */ public function __construct(?\Closure $metric = null, ?\Closure $linkage = null) { - $this->metric = $metric ?? function (PointInterface $a, PointInterface $b) { + $this->metric = $metric ?? function (Point $a, Point $b) { $aCoordinates = $a->coordinates; $bCoordinates = $b->coordinates; @@ -139,7 +139,7 @@ final class AgglomerativeClustering implements ClusteringInterface /** * {@inheritdoc} */ - public function cluster(PointInterface $point) : ?PointInterface + public function cluster(Point $point) : ?Point { return null; } diff --git a/Algorithm/Clustering/Birch.php b/Algorithm/Clustering/Birch.php index 760c7d0a1..f5d5d6d50 100644 --- a/Algorithm/Clustering/Birch.php +++ b/Algorithm/Clustering/Birch.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Clustering * @copyright Dennis Eichhorn @@ -46,7 +46,7 @@ final class Birch implements ClusteringInterface /** * {@inheritdoc} */ - public function cluster(PointInterface $point) : ?PointInterface + public function cluster(Point $point) : ?Point { return null; } diff --git a/Algorithm/Clustering/ClusteringInterface.php b/Algorithm/Clustering/ClusteringInterface.php index 8da25fb94..3e882d847 100644 --- a/Algorithm/Clustering/ClusteringInterface.php +++ b/Algorithm/Clustering/ClusteringInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Clustering * @copyright Dennis Eichhorn @@ -27,7 +27,7 @@ interface ClusteringInterface /** * Get cluster centroids * - * @return PointInterface[] + * @return Point[] * * @since 1.0.0 */ @@ -36,7 +36,7 @@ interface ClusteringInterface /** * Get cluster assignments of the training data * - * @return PointInterface[] + * @return Point[] * * @since 1.0.0 */ @@ -47,20 +47,20 @@ interface ClusteringInterface * * This point doesn't have to be in the training data. * - * @param PointInterface $point Point to cluster + * @param Point $point Point to cluster * - * @return null|PointInterface + * @return null|Point * * @since 1.0.0 */ - public function cluster(PointInterface $point) : ?PointInterface; + public function cluster(Point $point) : ?Point; /** * Get noise data. * * Data points from the training data that are not part of a cluster. * - * @return PointInterface[] + * @return Point[] * * @since 1.0.0 */ diff --git a/Algorithm/Clustering/DBSCAN.php b/Algorithm/Clustering/DBSCAN.php index ea38eb5f7..921db2fd9 100644 --- a/Algorithm/Clustering/DBSCAN.php +++ b/Algorithm/Clustering/DBSCAN.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Clustering * @copyright Dennis Eichhorn @@ -50,7 +50,7 @@ final class DBSCAN implements ClusteringInterface /** * Points outside of any cluster * - * @var PointInterface[] + * @var Point[] * @since 1.0.0 */ private array $noisePoints = []; @@ -58,7 +58,7 @@ final class DBSCAN implements ClusteringInterface /** * All points * - * @var PointInterface[] + * @var Point[] * @since 1.0.0 */ private array $points = []; @@ -66,7 +66,7 @@ final class DBSCAN implements ClusteringInterface /** * Points of the cluster centers * - * @var PointInterface[] + * @var Point[] * @since 1.0.0 */ private array $clusterCenters = []; @@ -76,7 +76,7 @@ final class DBSCAN implements ClusteringInterface * * Array of points assigned to a cluster * - * @var array + * @var array * @since 1.0.0 */ private array $clusters = []; @@ -118,7 +118,7 @@ final class DBSCAN implements ClusteringInterface */ public function __construct(?\Closure $metric = null) { - $this->metric = $metric ?? function (PointInterface $a, PointInterface $b) { + $this->metric = $metric ?? function (Point $a, Point $b) { $aCoordinates = $a->coordinates; $bCoordinates = $b->coordinates; @@ -129,18 +129,18 @@ final class DBSCAN implements ClusteringInterface /** * Expand cluster with additional point and potential neighbors. * - * @param PointInterface $point Point to add to a cluster - * @param array $neighbors Neighbors of point - * @param int $c Cluster id - * @param float $epsilon Max distance - * @param int $minPoints Min amount of points required for a cluster + * @param Point $point Point to add to a cluster + * @param array $neighbors Neighbors of point + * @param int $c Cluster id + * @param float $epsilon Max distance + * @param int $minPoints Min amount of points required for a cluster * * @return void * * @since 1.0.0 */ private function expandCluster( - PointInterface $point, + Point $point, array $neighbors, int $c, float $epsilon, @@ -174,14 +174,14 @@ final class DBSCAN implements ClusteringInterface /** * Find neighbors of a point * - * @param PointInterface $point Base point for potential neighbors - * @param float $epsilon Max distance to neighbor + * @param Point $point Base point for potential neighbors + * @param float $epsilon Max distance to neighbor * * @return array * * @since 1.0.0 */ - private function findNeighbors(PointInterface $point, float $epsilon) : array + private function findNeighbors(Point $point, float $epsilon) : array { $neighbors = []; foreach ($this->points as $point2) { @@ -225,7 +225,7 @@ final class DBSCAN implements ClusteringInterface /** * {@inheritdoc} */ - public function cluster(PointInterface $point) : ?PointInterface + public function cluster(Point $point) : ?Point { if ($this->convexHulls === []) { foreach ($this->clusters as $c => $cluster) { @@ -251,9 +251,9 @@ final class DBSCAN implements ClusteringInterface /** * Generate the clusters of the points * - * @param PointInterface[] $points Points to cluster - * @param float $epsilon Max distance - * @param int $minPoints Min amount of points required for a cluster + * @param Point[] $points Points to cluster + * @param float $epsilon Max distance + * @param int $minPoints Min amount of points required for a cluster * * @return void * diff --git a/Algorithm/Clustering/DivisiveClustering.php b/Algorithm/Clustering/DivisiveClustering.php index 9c8818ed5..4eac03444 100644 --- a/Algorithm/Clustering/DivisiveClustering.php +++ b/Algorithm/Clustering/DivisiveClustering.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Clustering * @copyright Dennis Eichhorn @@ -50,7 +50,7 @@ final class DivisiveClustering implements ClusteringInterface /** * {@inheritdoc} */ - public function cluster(PointInterface $point) : ?PointInterface + public function cluster(Point $point) : ?Point { return null; } diff --git a/Algorithm/Clustering/Kmeans.php b/Algorithm/Clustering/Kmeans.php index cef32fe15..139fe3aca 100755 --- a/Algorithm/Clustering/Kmeans.php +++ b/Algorithm/Clustering/Kmeans.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Clustering * @copyright Dennis Eichhorn @@ -46,7 +46,7 @@ final class Kmeans implements ClusteringInterface /** * Points of the cluster centers * - * @var PointInterface[] + * @var Point[] * @since 1.0.0 */ private array $clusterCenters = []; @@ -54,7 +54,7 @@ final class Kmeans implements ClusteringInterface /** * Points of the clusters * - * @var PointInterface[] + * @var Point[] * @since 1.0.0 */ private array $clusters = []; @@ -62,7 +62,7 @@ final class Kmeans implements ClusteringInterface /** * Points * - * @var PointInterface[] + * @var Point[] * @since 1.0.0 */ private array $points = []; @@ -76,7 +76,7 @@ final class Kmeans implements ClusteringInterface */ public function __construct(?\Closure $metric = null) { - $this->metric = $metric ?? function (PointInterface $a, PointInterface $b) { + $this->metric = $metric ?? function (Point $a, Point $b) { $aCoordinates = $a->coordinates; $bCoordinates = $b->coordinates; @@ -87,7 +87,7 @@ final class Kmeans implements ClusteringInterface /** * {@inheritdoc} */ - public function cluster(PointInterface $point) : ?PointInterface + public function cluster(Point $point) : ?Point { $bestCluster = null; $bestDistance = \PHP_FLOAT_MAX; @@ -121,8 +121,8 @@ final class Kmeans implements ClusteringInterface /** * Generate the clusters of the points * - * @param PointInterface[] $points Points to cluster - * @param int<1, max> $clusters Amount of clusters + * @param Point[] $points Points to cluster + * @param int<1, max> $clusters Amount of clusters * * @return void * @@ -183,14 +183,14 @@ final class Kmeans implements ClusteringInterface /** * Get the index and distance to the nearest cluster center * - * @param PointInterface $point Point to get the cluster for - * @param PointInterface[] $clusterCenters All cluster centers + * @param Point $point Point to get the cluster for + * @param Point[] $clusterCenters All cluster centers * * @return array [index, distance] * * @since 1.0.0 */ - private function nearestClusterCenter(PointInterface $point, array $clusterCenters) : array + private function nearestClusterCenter(Point $point, array $clusterCenters) : array { $index = $point->group; $dist = \PHP_FLOAT_MAX; @@ -208,12 +208,12 @@ final class Kmeans implements ClusteringInterface } /** - * Initializae cluster centers + * Initialize cluster centers * - * @param PointInterface[] $points Points to use for the cluster center initialization - * @param int<0, max> $n Amount of clusters to use + * @param Point[] $points Points to use for the cluster center initialization + * @param int<0, max> $n Amount of clusters to use * - * @return PointInterface[] + * @return Point[] * * @since 1.0.0 */ diff --git a/Algorithm/Clustering/MeanShift.php b/Algorithm/Clustering/MeanShift.php index c549dd267..4ccde9c1d 100644 --- a/Algorithm/Clustering/MeanShift.php +++ b/Algorithm/Clustering/MeanShift.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Clustering * @copyright Dennis Eichhorn @@ -61,7 +61,7 @@ final class MeanShift implements ClusteringInterface /** * Points outside of any cluster * - * @var PointInterface[] + * @var Point[] * @since 1.0.0 */ private array $noisePoints = []; @@ -79,7 +79,7 @@ final class MeanShift implements ClusteringInterface /** * Points of the cluster centers * - * @var PointInterface[] + * @var Point[] * @since 1.0.0 */ private array $clusterCenters = []; @@ -104,7 +104,7 @@ final class MeanShift implements ClusteringInterface */ public function __construct(?\Closure $metric = null, ?\Closure $kernel = null) { - $this->metric = $metric ?? function (PointInterface $a, PointInterface $b) { + $this->metric = $metric ?? function (Point $a, Point $b) { $aCoordinates = $a->coordinates; $bCoordinates = $b->coordinates; @@ -119,7 +119,7 @@ final class MeanShift implements ClusteringInterface /** * Generate the clusters of the points * - * @param PointInterface[] $points Points to cluster + * @param Point[] $points Points to cluster * @param array $bandwidth Bandwidth(s) * * @return void @@ -170,15 +170,15 @@ final class MeanShift implements ClusteringInterface /** * Perform shift on a point * - * @param PointInterface $point Point to shift - * @param PointInterface $points Array of all points + * @param Point $point Point to shift + * @param Point $points Array of all points * @param array $bandwidth Bandwidth(s) * - * @return PointInterface + * @return Point * * @since 1.0.0 */ - private function shiftPoint(PointInterface $point, array $points, array $bandwidth) : PointInterface + private function shiftPoint(Point $point, array $points, array $bandwidth) : Point { $scaleFactor = 0.0; @@ -209,7 +209,7 @@ final class MeanShift implements ClusteringInterface /** * Group points together into clusters * - * @param PointInterface[] $points Array of points to assign to groups + * @param Point[] $points Array of points to assign to groups * * @return array * @@ -242,14 +242,14 @@ final class MeanShift implements ClusteringInterface /** * Find the closest cluster/group of a point * - * @param PointInterface $point Point to find the cluster for - * @param array $groups Clusters + * @param Point $point Point to find the cluster for + * @param array $groups Clusters * * @return int * * @since 1.0.0 */ - private function findNearestGroup(PointInterface $point, array $groups) : int + private function findNearestGroup(Point $point, array $groups) : int { $nearestGroupIndex = -1; $index = 0; @@ -272,14 +272,14 @@ final class MeanShift implements ClusteringInterface /** * Find distance of point to best cluster/group * - * @param PointInterface $point Point to find the cluster for - * @param PointInterface[] $group Clusters + * @param Point $point Point to find the cluster for + * @param Point[] $group Clusters * * @return float Distance * * @since 1.0.0 */ - private function distanceToGroup(PointInterface $point, array $group) : float + private function distanceToGroup(Point $point, array $group) : float { $minDistance = \PHP_FLOAT_MAX; @@ -305,7 +305,7 @@ final class MeanShift implements ClusteringInterface /** * {@inheritdoc} */ - public function cluster(PointInterface $point) : ?PointInterface + public function cluster(Point $point) : ?Point { $clusterId = $this->findNearestGroup($point, $this->clusters); diff --git a/Algorithm/Clustering/Point.php b/Algorithm/Clustering/Point.php index d9c62f2fc..e33e54c90 100755 --- a/Algorithm/Clustering/Point.php +++ b/Algorithm/Clustering/Point.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Clustering * @copyright Dennis Eichhorn @@ -89,7 +89,7 @@ class Point implements PointInterface /** * {@inheritdoc} */ - public function isEquals(PointInterface $point) : bool + public function isEquals(Point $point) : bool { return $this->name === $point->name && $this->coordinates === $point->coordinates; } diff --git a/Algorithm/Clustering/PointInterface.php b/Algorithm/Clustering/PointInterface.php index 496014f8a..4e84f88a8 100755 --- a/Algorithm/Clustering/PointInterface.php +++ b/Algorithm/Clustering/PointInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Clustering * @copyright Dennis Eichhorn @@ -25,6 +25,10 @@ namespace phpOMS\Algorithm\Clustering; * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 + * + * @property array $coordinates + * @property string $name + * @property int $group */ interface PointInterface { @@ -63,11 +67,11 @@ interface PointInterface /** * Check if two points are equal * - * @param self $point Point to compare with + * @param Point $point Point to compare with * * @return bool * * @since 1.0.0 */ - public function isEquals(self $point) : bool; + public function isEquals(Point $point) : bool; } diff --git a/Algorithm/Clustering/SpectralClustering.php b/Algorithm/Clustering/SpectralClustering.php index aed0e568c..d0a4d5475 100644 --- a/Algorithm/Clustering/SpectralClustering.php +++ b/Algorithm/Clustering/SpectralClustering.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Clustering * @copyright Dennis Eichhorn @@ -46,7 +46,7 @@ final class SpectralClustering implements ClusteringInterface /** * {@inheritdoc} */ - public function cluster(PointInterface $point) : ?PointInterface + public function cluster(Point $point) : ?Point { return null; } diff --git a/Algorithm/CoinMatching/MinimumCoinProblem.php b/Algorithm/CoinMatching/MinimumCoinProblem.php index 8ae43f4b6..8e5b2f52d 100755 --- a/Algorithm/CoinMatching/MinimumCoinProblem.php +++ b/Algorithm/CoinMatching/MinimumCoinProblem.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\CoinMatching * @copyright Dennis Eichhorn diff --git a/Algorithm/Frequency/Apriori.php b/Algorithm/Frequency/Apriori.php index 33ba7751f..51ed4f646 100644 --- a/Algorithm/Frequency/Apriori.php +++ b/Algorithm/Frequency/Apriori.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Frequency * @copyright Dennis Eichhorn diff --git a/Algorithm/Graph/DependencyResolver.php b/Algorithm/Graph/DependencyResolver.php index 6ca83793e..d72baa899 100755 --- a/Algorithm/Graph/DependencyResolver.php +++ b/Algorithm/Graph/DependencyResolver.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Graph; * @copyright Dennis Eichhorn diff --git a/Algorithm/Graph/MarkovChain.php b/Algorithm/Graph/MarkovChain.php index 5cca43932..6a34800f0 100644 --- a/Algorithm/Graph/MarkovChain.php +++ b/Algorithm/Graph/MarkovChain.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Graph * @copyright Dennis Eichhorn diff --git a/Algorithm/JobScheduling/Job.php b/Algorithm/JobScheduling/Job.php index caefd9eff..2639c32a0 100755 --- a/Algorithm/JobScheduling/Job.php +++ b/Algorithm/JobScheduling/Job.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\JobScheduling * @copyright Dennis Eichhorn diff --git a/Algorithm/JobScheduling/JobInterface.php b/Algorithm/JobScheduling/JobInterface.php index d09f94264..462cb2d3f 100755 --- a/Algorithm/JobScheduling/JobInterface.php +++ b/Algorithm/JobScheduling/JobInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\JobScheduling * @copyright Dennis Eichhorn diff --git a/Algorithm/JobScheduling/Weighted.php b/Algorithm/JobScheduling/Weighted.php index d3770ed64..3d1596c48 100755 --- a/Algorithm/JobScheduling/Weighted.php +++ b/Algorithm/JobScheduling/Weighted.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\JobScheduling * @copyright Dennis Eichhorn diff --git a/Algorithm/JobScheduling/v2/Dependency/IdleIntervalType.php b/Algorithm/JobScheduling/v2/Dependency/IdleIntervalType.php index e1c948c01..446cc8ac4 100644 --- a/Algorithm/JobScheduling/v2/Dependency/IdleIntervalType.php +++ b/Algorithm/JobScheduling/v2/Dependency/IdleIntervalType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Scheduling\Dependency * @copyright Dennis Eichhorn diff --git a/Algorithm/JobScheduling/v2/Dependency/IdleTime.php b/Algorithm/JobScheduling/v2/Dependency/IdleTime.php index 6cba29aae..11feea4fb 100644 --- a/Algorithm/JobScheduling/v2/Dependency/IdleTime.php +++ b/Algorithm/JobScheduling/v2/Dependency/IdleTime.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Scheduling\Dependency * @copyright Dennis Eichhorn diff --git a/Algorithm/JobScheduling/v2/Dependency/JobStep.php b/Algorithm/JobScheduling/v2/Dependency/JobStep.php index 2ad9f230b..9ec35e772 100644 --- a/Algorithm/JobScheduling/v2/Dependency/JobStep.php +++ b/Algorithm/JobScheduling/v2/Dependency/JobStep.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Scheduling\Dependency * @copyright Dennis Eichhorn diff --git a/Algorithm/JobScheduling/v2/Dependency/Machine.php b/Algorithm/JobScheduling/v2/Dependency/Machine.php index de1c555e4..d00152c5a 100644 --- a/Algorithm/JobScheduling/v2/Dependency/Machine.php +++ b/Algorithm/JobScheduling/v2/Dependency/Machine.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Scheduling\Dependency * @copyright Dennis Eichhorn diff --git a/Algorithm/JobScheduling/v2/Dependency/MachineType.php b/Algorithm/JobScheduling/v2/Dependency/MachineType.php index 0c8435be0..d3abaf32b 100644 --- a/Algorithm/JobScheduling/v2/Dependency/MachineType.php +++ b/Algorithm/JobScheduling/v2/Dependency/MachineType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Scheduling\Dependency * @copyright Dennis Eichhorn diff --git a/Algorithm/JobScheduling/v2/Dependency/Material.php b/Algorithm/JobScheduling/v2/Dependency/Material.php index f119f69e3..c418d49e8 100644 --- a/Algorithm/JobScheduling/v2/Dependency/Material.php +++ b/Algorithm/JobScheduling/v2/Dependency/Material.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Scheduling\Dependency * @copyright Dennis Eichhorn diff --git a/Algorithm/JobScheduling/v2/Dependency/Qualification.php b/Algorithm/JobScheduling/v2/Dependency/Qualification.php index cc404b246..07e25c864 100644 --- a/Algorithm/JobScheduling/v2/Dependency/Qualification.php +++ b/Algorithm/JobScheduling/v2/Dependency/Qualification.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Scheduling\Dependency * @copyright Dennis Eichhorn diff --git a/Algorithm/JobScheduling/v2/Dependency/Worker.php b/Algorithm/JobScheduling/v2/Dependency/Worker.php index 6d8d00be5..07ad816f1 100644 --- a/Algorithm/JobScheduling/v2/Dependency/Worker.php +++ b/Algorithm/JobScheduling/v2/Dependency/Worker.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Scheduling\Dependency * @copyright Dennis Eichhorn diff --git a/Algorithm/JobScheduling/v2/Dependency/WorkerType.php b/Algorithm/JobScheduling/v2/Dependency/WorkerType.php index 13b4a1ebf..e39131447 100644 --- a/Algorithm/JobScheduling/v2/Dependency/WorkerType.php +++ b/Algorithm/JobScheduling/v2/Dependency/WorkerType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Scheduling\Dependency * @copyright Dennis Eichhorn diff --git a/Algorithm/JobScheduling/v2/Job.php b/Algorithm/JobScheduling/v2/Job.php index c9c9a0e05..331b8fc5e 100644 --- a/Algorithm/JobScheduling/v2/Job.php +++ b/Algorithm/JobScheduling/v2/Job.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Scheduling * @copyright Dennis Eichhorn diff --git a/Algorithm/JobScheduling/v2/PriorityMode.php b/Algorithm/JobScheduling/v2/PriorityMode.php index 6ed957ccb..4b5f6d56d 100644 --- a/Algorithm/JobScheduling/v2/PriorityMode.php +++ b/Algorithm/JobScheduling/v2/PriorityMode.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Scheduling * @copyright Dennis Eichhorn diff --git a/Algorithm/JobScheduling/v2/ScheduleQueue.php b/Algorithm/JobScheduling/v2/ScheduleQueue.php index 4fd5352fc..e094cb711 100644 --- a/Algorithm/JobScheduling/v2/ScheduleQueue.php +++ b/Algorithm/JobScheduling/v2/ScheduleQueue.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Scheduling * @copyright Dennis Eichhorn diff --git a/Algorithm/Knapsack/Backpack.php b/Algorithm/Knapsack/Backpack.php index 1ea278ab9..573ef4653 100755 --- a/Algorithm/Knapsack/Backpack.php +++ b/Algorithm/Knapsack/Backpack.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Knapsack * @copyright Dennis Eichhorn diff --git a/Algorithm/Knapsack/BackpackInterface.php b/Algorithm/Knapsack/BackpackInterface.php index b658880b8..5b7971e2b 100755 --- a/Algorithm/Knapsack/BackpackInterface.php +++ b/Algorithm/Knapsack/BackpackInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Knapsack * @copyright Dennis Eichhorn diff --git a/Algorithm/Knapsack/Bounded.php b/Algorithm/Knapsack/Bounded.php index b6ca67a9c..3e1ff2757 100755 --- a/Algorithm/Knapsack/Bounded.php +++ b/Algorithm/Knapsack/Bounded.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Knapsack * @copyright Dennis Eichhorn diff --git a/Algorithm/Knapsack/Continuous.php b/Algorithm/Knapsack/Continuous.php index 384fba382..a7313fd38 100755 --- a/Algorithm/Knapsack/Continuous.php +++ b/Algorithm/Knapsack/Continuous.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Knapsack * @copyright Dennis Eichhorn diff --git a/Algorithm/Knapsack/Item.php b/Algorithm/Knapsack/Item.php index cc49c12d1..6da01c1eb 100755 --- a/Algorithm/Knapsack/Item.php +++ b/Algorithm/Knapsack/Item.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Knapsack * @copyright Dennis Eichhorn diff --git a/Algorithm/Knapsack/ItemInterface.php b/Algorithm/Knapsack/ItemInterface.php index cda62a8f3..7a374c5c8 100755 --- a/Algorithm/Knapsack/ItemInterface.php +++ b/Algorithm/Knapsack/ItemInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Knapsack * @copyright Dennis Eichhorn diff --git a/Algorithm/Maze/MazeGenerator.php b/Algorithm/Maze/MazeGenerator.php index 8b180257e..669151e8a 100755 --- a/Algorithm/Maze/MazeGenerator.php +++ b/Algorithm/Maze/MazeGenerator.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Maze * @copyright Dennis Eichhorn diff --git a/Algorithm/Optimization/AntColonyOptimization.php b/Algorithm/Optimization/AntColonyOptimization.php index dcb71d35c..8871faad1 100644 --- a/Algorithm/Optimization/AntColonyOptimization.php +++ b/Algorithm/Optimization/AntColonyOptimization.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Optimization * @copyright Dennis Eichhorn diff --git a/Algorithm/Optimization/BeesAlgorithm.php b/Algorithm/Optimization/BeesAlgorithm.php index 069f3d8c2..44a62c0a4 100644 --- a/Algorithm/Optimization/BeesAlgorithm.php +++ b/Algorithm/Optimization/BeesAlgorithm.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Optimization * @copyright Dennis Eichhorn diff --git a/Algorithm/Optimization/FireflyAlgorithm.php b/Algorithm/Optimization/FireflyAlgorithm.php index c4286c271..a7599904d 100644 --- a/Algorithm/Optimization/FireflyAlgorithm.php +++ b/Algorithm/Optimization/FireflyAlgorithm.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Optimization * @copyright Dennis Eichhorn diff --git a/Algorithm/Optimization/GeneticOptimization.php b/Algorithm/Optimization/GeneticOptimization.php index e8495ddb5..828b99ff7 100644 --- a/Algorithm/Optimization/GeneticOptimization.php +++ b/Algorithm/Optimization/GeneticOptimization.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Optimization * @copyright Dennis Eichhorn diff --git a/Algorithm/Optimization/HarmonySearch.php b/Algorithm/Optimization/HarmonySearch.php index 74a36486a..8888b3710 100644 --- a/Algorithm/Optimization/HarmonySearch.php +++ b/Algorithm/Optimization/HarmonySearch.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Optimization * @copyright Dennis Eichhorn diff --git a/Algorithm/Optimization/IntelligentWaterDrops.php b/Algorithm/Optimization/IntelligentWaterDrops.php index 283b689f6..e6849a10c 100644 --- a/Algorithm/Optimization/IntelligentWaterDrops.php +++ b/Algorithm/Optimization/IntelligentWaterDrops.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Optimization * @copyright Dennis Eichhorn diff --git a/Algorithm/Optimization/SimulatedAnnealing.php b/Algorithm/Optimization/SimulatedAnnealing.php index 184d4bb74..195baeb49 100644 --- a/Algorithm/Optimization/SimulatedAnnealing.php +++ b/Algorithm/Optimization/SimulatedAnnealing.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Optimization * @copyright Dennis Eichhorn diff --git a/Algorithm/Optimization/TabuSearch.php b/Algorithm/Optimization/TabuSearch.php index 9c92098f8..34a3de2d9 100644 --- a/Algorithm/Optimization/TabuSearch.php +++ b/Algorithm/Optimization/TabuSearch.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Optimization * @copyright Dennis Eichhorn diff --git a/Algorithm/PathFinding/AStar.php b/Algorithm/PathFinding/AStar.php index 0c5d87e17..7dd286c64 100755 --- a/Algorithm/PathFinding/AStar.php +++ b/Algorithm/PathFinding/AStar.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\PathFinding * @copyright Dennis Eichhorn diff --git a/Algorithm/PathFinding/AStarNode.php b/Algorithm/PathFinding/AStarNode.php index 98de0e1c8..7ab87a8e9 100755 --- a/Algorithm/PathFinding/AStarNode.php +++ b/Algorithm/PathFinding/AStarNode.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\PathFinding * @copyright Dennis Eichhorn diff --git a/Algorithm/PathFinding/Grid.php b/Algorithm/PathFinding/Grid.php index dbb76701a..bb5cd9e61 100755 --- a/Algorithm/PathFinding/Grid.php +++ b/Algorithm/PathFinding/Grid.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\PathFinding * @copyright Dennis Eichhorn diff --git a/Algorithm/PathFinding/Heuristic.php b/Algorithm/PathFinding/Heuristic.php index 0fa62b643..7125c0927 100755 --- a/Algorithm/PathFinding/Heuristic.php +++ b/Algorithm/PathFinding/Heuristic.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\PathFinding * @copyright Dennis Eichhorn diff --git a/Algorithm/PathFinding/HeuristicType.php b/Algorithm/PathFinding/HeuristicType.php index 98fec0fe2..4166cfd54 100755 --- a/Algorithm/PathFinding/HeuristicType.php +++ b/Algorithm/PathFinding/HeuristicType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\PathFinding * @copyright Dennis Eichhorn diff --git a/Algorithm/PathFinding/JumpPointNode.php b/Algorithm/PathFinding/JumpPointNode.php index 799f814e4..85fceeb93 100755 --- a/Algorithm/PathFinding/JumpPointNode.php +++ b/Algorithm/PathFinding/JumpPointNode.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\PathFinding * @copyright Dennis Eichhorn diff --git a/Algorithm/PathFinding/JumpPointSearch.php b/Algorithm/PathFinding/JumpPointSearch.php index 085570237..82715e1e7 100755 --- a/Algorithm/PathFinding/JumpPointSearch.php +++ b/Algorithm/PathFinding/JumpPointSearch.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\PathFinding * @copyright Dennis Eichhorn diff --git a/Algorithm/PathFinding/MovementType.php b/Algorithm/PathFinding/MovementType.php index f1c0d7f49..7644ed2b3 100755 --- a/Algorithm/PathFinding/MovementType.php +++ b/Algorithm/PathFinding/MovementType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\PathFinding * @copyright Dennis Eichhorn diff --git a/Algorithm/PathFinding/Node.php b/Algorithm/PathFinding/Node.php index cfa71aae9..ce2e448b6 100755 --- a/Algorithm/PathFinding/Node.php +++ b/Algorithm/PathFinding/Node.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\PathFinding * @copyright Dennis Eichhorn diff --git a/Algorithm/PathFinding/NullJumpPointNode.php b/Algorithm/PathFinding/NullJumpPointNode.php index 704ec3822..c7bf598e5 100755 --- a/Algorithm/PathFinding/NullJumpPointNode.php +++ b/Algorithm/PathFinding/NullJumpPointNode.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\PathFinding * @copyright Dennis Eichhorn diff --git a/Algorithm/PathFinding/NullNode.php b/Algorithm/PathFinding/NullNode.php index a80e33648..398d970c7 100755 --- a/Algorithm/PathFinding/NullNode.php +++ b/Algorithm/PathFinding/NullNode.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\PathFinding * @copyright Dennis Eichhorn diff --git a/Algorithm/PathFinding/Path.php b/Algorithm/PathFinding/Path.php index 80f0bc8d1..91869b5e6 100755 --- a/Algorithm/PathFinding/Path.php +++ b/Algorithm/PathFinding/Path.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\PathFinding * @copyright Dennis Eichhorn diff --git a/Algorithm/PathFinding/PathFinderInterface.php b/Algorithm/PathFinding/PathFinderInterface.php index d584caca0..bfca65975 100755 --- a/Algorithm/PathFinding/PathFinderInterface.php +++ b/Algorithm/PathFinding/PathFinderInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\PathFinding * @copyright Dennis Eichhorn diff --git a/Algorithm/Rating/BradleyTerry.php b/Algorithm/Rating/BradleyTerry.php index 816c518f7..5fe67042b 100644 --- a/Algorithm/Rating/BradleyTerry.php +++ b/Algorithm/Rating/BradleyTerry.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Rating * @copyright Dennis Eichhorn diff --git a/Algorithm/Rating/Elo.php b/Algorithm/Rating/Elo.php index b16d9d3e6..114a68068 100644 --- a/Algorithm/Rating/Elo.php +++ b/Algorithm/Rating/Elo.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Rating * @copyright Dennis Eichhorn diff --git a/Algorithm/Rating/Glicko1.php b/Algorithm/Rating/Glicko1.php index 0b2a6a8f0..8e9f267eb 100644 --- a/Algorithm/Rating/Glicko1.php +++ b/Algorithm/Rating/Glicko1.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Rating * @copyright Dennis Eichhorn diff --git a/Algorithm/Rating/Glicko2.php b/Algorithm/Rating/Glicko2.php index 15be92546..d056f878b 100644 --- a/Algorithm/Rating/Glicko2.php +++ b/Algorithm/Rating/Glicko2.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Rating * @copyright Dennis Eichhorn diff --git a/Algorithm/Rating/TrueSkill.php b/Algorithm/Rating/TrueSkill.php index 8b064b456..7356916c9 100644 --- a/Algorithm/Rating/TrueSkill.php +++ b/Algorithm/Rating/TrueSkill.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Rating * @copyright Microsoft @@ -28,6 +28,7 @@ use phpOMS\Math\Stochastic\Distribution\NormalDistribution; * @todo Implement https://github.com/sublee/trueskill/blob/master/trueskill/__init__.py * https://github.com/Karaka-Management/phpOMS/issues/337 */ +// phpcs:ignoreFile class TrueSkill { public const DEFAULT_MU = 25; @@ -226,37 +227,22 @@ class TrueSkill / (NormalDistribution::getCdf($epsilon - $tAbs, 0.0, 1.0) - NormalDistribution::getCdf(-$epsilon - $tAbs, 0.0, 1.0)); } - /** - * - */ private function buildRatingLayer() : void { } - /** - * - */ private function buildPerformanceLayer() : void { } - /** - * - */ private function buildTeamPerformanceLayer() : void { } - /** - * - */ private function buildTruncLayer() : void { } - /** - * - */ private function factorGraphBuilders() { // Rating layer @@ -275,9 +261,6 @@ class TrueSkill ]; } - /** - * - */ public function rating() : void { // Start values diff --git a/Algorithm/Rating/TrueSkillFactoryGraph.php b/Algorithm/Rating/TrueSkillFactoryGraph.php index 22445ea52..35fee9e23 100644 --- a/Algorithm/Rating/TrueSkillFactoryGraph.php +++ b/Algorithm/Rating/TrueSkillFactoryGraph.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Rating * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/BitonicSort.php b/Algorithm/Sort/BitonicSort.php index dc9770551..313b070b1 100755 --- a/Algorithm/Sort/BitonicSort.php +++ b/Algorithm/Sort/BitonicSort.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/BubbleSort.php b/Algorithm/Sort/BubbleSort.php index c7d44e75c..18810dc8e 100755 --- a/Algorithm/Sort/BubbleSort.php +++ b/Algorithm/Sort/BubbleSort.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/BucketSort.php b/Algorithm/Sort/BucketSort.php index 866f30cc0..ff5d21c40 100755 --- a/Algorithm/Sort/BucketSort.php +++ b/Algorithm/Sort/BucketSort.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/CocktailShakerSort.php b/Algorithm/Sort/CocktailShakerSort.php index 5748971ca..ca83f4ed2 100755 --- a/Algorithm/Sort/CocktailShakerSort.php +++ b/Algorithm/Sort/CocktailShakerSort.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/CombSort.php b/Algorithm/Sort/CombSort.php index 6b9cf4ff8..5a1962518 100755 --- a/Algorithm/Sort/CombSort.php +++ b/Algorithm/Sort/CombSort.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/CycleSort.php b/Algorithm/Sort/CycleSort.php index 385394c2a..0d6f9438a 100755 --- a/Algorithm/Sort/CycleSort.php +++ b/Algorithm/Sort/CycleSort.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/GnomeSort.php b/Algorithm/Sort/GnomeSort.php index 243aeb128..f291de79b 100755 --- a/Algorithm/Sort/GnomeSort.php +++ b/Algorithm/Sort/GnomeSort.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/HeapSort.php b/Algorithm/Sort/HeapSort.php index 6bf81e424..99a69e71e 100755 --- a/Algorithm/Sort/HeapSort.php +++ b/Algorithm/Sort/HeapSort.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/InsertionSort.php b/Algorithm/Sort/InsertionSort.php index b3b6ae650..f99c3d545 100755 --- a/Algorithm/Sort/InsertionSort.php +++ b/Algorithm/Sort/InsertionSort.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/IntroSort.php b/Algorithm/Sort/IntroSort.php index f5e529443..73cc258a9 100755 --- a/Algorithm/Sort/IntroSort.php +++ b/Algorithm/Sort/IntroSort.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/MergeSort.php b/Algorithm/Sort/MergeSort.php index 6812c4694..ce2a8be4d 100755 --- a/Algorithm/Sort/MergeSort.php +++ b/Algorithm/Sort/MergeSort.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/OddEvenSort.php b/Algorithm/Sort/OddEvenSort.php index 58cba69dc..f0f5e84ac 100755 --- a/Algorithm/Sort/OddEvenSort.php +++ b/Algorithm/Sort/OddEvenSort.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/PancakeSort.php b/Algorithm/Sort/PancakeSort.php index bc8ecdd50..30384fc92 100755 --- a/Algorithm/Sort/PancakeSort.php +++ b/Algorithm/Sort/PancakeSort.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/QuickSort.php b/Algorithm/Sort/QuickSort.php index 16f04749b..104f373f4 100755 --- a/Algorithm/Sort/QuickSort.php +++ b/Algorithm/Sort/QuickSort.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/SelectionSort.php b/Algorithm/Sort/SelectionSort.php index 0c8895b7c..5e9352599 100755 --- a/Algorithm/Sort/SelectionSort.php +++ b/Algorithm/Sort/SelectionSort.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/ShellSort.php b/Algorithm/Sort/ShellSort.php index 0acea87c8..321879c52 100755 --- a/Algorithm/Sort/ShellSort.php +++ b/Algorithm/Sort/ShellSort.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/SortInterface.php b/Algorithm/Sort/SortInterface.php index e8f4851db..49952a3b6 100755 --- a/Algorithm/Sort/SortInterface.php +++ b/Algorithm/Sort/SortInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/SortOrder.php b/Algorithm/Sort/SortOrder.php index 62ce9d10a..096b3dfc8 100755 --- a/Algorithm/Sort/SortOrder.php +++ b/Algorithm/Sort/SortOrder.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/SortableInterface.php b/Algorithm/Sort/SortableInterface.php index 0ec029947..1975ac785 100755 --- a/Algorithm/Sort/SortableInterface.php +++ b/Algorithm/Sort/SortableInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/StoogeSort.php b/Algorithm/Sort/StoogeSort.php index 1ab563479..cd23e45c9 100755 --- a/Algorithm/Sort/StoogeSort.php +++ b/Algorithm/Sort/StoogeSort.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Algorithm/Sort/TimSort.php b/Algorithm/Sort/TimSort.php index 187f3759a..430a890e3 100755 --- a/Algorithm/Sort/TimSort.php +++ b/Algorithm/Sort/TimSort.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Algorithm\Sort; * @copyright Dennis Eichhorn diff --git a/Api/CreditRating/CreditRatingInterface.php b/Api/CreditRating/CreditRatingInterface.php index 1674668dc..edc46d617 100644 --- a/Api/CreditRating/CreditRatingInterface.php +++ b/Api/CreditRating/CreditRatingInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\CreditRating * @copyright Dennis Eichhorn diff --git a/Api/CreditRating/CreditSafe.php b/Api/CreditRating/CreditSafe.php index bac5a7ace..47c074501 100644 --- a/Api/CreditRating/CreditSafe.php +++ b/Api/CreditRating/CreditSafe.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\CreditRating * @copyright Dennis Eichhorn diff --git a/Api/EUVAT/EUVATBffOnline.php b/Api/EUVAT/EUVATBffOnline.php index b23c0bc17..4fce12ed6 100755 --- a/Api/EUVAT/EUVATBffOnline.php +++ b/Api/EUVAT/EUVATBffOnline.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\EUVAT * @copyright Dennis Eichhorn diff --git a/Api/EUVAT/EUVATInterface.php b/Api/EUVAT/EUVATInterface.php index a8cc65787..9c31626a8 100755 --- a/Api/EUVAT/EUVATInterface.php +++ b/Api/EUVAT/EUVATInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\EUVAT * @copyright Dennis Eichhorn diff --git a/Api/EUVAT/EUVATVies.php b/Api/EUVAT/EUVATVies.php index 5ee4888e2..c27dad3ed 100755 --- a/Api/EUVAT/EUVATVies.php +++ b/Api/EUVAT/EUVATVies.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\EUVAT * @copyright Dennis Eichhorn @@ -211,21 +211,23 @@ final class EUVATVies implements EUVATInterface $result['vat'] = $json['isValid'] ? 'A' : 'B'; $result['name'] = $json['isValid']; - $result['city'] = \stripos($json['address'], "\n") !== false - ? \substr($json['address'], \stripos($json['address'], "\n") + 1) + $newLinePos = \stripos($json['address'] ?? '', "\n"); + + $result['city'] = $newLinePos !== false + ? \substr($json['address'], $newLinePos + 1) : ''; - $result['postal'] = \stripos($json['address'], "\n") !== false + $result['postal'] = $newLinePos !== false ? \substr( $json['address'], - \stripos($json['address'], "\n") + 1, - \stripos($json['address'], ' ', \stripos($json['address'], "\n")) - \stripos($json['address'], "\n") - 1 + $newLinePos + 1, + \stripos($json['address'], ' ', $newLinePos) - $newLinePos - 1 ) : ''; - $result['address'] = \stripos($json['address'], "\n") !== false - ? \substr($json['address'], 0, \stripos($json['address'], "\n") - 1) - : $json['address']; + $result['address'] = $newLinePos !== false + ? \substr($json['address'], 0, $newLinePos - 1) + : ($json['address'] ?? ''); $result['name'] = $result['name'] === '---' ? '' : $result['name']; $result['city'] = $result['city'] === '---' ? '' : $result['city']; diff --git a/Api/Geocoding/Nominatim.php b/Api/Geocoding/Nominatim.php index 37bc72481..2247b7d58 100644 --- a/Api/Geocoding/Nominatim.php +++ b/Api/Geocoding/Nominatim.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Geocoding * @copyright Dennis Eichhorn diff --git a/Api/Payment/Charge.php b/Api/Payment/Charge.php index 421f0c36f..096e9f795 100755 --- a/Api/Payment/Charge.php +++ b/Api/Payment/Charge.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Payment * @copyright Dennis Eichhorn diff --git a/Api/Payment/PaymentAbstract.php b/Api/Payment/PaymentAbstract.php index 52d6af5e1..58327b851 100755 --- a/Api/Payment/PaymentAbstract.php +++ b/Api/Payment/PaymentAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Payment * @copyright Dennis Eichhorn diff --git a/Api/Payment/PaymentFactory.php b/Api/Payment/PaymentFactory.php index df07ccd90..697b84e5a 100755 --- a/Api/Payment/PaymentFactory.php +++ b/Api/Payment/PaymentFactory.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Payment * @copyright Dennis Eichhorn diff --git a/Api/Payment/Stripe.php b/Api/Payment/Stripe.php index 62945a4db..1b23ebeae 100755 --- a/Api/Payment/Stripe.php +++ b/Api/Payment/Stripe.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Payment * @copyright Dennis Eichhorn diff --git a/Api/Shipping/AuthStatus.php b/Api/Shipping/AuthStatus.php index 83f422e19..7c1e3f56c 100644 --- a/Api/Shipping/AuthStatus.php +++ b/Api/Shipping/AuthStatus.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Shipping * @copyright Dennis Eichhorn diff --git a/Api/Shipping/AuthType.php b/Api/Shipping/AuthType.php index 6e0de307f..608c1994e 100644 --- a/Api/Shipping/AuthType.php +++ b/Api/Shipping/AuthType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Shipping * @copyright Dennis Eichhorn diff --git a/Api/Shipping/DHL/DHLInternationalShipping.php b/Api/Shipping/DHL/DHLInternationalShipping.php index 8a39619c0..ffc0c03b9 100644 --- a/Api/Shipping/DHL/DHLInternationalShipping.php +++ b/Api/Shipping/DHL/DHLInternationalShipping.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Shipping\DHL * @copyright Dennis Eichhorn diff --git a/Api/Shipping/DHL/DHLParcelDEShipping.php b/Api/Shipping/DHL/DHLParcelDEShipping.php index 23a636fe3..1430cd05b 100644 --- a/Api/Shipping/DHL/DHLParcelDEShipping.php +++ b/Api/Shipping/DHL/DHLParcelDEShipping.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Shipping\DHL * @copyright Dennis Eichhorn diff --git a/Api/Shipping/DHL/DHLeCommerceShipping.php b/Api/Shipping/DHL/DHLeCommerceShipping.php index bc3ef10e5..270cc2942 100644 --- a/Api/Shipping/DHL/DHLeCommerceShipping.php +++ b/Api/Shipping/DHL/DHLeCommerceShipping.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Shipping\DHL * @copyright Dennis Eichhorn diff --git a/Api/Shipping/DPD/DPDShipping.php b/Api/Shipping/DPD/DPDShipping.php index 8b33ad7a0..30e4dab8c 100644 --- a/Api/Shipping/DPD/DPDShipping.php +++ b/Api/Shipping/DPD/DPDShipping.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Shipping\DPD * @copyright Dennis Eichhorn diff --git a/Api/Shipping/Fedex/FedexShipping.php b/Api/Shipping/Fedex/FedexShipping.php index 058830d56..d74adf1c9 100644 --- a/Api/Shipping/Fedex/FedexShipping.php +++ b/Api/Shipping/Fedex/FedexShipping.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Shipping\Fedex * @copyright Dennis Eichhorn diff --git a/Api/Shipping/RoyalMail/RoyalMailShipping.php b/Api/Shipping/RoyalMail/RoyalMailShipping.php index 8c5c638e4..6f5531fc7 100644 --- a/Api/Shipping/RoyalMail/RoyalMailShipping.php +++ b/Api/Shipping/RoyalMail/RoyalMailShipping.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Shipping\RoyalMail * @copyright Dennis Eichhorn diff --git a/Api/Shipping/ShippingFactory.php b/Api/Shipping/ShippingFactory.php index 0a0804f40..91d91db7f 100644 --- a/Api/Shipping/ShippingFactory.php +++ b/Api/Shipping/ShippingFactory.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Shipping * @copyright Dennis Eichhorn diff --git a/Api/Shipping/ShippingInterface.php b/Api/Shipping/ShippingInterface.php index 2346f6b9f..2ec8c7248 100644 --- a/Api/Shipping/ShippingInterface.php +++ b/Api/Shipping/ShippingInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Shipping * @copyright Dennis Eichhorn diff --git a/Api/Shipping/ShippingType.php b/Api/Shipping/ShippingType.php index 3c4596998..88d586c03 100644 --- a/Api/Shipping/ShippingType.php +++ b/Api/Shipping/ShippingType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Shipping * @copyright Dennis Eichhorn diff --git a/Api/Shipping/TNT/TNTShipping.php b/Api/Shipping/TNT/TNTShipping.php index eeb2faa8a..bf5b7873a 100644 --- a/Api/Shipping/TNT/TNTShipping.php +++ b/Api/Shipping/TNT/TNTShipping.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Shipping\TNT * @copyright Dennis Eichhorn diff --git a/Api/Shipping/UPS/UPSShipping.php b/Api/Shipping/UPS/UPSShipping.php index 727a9afed..dcdcbb6f6 100644 --- a/Api/Shipping/UPS/UPSShipping.php +++ b/Api/Shipping/UPS/UPSShipping.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Shipping\UPS * @copyright Dennis Eichhorn diff --git a/Api/Shipping/Usps/UspsShipping.php b/Api/Shipping/Usps/UspsShipping.php index 455c44e17..0a76d8df1 100644 --- a/Api/Shipping/Usps/UspsShipping.php +++ b/Api/Shipping/Usps/UspsShipping.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Api\Shipping\Usps * @copyright Dennis Eichhorn diff --git a/Application/ApplicationAbstract.php b/Application/ApplicationAbstract.php index 63ab46688..7ac175de5 100755 --- a/Application/ApplicationAbstract.php +++ b/Application/ApplicationAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Application * @copyright Dennis Eichhorn diff --git a/Application/ApplicationInfo.php b/Application/ApplicationInfo.php index 3c842ca9c..16bf6f102 100755 --- a/Application/ApplicationInfo.php +++ b/Application/ApplicationInfo.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Application * @copyright Dennis Eichhorn diff --git a/Application/ApplicationManager.php b/Application/ApplicationManager.php index 9c374c8db..55d5e26a9 100755 --- a/Application/ApplicationManager.php +++ b/Application/ApplicationManager.php @@ -3,7 +3,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Application * @copyright Dennis Eichhorn diff --git a/Application/ApplicationStatus.php b/Application/ApplicationStatus.php index 08b0012d6..e348b8d0a 100755 --- a/Application/ApplicationStatus.php +++ b/Application/ApplicationStatus.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Application * @copyright Dennis Eichhorn diff --git a/Application/ApplicationType.php b/Application/ApplicationType.php index 033b1f044..1ad54224e 100755 --- a/Application/ApplicationType.php +++ b/Application/ApplicationType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Application * @copyright Dennis Eichhorn diff --git a/Application/InstallerAbstract.php b/Application/InstallerAbstract.php index 83ff95c81..d76b7a9e7 100755 --- a/Application/InstallerAbstract.php +++ b/Application/InstallerAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Application * @copyright Dennis Eichhorn diff --git a/Application/StatusAbstract.php b/Application/StatusAbstract.php index ca59221fd..1323799cc 100755 --- a/Application/StatusAbstract.php +++ b/Application/StatusAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Application * @copyright Dennis Eichhorn diff --git a/Application/UninstallerAbstract.php b/Application/UninstallerAbstract.php index eacab27b8..d38cb4f69 100755 --- a/Application/UninstallerAbstract.php +++ b/Application/UninstallerAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Application * @copyright Dennis Eichhorn diff --git a/Asset/AssetManager.php b/Asset/AssetManager.php index 6fbc62edd..998834e40 100755 --- a/Asset/AssetManager.php +++ b/Asset/AssetManager.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Asset * @copyright Dennis Eichhorn diff --git a/Asset/AssetType.php b/Asset/AssetType.php index 52010138c..d8085a6a3 100755 --- a/Asset/AssetType.php +++ b/Asset/AssetType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Asset * @copyright Dennis Eichhorn diff --git a/Auth/Auth.php b/Auth/Auth.php index 404d64d12..1b3ae9c89 100755 --- a/Auth/Auth.php +++ b/Auth/Auth.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Auth * @copyright Dennis Eichhorn diff --git a/Auth/LoginReturnType.php b/Auth/LoginReturnType.php index 33f28487a..d7a81ab8c 100755 --- a/Auth/LoginReturnType.php +++ b/Auth/LoginReturnType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Auth * @copyright Dennis Eichhorn diff --git a/AutoloadException.php b/AutoloadException.php index 1c3f3c0fc..9a4dbe0a9 100755 --- a/AutoloadException.php +++ b/AutoloadException.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS * @copyright Dennis Eichhorn diff --git a/Autoloader.php b/Autoloader.php index 394d6c057..23dc35123 100755 --- a/Autoloader.php +++ b/Autoloader.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS * @copyright Dennis Eichhorn diff --git a/Business/BusinessHelper.php b/Business/BusinessHelper.php index 6b3abff03..50fdcf5e6 100644 --- a/Business/BusinessHelper.php +++ b/Business/BusinessHelper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business * @copyright Dennis Eichhorn diff --git a/Business/Finance/Depreciation.php b/Business/Finance/Depreciation.php index fc5c32014..4f955e0de 100755 --- a/Business/Finance/Depreciation.php +++ b/Business/Finance/Depreciation.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business\Finance * @copyright Dennis Eichhorn diff --git a/Business/Finance/DepreciationType.php b/Business/Finance/DepreciationType.php index 7f5874564..9343e241d 100644 --- a/Business/Finance/DepreciationType.php +++ b/Business/Finance/DepreciationType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business\Finance * @copyright Dennis Eichhorn diff --git a/Business/Finance/FinanceFormulas.php b/Business/Finance/FinanceFormulas.php index bca291015..f7c2f2048 100755 --- a/Business/Finance/FinanceFormulas.php +++ b/Business/Finance/FinanceFormulas.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business\Finance * @copyright Dennis Eichhorn diff --git a/Business/Finance/Forensics.php b/Business/Finance/Forensics.php index 0f34495cf..e557e69b7 100755 --- a/Business/Finance/Forensics.php +++ b/Business/Finance/Forensics.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business\Finance * @copyright Dennis Eichhorn diff --git a/Business/Finance/Loan.php b/Business/Finance/Loan.php index fb687bd3d..bcf13e2f8 100755 --- a/Business/Finance/Loan.php +++ b/Business/Finance/Loan.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business\Finance * @copyright Dennis Eichhorn @@ -133,4 +133,89 @@ final class Loan { return $loan / $collateral; } + + /** + * Calculate the payment for amortization loans (interest + principal) + * + * @param float $loan Loan amount + * @param float $r Rate + * @param int $duration Loan duration + * @param int $interval Payment interval + * + * @return float + * + * @since 1.0.0 + */ + public static function getAmortizationLoanPayment(float $loan, float $r, int $duration, int $interval) : float + { + return $loan * (($r / $interval * (1.0 + $r / $interval) / $duration) / ((1.0 + $r / $interval) / $duration) - 1); + } + + /** + * Calculate the interest for amortization loans + * + * @param float $loan Loan amount + * @param float $r Rate + * @param int $interval Payment interval + * + * @return float + * + * @since 1.0.0 + */ + public static function getAmortizationLoanInterest(float $loan, float $r, int $interval) : float + { + return $loan * $r / $interval; + } + + /** + * Calculate the principal for amortization loans + * + * @param float $payment Total payment + * @param float $interest Interest payment + * + * @return float + * + * @since 1.0.0 + */ + public static function getAmortizationPrincipalPayment(float $payment, float $interest) : float + { + return $payment - $interest; + } + + /** + * Calculate schedule for amortization loan + * + * @param float $loan Loan amount + * @param float $r Borrowing rate (annual) + * @param int $duration Loan duration in months + * @param int $interval Payment interval (usually 12 = every month) + */ + public static function getAmortizationSchedule(float $loan, float $r, int $duration, int $interval) : array + { + $schedule = [0 => ['loan' => $loan, 'total' => 0.0, 'interest' => 0.0, 'principal' => 0.0]]; + $previous = \reset($schedule); + + while ($previous['loan'] > 0.0) { + $new = [ + 'loan' => 0.0, + 'total' => 0.0, + 'interest' => 0.0, + 'principal' => 0.0, + ]; + + $new['total'] = \round(self::getAmortizationLoanPayment($previous['loan'], $r, $duration, $interval), 2); + $new['interest'] = \round(self::getAmortizationLoanInterest($previous['loan'], $r, $interval), 2); + $new['principal'] = \round($new['total'] - $new['interest'], 2); + $new['loan'] = \max(0, \round($previous['loan'] - $new['principal'], 2)); + + if ($new['loan'] < 0.01) { + $new['loan'] = 0.0; + } + + $schedule[] = $new; + $previous = $new; + } + + return $schedule; + } } diff --git a/Business/Finance/Lorenzkurve.php b/Business/Finance/Lorenzkurve.php index 0ac0cf1f6..8530d5e77 100755 --- a/Business/Finance/Lorenzkurve.php +++ b/Business/Finance/Lorenzkurve.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business\Finance * @copyright Dennis Eichhorn diff --git a/Business/Finance/StockBonds.php b/Business/Finance/StockBonds.php index 21b0df3db..f3f286a60 100755 --- a/Business/Finance/StockBonds.php +++ b/Business/Finance/StockBonds.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business\Finance * @copyright Dennis Eichhorn diff --git a/Business/Marketing/CustomerValue.php b/Business/Marketing/CustomerValue.php index e7a4a61d7..dd718b71d 100755 --- a/Business/Marketing/CustomerValue.php +++ b/Business/Marketing/CustomerValue.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business\Marketing * @copyright Dennis Eichhorn diff --git a/Business/Marketing/Metrics.php b/Business/Marketing/Metrics.php index 2511c4e82..9eb1e2d79 100755 --- a/Business/Marketing/Metrics.php +++ b/Business/Marketing/Metrics.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business\Marketing * @copyright Dennis Eichhorn diff --git a/Business/Marketing/NetPromoterScore.php b/Business/Marketing/NetPromoterScore.php index 17635ffa7..7ed327c0f 100755 --- a/Business/Marketing/NetPromoterScore.php +++ b/Business/Marketing/NetPromoterScore.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business\Marketing * @copyright Dennis Eichhorn diff --git a/Business/Marketing/PageRank.php b/Business/Marketing/PageRank.php index fde35ee14..638434f67 100755 --- a/Business/Marketing/PageRank.php +++ b/Business/Marketing/PageRank.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business\Marketing * @copyright Dennis Eichhorn diff --git a/Business/Programming/Metrics.php b/Business/Programming/Metrics.php index 18cf95786..35b252ba0 100755 --- a/Business/Programming/Metrics.php +++ b/Business/Programming/Metrics.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business\Programming * @copyright Dennis Eichhorn diff --git a/Business/Recommendation/ArticleCorrelationAffinity.php b/Business/Recommendation/ArticleCorrelationAffinity.php index bbe79adc8..7d38315ec 100644 --- a/Business/Recommendation/ArticleCorrelationAffinity.php +++ b/Business/Recommendation/ArticleCorrelationAffinity.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business\Recommendation * @copyright Dennis Eichhorn diff --git a/Business/Recommendation/BayesianPersonalizedRanking.php b/Business/Recommendation/BayesianPersonalizedRanking.php index 6baf4042d..95c40af1d 100644 --- a/Business/Recommendation/BayesianPersonalizedRanking.php +++ b/Business/Recommendation/BayesianPersonalizedRanking.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business\Recommendation * @copyright Dennis Eichhorn @@ -40,12 +40,12 @@ final class BayesianPersonalizedRanking /** * Constructor. * - * @param int $numFactors Determines the dimensionality of the latent factor space. - * @param float $learningRate Controls the step size for updating the latent factors during optimization. - * @param float $regularization Prevents over-fitting by adding a penalty for large parameter values. + * @param int $numFactors determines the dimensionality of the latent factor space + * @param float $learningRate controls the step size for updating the latent factors during optimization + * @param float $regularization prevents over-fitting by adding a penalty for large parameter values * * @since 1.0.0 - */ + */ public function __construct(int $numFactors, float $learningRate, float $regularization) { $this->numFactors = $numFactors; diff --git a/Business/Recommendation/MemoryCF.php b/Business/Recommendation/MemoryCF.php index 972511543..d8d1578d9 100644 --- a/Business/Recommendation/MemoryCF.php +++ b/Business/Recommendation/MemoryCF.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business\Recommendation * @copyright Dennis Eichhorn @@ -150,20 +150,8 @@ final class MemoryCF } /** - * Find potential items/users which are a good match for a user/item. + * Find similar users * - * The algorithm uses the ratings of a a user and tries to find other users who have similar rating behavior and then searches for high rated items that the user doesn't have yet. - * - * This can be used to find items for a specific user (aka might be interested in) or to find users who might be interested in this item - * - * option 1 - find items - * ranking[itemId] = itemRank (how much does specific user like item) - * rankings[userId][itemId] = itemRank - * - * option 2 - find user - * ranking[userId] = itemRank (how much does user like specific item) - * rankings[itemId][userId] = itemRank - * option 1 searches for items, option 2 searches for users * * @param array $ranking Array of item ratings (e.g. products, movies, ...) * @@ -171,7 +159,46 @@ final class MemoryCF * * @since 1.0.0 */ - public function bestMatch(array $ranking, int $size = 10) : array + public function bestMatchUser(array $ranking, int $size = 10) : array + { + $ranking = $this->normalizeRanking([$ranking]); + $ranking = $ranking[0]; + + $euclidean = $this->euclideanDistance($ranking, $this->rankings); + // $cosine = $this->cosineDistance($ranking, $this->rankings); + + \asort($euclidean); + // \asort($cosine); + + $size = \min($size, \count($this->rankings)); + $matches = []; + + $distancePointer = \array_keys($euclidean); + // $anglePointer = \array_keys($cosine); + + // Inspect items of the top n comparable users + for ($i = 0; $i < $size; ++$i) { + // $uId = $i % 2 === 0 ? $distancePointer[$i] : $anglePointer[$i]; + $uId = $distancePointer[$i]; + + if (!\in_array($uId, $matches)) { + $matches[] = $uId; + } + } + + return $matches; + } + + /** + * Find potential users which are a good match for a user. + * + * @param array $ranking Array of item ratings (e.g. products, movies, ...) + * + * @return array + * + * @since 1.0.0 + */ + public function bestMatchItem(array $ranking, int $size = 10) : array { $ranking = $this->normalizeRanking([$ranking]); $ranking = $ranking[0]; @@ -194,13 +221,13 @@ final class MemoryCF $distances = $i % 2 === 0 ? $euclidean : $cosine; foreach ($this->rankings[$uId] as $iId => $_) { - // Item is not already in dataset and not in historic dataset (we are only interested in new) + // Item is already in dataset or in historic dataset (we are only interested in new) if (isset($matches[$iId]) || isset($ranking[$iId])) { continue; } // Calculate the expected rating the user would give based on what the best comparable users did - $matches[$iId] = $this->weightedItemRank($iId, $distances, $this->rankings, $size); + $matches[$iId] = $this->weightedItemRank((string) $iId, $distances, $this->rankings, $size); } } diff --git a/Business/Recommendation/ModelCF.php b/Business/Recommendation/ModelCF.php index e268a302e..fe40209cb 100644 --- a/Business/Recommendation/ModelCF.php +++ b/Business/Recommendation/ModelCF.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business\Recommendation * @copyright Dennis Eichhorn diff --git a/Business/Sales/MarketShareEstimation.php b/Business/Sales/MarketShareEstimation.php index 34e8880d0..0ac1073db 100755 --- a/Business/Sales/MarketShareEstimation.php +++ b/Business/Sales/MarketShareEstimation.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business\Sales * @copyright Dennis Eichhorn diff --git a/Business/Warehouse/OrderSuggestion.php b/Business/Warehouse/OrderSuggestion.php index 22a347a75..2108d385c 100644 --- a/Business/Warehouse/OrderSuggestion.php +++ b/Business/Warehouse/OrderSuggestion.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Business\Sales * @copyright Dennis Eichhorn diff --git a/Config/OptionsInterface.php b/Config/OptionsInterface.php index 472b236b0..767e06dd4 100755 --- a/Config/OptionsInterface.php +++ b/Config/OptionsInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Config * @copyright Dennis Eichhorn diff --git a/Config/OptionsTrait.php b/Config/OptionsTrait.php index a5d46cf67..816dbc8f8 100755 --- a/Config/OptionsTrait.php +++ b/Config/OptionsTrait.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Config * @copyright Dennis Eichhorn diff --git a/Config/SettingsInterface.php b/Config/SettingsInterface.php index 5dcbc046f..1700ae0ad 100755 --- a/Config/SettingsInterface.php +++ b/Config/SettingsInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Config * @copyright Dennis Eichhorn diff --git a/Contract/ArrayableInterface.php b/Contract/ArrayableInterface.php index 485cd97ae..d8376bfc1 100755 --- a/Contract/ArrayableInterface.php +++ b/Contract/ArrayableInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Contract * @copyright Dennis Eichhorn diff --git a/Contract/RenderableInterface.php b/Contract/RenderableInterface.php index 63c4744be..d1e9d4f35 100755 --- a/Contract/RenderableInterface.php +++ b/Contract/RenderableInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Contract * @copyright Dennis Eichhorn diff --git a/Contract/SerializableInterface.php b/Contract/SerializableInterface.php index 2cc1f0fc8..783947d7a 100755 --- a/Contract/SerializableInterface.php +++ b/Contract/SerializableInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Contract * @copyright Dennis Eichhorn diff --git a/Contract/StreamInterface.php b/Contract/StreamInterface.php index 21a64771a..d4ff80c36 100755 --- a/Contract/StreamInterface.php +++ b/Contract/StreamInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Contract * @copyright Dennis Eichhorn diff --git a/DataStorage/Cache/CachePool.php b/DataStorage/Cache/CachePool.php index 9d2a294ec..b3bacc825 100755 --- a/DataStorage/Cache/CachePool.php +++ b/DataStorage/Cache/CachePool.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Cache * @copyright Dennis Eichhorn diff --git a/DataStorage/Cache/CacheStatus.php b/DataStorage/Cache/CacheStatus.php index 24f92f994..c2220de85 100755 --- a/DataStorage/Cache/CacheStatus.php +++ b/DataStorage/Cache/CacheStatus.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Cache * @copyright Dennis Eichhorn diff --git a/DataStorage/Cache/CacheType.php b/DataStorage/Cache/CacheType.php index c930e772f..daafe6a41 100755 --- a/DataStorage/Cache/CacheType.php +++ b/DataStorage/Cache/CacheType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Cache * @copyright Dennis Eichhorn diff --git a/DataStorage/Cache/Connection/CacheValueType.php b/DataStorage/Cache/Connection/CacheValueType.php index 916660973..6f4280c8f 100755 --- a/DataStorage/Cache/Connection/CacheValueType.php +++ b/DataStorage/Cache/Connection/CacheValueType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Cache\Connection * @copyright Dennis Eichhorn diff --git a/DataStorage/Cache/Connection/ConnectionAbstract.php b/DataStorage/Cache/Connection/ConnectionAbstract.php index 88ceda413..74ec92a3b 100755 --- a/DataStorage/Cache/Connection/ConnectionAbstract.php +++ b/DataStorage/Cache/Connection/ConnectionAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Cache\Connection * @copyright Dennis Eichhorn diff --git a/DataStorage/Cache/Connection/ConnectionFactory.php b/DataStorage/Cache/Connection/ConnectionFactory.php index 2540a815d..c08a87b3a 100755 --- a/DataStorage/Cache/Connection/ConnectionFactory.php +++ b/DataStorage/Cache/Connection/ConnectionFactory.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Cache\Connection * @copyright Dennis Eichhorn diff --git a/DataStorage/Cache/Connection/ConnectionInterface.php b/DataStorage/Cache/Connection/ConnectionInterface.php index 8e1dfe551..caaaddc8b 100755 --- a/DataStorage/Cache/Connection/ConnectionInterface.php +++ b/DataStorage/Cache/Connection/ConnectionInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Cache\Connection * @copyright Dennis Eichhorn diff --git a/DataStorage/Cache/Connection/FileCache.php b/DataStorage/Cache/Connection/FileCache.php index 1c4394631..ba36d0871 100755 --- a/DataStorage/Cache/Connection/FileCache.php +++ b/DataStorage/Cache/Connection/FileCache.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Cache\Connection * @copyright Dennis Eichhorn diff --git a/DataStorage/Cache/Connection/MemCached.php b/DataStorage/Cache/Connection/MemCached.php index 16a5e3051..a0cc166aa 100755 --- a/DataStorage/Cache/Connection/MemCached.php +++ b/DataStorage/Cache/Connection/MemCached.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Cache\Connection * @copyright Dennis Eichhorn diff --git a/DataStorage/Cache/Connection/NullCache.php b/DataStorage/Cache/Connection/NullCache.php index 17900cb46..20914972e 100755 --- a/DataStorage/Cache/Connection/NullCache.php +++ b/DataStorage/Cache/Connection/NullCache.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Cache\Connection * @copyright Dennis Eichhorn diff --git a/DataStorage/Cache/Connection/RedisCache.php b/DataStorage/Cache/Connection/RedisCache.php index 2fad593b0..82a153cbe 100755 --- a/DataStorage/Cache/Connection/RedisCache.php +++ b/DataStorage/Cache/Connection/RedisCache.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Cache\Connection * @copyright Dennis Eichhorn diff --git a/DataStorage/Cache/Exception/InvalidConnectionConfigException.php b/DataStorage/Cache/Exception/InvalidConnectionConfigException.php index 109b47a15..e5c19905f 100755 --- a/DataStorage/Cache/Exception/InvalidConnectionConfigException.php +++ b/DataStorage/Cache/Exception/InvalidConnectionConfigException.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Cache\Exception * @copyright Dennis Eichhorn diff --git a/DataStorage/Cookie/CookieJar.php b/DataStorage/Cookie/CookieJar.php index 2e0f022a1..aa0f472b2 100755 --- a/DataStorage/Cookie/CookieJar.php +++ b/DataStorage/Cookie/CookieJar.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Cookie * @copyright Dennis Eichhorn diff --git a/DataStorage/DataMapperInterface.php b/DataStorage/DataMapperInterface.php index 71a3f79b3..bdbe76427 100755 --- a/DataStorage/DataMapperInterface.php +++ b/DataStorage/DataMapperInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage * @copyright Dennis Eichhorn diff --git a/DataStorage/DataStorageConnectionInterface.php b/DataStorage/DataStorageConnectionInterface.php index 4fa4d10ea..9b947298f 100755 --- a/DataStorage/DataStorageConnectionInterface.php +++ b/DataStorage/DataStorageConnectionInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage * @copyright Dennis Eichhorn diff --git a/DataStorage/DataStoragePoolInterface.php b/DataStorage/DataStoragePoolInterface.php index cabc93b84..684afe09d 100755 --- a/DataStorage/DataStoragePoolInterface.php +++ b/DataStorage/DataStoragePoolInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/BuilderAbstract.php b/DataStorage/Database/BuilderAbstract.php index 34a120f64..c7b0ef109 100755 --- a/DataStorage/Database/BuilderAbstract.php +++ b/DataStorage/Database/BuilderAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Connection/ConnectionAbstract.php b/DataStorage/Database/Connection/ConnectionAbstract.php index e28f57c44..c76ba82e0 100755 --- a/DataStorage/Database/Connection/ConnectionAbstract.php +++ b/DataStorage/Database/Connection/ConnectionAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Connection * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Connection/ConnectionFactory.php b/DataStorage/Database/Connection/ConnectionFactory.php index 221638cde..a62ca7f89 100755 --- a/DataStorage/Database/Connection/ConnectionFactory.php +++ b/DataStorage/Database/Connection/ConnectionFactory.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Connection * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Connection/ConnectionInterface.php b/DataStorage/Database/Connection/ConnectionInterface.php index ba5273fba..b85719295 100755 --- a/DataStorage/Database/Connection/ConnectionInterface.php +++ b/DataStorage/Database/Connection/ConnectionInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Connection * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Connection/MysqlConnection.php b/DataStorage/Database/Connection/MysqlConnection.php index a7671ccdc..d20edf105 100755 --- a/DataStorage/Database/Connection/MysqlConnection.php +++ b/DataStorage/Database/Connection/MysqlConnection.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Connection * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Connection/NullConnection.php b/DataStorage/Database/Connection/NullConnection.php index 6194a1671..c15e7d78e 100755 --- a/DataStorage/Database/Connection/NullConnection.php +++ b/DataStorage/Database/Connection/NullConnection.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Connection * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Connection/NullPDO.php b/DataStorage/Database/Connection/NullPDO.php index d8f8adcdd..609ad4bb4 100755 --- a/DataStorage/Database/Connection/NullPDO.php +++ b/DataStorage/Database/Connection/NullPDO.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Connection * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Connection/PostgresConnection.php b/DataStorage/Database/Connection/PostgresConnection.php index 5167db1fb..e356d0032 100755 --- a/DataStorage/Database/Connection/PostgresConnection.php +++ b/DataStorage/Database/Connection/PostgresConnection.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Connection * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Connection/SQLiteConnection.php b/DataStorage/Database/Connection/SQLiteConnection.php index 7a731e129..bd7f01e55 100755 --- a/DataStorage/Database/Connection/SQLiteConnection.php +++ b/DataStorage/Database/Connection/SQLiteConnection.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Connection * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Connection/SqlServerConnection.php b/DataStorage/Database/Connection/SqlServerConnection.php index 8a172c17b..a107c75f5 100755 --- a/DataStorage/Database/Connection/SqlServerConnection.php +++ b/DataStorage/Database/Connection/SqlServerConnection.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Connection * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/DatabasePool.php b/DataStorage/Database/DatabasePool.php index 9dfd6d08a..1f63d496c 100755 --- a/DataStorage/Database/DatabasePool.php +++ b/DataStorage/Database/DatabasePool.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/DatabaseStatus.php b/DataStorage/Database/DatabaseStatus.php index faadbb366..e11d21019 100755 --- a/DataStorage/Database/DatabaseStatus.php +++ b/DataStorage/Database/DatabaseStatus.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/DatabaseType.php b/DataStorage/Database/DatabaseType.php index 38cb77e18..54c24d427 100755 --- a/DataStorage/Database/DatabaseType.php +++ b/DataStorage/Database/DatabaseType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Exception/InvalidConnectionConfigException.php b/DataStorage/Database/Exception/InvalidConnectionConfigException.php index 633e6e0b5..c1717eb30 100755 --- a/DataStorage/Database/Exception/InvalidConnectionConfigException.php +++ b/DataStorage/Database/Exception/InvalidConnectionConfigException.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Exception * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Exception/InvalidDatabaseTypeException.php b/DataStorage/Database/Exception/InvalidDatabaseTypeException.php index d5cdb235b..fd451e6e9 100755 --- a/DataStorage/Database/Exception/InvalidDatabaseTypeException.php +++ b/DataStorage/Database/Exception/InvalidDatabaseTypeException.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Exception * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Exception/InvalidMapperException.php b/DataStorage/Database/Exception/InvalidMapperException.php index 5f086372e..41808dee3 100755 --- a/DataStorage/Database/Exception/InvalidMapperException.php +++ b/DataStorage/Database/Exception/InvalidMapperException.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Exception * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/GrammarAbstract.php b/DataStorage/Database/GrammarAbstract.php index d48fe4c70..f9b6acf63 100755 --- a/DataStorage/Database/GrammarAbstract.php +++ b/DataStorage/Database/GrammarAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Mapper/DataMapperAbstract.php b/DataStorage/Database/Mapper/DataMapperAbstract.php index eb07c3f7d..d2bf67c43 100755 --- a/DataStorage/Database/Mapper/DataMapperAbstract.php +++ b/DataStorage/Database/Mapper/DataMapperAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Mapper * @copyright Dennis Eichhorn @@ -400,7 +400,7 @@ abstract class DataMapperAbstract * @param string $logic Comparison logic (e.g. =, in, ...) * @param string $connector Filter connector (e.g. AND, OR, ...) * - * @return self + * @return static * * @since 1.0.0 */ diff --git a/DataStorage/Database/Mapper/DataMapperFactory.php b/DataStorage/Database/Mapper/DataMapperFactory.php index d91f6fd48..54ed7b7c3 100755 --- a/DataStorage/Database/Mapper/DataMapperFactory.php +++ b/DataStorage/Database/Mapper/DataMapperFactory.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Mapper * @copyright Dennis Eichhorn @@ -443,7 +443,7 @@ class DataMapperFactory * * @since 1.0.0 */ - public static function createNullModel(mixed $id = null) : mixed + public static function createNullModel(mixed $id = null, ?string $member = null) : mixed { $class = empty(static::MODEL) ? \substr(static::class, 0, -6) : static::MODEL; $parts = \explode('\\', $class); @@ -451,7 +451,18 @@ class DataMapperFactory $parts[$c] = 'Null' . $name; $class = \implode('\\', $parts); - return $id !== null ? new $class($id) : new $class(); + $model = $member === null && $id !== null ? new $class($id) : new $class(); + + if ($member !== null) { + // @bug This is just a quick fix, we don't know if "id" is the primary key in case of obj. + if (\is_object($model->{$member})) { + $model->{$member}->id = $id; + } else { + $model->{$member} = $id; + } + } + + return $model; } /** diff --git a/DataStorage/Database/Mapper/DeleteMapper.php b/DataStorage/Database/Mapper/DeleteMapper.php index c27086171..a880c9e19 100755 --- a/DataStorage/Database/Mapper/DeleteMapper.php +++ b/DataStorage/Database/Mapper/DeleteMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Mapper * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Mapper/MapperType.php b/DataStorage/Database/Mapper/MapperType.php index 8fde41f96..5b20815ad 100755 --- a/DataStorage/Database/Mapper/MapperType.php +++ b/DataStorage/Database/Mapper/MapperType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Mapper * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Mapper/ReadMapper.php b/DataStorage/Database/Mapper/ReadMapper.php index 1853796ab..35fd31247 100755 --- a/DataStorage/Database/Mapper/ReadMapper.php +++ b/DataStorage/Database/Mapper/ReadMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Mapper * @copyright Dennis Eichhorn @@ -232,7 +232,7 @@ final class ReadMapper extends DataMapperAbstract return $this->executeGetRaw(...$options); case MapperType::GET_ALL: /** @var null|Builder ...$options */ - return $this->executeGetAll(...$options); + return $this->executeGetArray(...$options); case MapperType::GET_RANDOM: return $this->executeRandom(); case MapperType::COUNT_MODELS: @@ -381,16 +381,6 @@ final class ReadMapper extends DataMapperAbstract $query ??= $this->getQuery(); try { - /* - \phpOMS\Log\FileLogger::getInstance()->info( - \phpOMS\Log\FileLogger::MSG_FULL, [ - 'message' => $query->toSql(), - 'line' => __LINE__, - 'file' => self::class, - ] - ); - */ - $sth = $this->db->con->prepare($query->toSql()); if ($sth === false) { yield []; @@ -427,8 +417,10 @@ final class ReadMapper extends DataMapperAbstract * * @since 1.0.0 */ - public function executeGetAll(?Builder $query = null) : array + public function executeGetArray(?Builder $query = null) : array { + $this->getAll(); + $result = $this->executeGet($query); if (\is_object($result) @@ -449,6 +441,8 @@ final class ReadMapper extends DataMapperAbstract */ public function executeCount() : int { + $this->count(); + $query = $this->getQuery( null, [ @@ -468,6 +462,8 @@ final class ReadMapper extends DataMapperAbstract */ public function executeSum() : int|float { + $this->sum(); + $query = $this->getQuery( null, [ @@ -492,6 +488,8 @@ final class ReadMapper extends DataMapperAbstract */ public function executeExists() : bool { + $this->exists(); + $query = $this->getQuery(null, [1]); return ($query->execute()?->fetchColumn() ?? 0) > 0; @@ -1039,7 +1037,10 @@ final class ReadMapper extends DataMapperAbstract if (\array_key_exists($this->mapper::OWNS_ONE[$member]['external'] . '_d' . $this->depth . $this->joinAlias, $result)) { return isset($this->mapper::OWNS_ONE[$member]['column']) ? $result[$this->mapper::OWNS_ONE[$member]['external'] . '_d' . $this->depth . $this->joinAlias] - : $mapper::createNullModel($result[$this->mapper::OWNS_ONE[$member]['external'] . '_d' . $this->depth . $this->joinAlias]); + : $mapper::createNullModel( + $result[$this->mapper::OWNS_ONE[$member]['external'] . '_d' . $this->depth . $this->joinAlias], + $this->mapper::OWNS_ONE[$member]['by'] ?? null + ); } else { return $default; } @@ -1077,7 +1078,10 @@ final class ReadMapper extends DataMapperAbstract if (\array_key_exists($this->mapper::BELONGS_TO[$member]['external'] . '_d' . $this->depth . $this->joinAlias, $result)) { return isset($this->mapper::BELONGS_TO[$member]['column']) ? $result[$this->mapper::BELONGS_TO[$member]['external'] . '_d' . $this->depth . $this->joinAlias] - : $mapper::createNullModel($result[$this->mapper::BELONGS_TO[$member]['external'] . '_d' . $this->depth . $this->joinAlias]); + : $mapper::createNullModel( + $result[$this->mapper::BELONGS_TO[$member]['external'] . '_d' . $this->depth . $this->joinAlias], + $this->mapper::BELONGS_TO[$member]['by'] ?? null + ); } else { return $default; } @@ -1182,6 +1186,10 @@ final class ReadMapper extends DataMapperAbstract continue; } + if (($many['conditional'] ?? false) && \is_array($objects[$key])) { + $objects[$key] = \reset($objects[$key]); + } + $refProp = $refClass->getProperty($member); $refProp->setValue($objs[$idx], !\is_array($objects[$key]) && ($many['conditional'] ?? false) === false ? [$many['mapper']::getObjectId($objects[$key]) => $objects[$key]] @@ -1194,6 +1202,10 @@ final class ReadMapper extends DataMapperAbstract continue; } + if (($many['conditional'] ?? false) && \is_array($objects[$key])) { + $objects[$key] = \reset($objects[$key]); + } + $objs[$idx]->{$member} = !\is_array($objects[$key]) && ($many['conditional'] ?? false) === false ? [$many['mapper']::getObjectId($objects[$key]) => $objects[$key]] : $objects[$key]; // if conditional === true the obj will be assigned (e.g. hasMany localizations but only one is loaded for the model) @@ -1314,4 +1326,28 @@ final class ReadMapper extends DataMapperAbstract } } } + + /** + * Paginate results + * + * @param string $member Member to use for pagination + * @param null|string $ptype Pagination type (previous/next) + * @param mixed $offset Offset + * + * @return self + * + * @since 1.0.0 + */ + public function paginate(string $member, ?string $ptype, mixed $offset) : self + { + if ($ptype === 'p') { + $this->where($member, $offset ?? 0, '<'); + } elseif ($ptype === 'n') { + $this->where($member, $offset ?? 0, '>'); + } else { + $this->where($member, 0, '>'); + } + + return $this; + } } diff --git a/DataStorage/Database/Mapper/UpdateMapper.php b/DataStorage/Database/Mapper/UpdateMapper.php index a6af226df..a292880b3 100755 --- a/DataStorage/Database/Mapper/UpdateMapper.php +++ b/DataStorage/Database/Mapper/UpdateMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Mapper * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Mapper/WriteMapper.php b/DataStorage/Database/Mapper/WriteMapper.php index 1abbe295a..de51edc61 100755 --- a/DataStorage/Database/Mapper/WriteMapper.php +++ b/DataStorage/Database/Mapper/WriteMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Mapper * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Query/Builder.php b/DataStorage/Database/Query/Builder.php index a1bdcd017..fbd9a403e 100755 --- a/DataStorage/Database/Query/Builder.php +++ b/DataStorage/Database/Query/Builder.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Query * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Query/ColumnName.php b/DataStorage/Database/Query/ColumnName.php index 726bce63f..0af36d41b 100644 --- a/DataStorage/Database/Query/ColumnName.php +++ b/DataStorage/Database/Query/ColumnName.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Query * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Query/Concat.php b/DataStorage/Database/Query/Concat.php index 032b041f6..f0c568430 100644 --- a/DataStorage/Database/Query/Concat.php +++ b/DataStorage/Database/Query/Concat.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Query * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Query/Grammar/Grammar.php b/DataStorage/Database/Query/Grammar/Grammar.php index 5c1b539b4..3293c382f 100755 --- a/DataStorage/Database/Query/Grammar/Grammar.php +++ b/DataStorage/Database/Query/Grammar/Grammar.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Query\Grammar * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Query/Grammar/MysqlGrammar.php b/DataStorage/Database/Query/Grammar/MysqlGrammar.php index be9c66513..f9a6c374f 100755 --- a/DataStorage/Database/Query/Grammar/MysqlGrammar.php +++ b/DataStorage/Database/Query/Grammar/MysqlGrammar.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Query\Grammar * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Query/Grammar/OracleGrammar.php b/DataStorage/Database/Query/Grammar/OracleGrammar.php index abb2467ec..68486eb9d 100755 --- a/DataStorage/Database/Query/Grammar/OracleGrammar.php +++ b/DataStorage/Database/Query/Grammar/OracleGrammar.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Query\Grammar * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Query/Grammar/PostgresGrammar.php b/DataStorage/Database/Query/Grammar/PostgresGrammar.php index 687e1fe76..78361083f 100755 --- a/DataStorage/Database/Query/Grammar/PostgresGrammar.php +++ b/DataStorage/Database/Query/Grammar/PostgresGrammar.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Query\Grammar * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Query/Grammar/SQLiteGrammar.php b/DataStorage/Database/Query/Grammar/SQLiteGrammar.php index 8ef555641..1822cd323 100755 --- a/DataStorage/Database/Query/Grammar/SQLiteGrammar.php +++ b/DataStorage/Database/Query/Grammar/SQLiteGrammar.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Query\Grammar * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Query/Grammar/SqlServerGrammar.php b/DataStorage/Database/Query/Grammar/SqlServerGrammar.php index 600953077..db9d114b9 100755 --- a/DataStorage/Database/Query/Grammar/SqlServerGrammar.php +++ b/DataStorage/Database/Query/Grammar/SqlServerGrammar.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Query\Grammar * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Query/JoinType.php b/DataStorage/Database/Query/JoinType.php index 9b493032b..909ee0862 100755 --- a/DataStorage/Database/Query/JoinType.php +++ b/DataStorage/Database/Query/JoinType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Query * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Query/OrderType.php b/DataStorage/Database/Query/OrderType.php index eebd2c7c6..ac6fabca3 100755 --- a/DataStorage/Database/Query/OrderType.php +++ b/DataStorage/Database/Query/OrderType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Query * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Query/Parameter.php b/DataStorage/Database/Query/Parameter.php index 43fbb57a8..54b15829e 100755 --- a/DataStorage/Database/Query/Parameter.php +++ b/DataStorage/Database/Query/Parameter.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Query * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Query/QueryType.php b/DataStorage/Database/Query/QueryType.php index d7a5ffa83..eef821841 100755 --- a/DataStorage/Database/Query/QueryType.php +++ b/DataStorage/Database/Query/QueryType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Query * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Query/Where.php b/DataStorage/Database/Query/Where.php index 1bc99b588..a007d5d33 100755 --- a/DataStorage/Database/Query/Where.php +++ b/DataStorage/Database/Query/Where.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Query * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/RelationType.php b/DataStorage/Database/RelationType.php index 9434eaa49..bad4f25e0 100755 --- a/DataStorage/Database/RelationType.php +++ b/DataStorage/Database/RelationType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Schema/Builder.php b/DataStorage/Database/Schema/Builder.php index ce3787c55..a868a6989 100755 --- a/DataStorage/Database/Schema/Builder.php +++ b/DataStorage/Database/Schema/Builder.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Schema * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Schema/Field.php b/DataStorage/Database/Schema/Field.php index d8f9f49aa..d83b87766 100755 --- a/DataStorage/Database/Schema/Field.php +++ b/DataStorage/Database/Schema/Field.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Schema * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Schema/Grammar/Grammar.php b/DataStorage/Database/Schema/Grammar/Grammar.php index 79ce26d58..89eac1e19 100755 --- a/DataStorage/Database/Schema/Grammar/Grammar.php +++ b/DataStorage/Database/Schema/Grammar/Grammar.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Schema\Grammar * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Schema/Grammar/MysqlGrammar.php b/DataStorage/Database/Schema/Grammar/MysqlGrammar.php index 9b463e9fe..1c843f549 100755 --- a/DataStorage/Database/Schema/Grammar/MysqlGrammar.php +++ b/DataStorage/Database/Schema/Grammar/MysqlGrammar.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Schema\Grammar * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Schema/Grammar/OracleGrammar.php b/DataStorage/Database/Schema/Grammar/OracleGrammar.php index 0dabcb380..3351c7bee 100755 --- a/DataStorage/Database/Schema/Grammar/OracleGrammar.php +++ b/DataStorage/Database/Schema/Grammar/OracleGrammar.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Schema\Grammar * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Schema/Grammar/PostgresGrammar.php b/DataStorage/Database/Schema/Grammar/PostgresGrammar.php index 09a51c0e6..fbe037563 100755 --- a/DataStorage/Database/Schema/Grammar/PostgresGrammar.php +++ b/DataStorage/Database/Schema/Grammar/PostgresGrammar.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Schema\Grammar * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php b/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php index b2237c005..150810b38 100755 --- a/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php +++ b/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Schema\Grammar * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Schema/Grammar/SqlServerGrammar.php b/DataStorage/Database/Schema/Grammar/SqlServerGrammar.php index a64c838ce..039f23ed8 100755 --- a/DataStorage/Database/Schema/Grammar/SqlServerGrammar.php +++ b/DataStorage/Database/Schema/Grammar/SqlServerGrammar.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Schema\Grammar * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Schema/QueryType.php b/DataStorage/Database/Schema/QueryType.php index 83a46101e..15687586b 100755 --- a/DataStorage/Database/Schema/QueryType.php +++ b/DataStorage/Database/Schema/QueryType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Schema * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/Schema/Table.php b/DataStorage/Database/Schema/Table.php index 4a8c399b7..4b15a7d7c 100755 --- a/DataStorage/Database/Schema/Table.php +++ b/DataStorage/Database/Schema/Table.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Schema * @copyright Dennis Eichhorn diff --git a/DataStorage/Database/SchemaMapper.php b/DataStorage/Database/SchemaMapper.php index 282fab554..bd3a84266 100755 --- a/DataStorage/Database/SchemaMapper.php +++ b/DataStorage/Database/SchemaMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database * @copyright Dennis Eichhorn diff --git a/DataStorage/LockException.php b/DataStorage/LockException.php index abc9fa76f..72a0c1735 100755 --- a/DataStorage/LockException.php +++ b/DataStorage/LockException.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage * @copyright Dennis Eichhorn diff --git a/DataStorage/Session/CacheSessionHandler.php b/DataStorage/Session/CacheSessionHandler.php index 3dd2b8926..11906ae8d 100755 --- a/DataStorage/Session/CacheSessionHandler.php +++ b/DataStorage/Session/CacheSessionHandler.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Session * @copyright Dennis Eichhorn diff --git a/DataStorage/Session/HttpSession.php b/DataStorage/Session/HttpSession.php index b4e704b49..ee652b6f4 100755 --- a/DataStorage/Session/HttpSession.php +++ b/DataStorage/Session/HttpSession.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Session * @copyright Dennis Eichhorn @@ -14,7 +14,6 @@ declare(strict_types=1); namespace phpOMS\DataStorage\Session; -use phpOMS\Log\FileLogger; use phpOMS\Message\RequestAbstract; use phpOMS\Session\JWT; use phpOMS\Uri\UriFactory; @@ -106,8 +105,8 @@ final class HttpSession implements SessionInterface \session_start(); // @codeCoverageIgnoreEnd } else { - FileLogger::getInstance()->warning( - FileLogger::MSG_FULL, [ + \phpOMS\Log\FileLogger::getInstance()->warning( + \phpOMS\Log\FileLogger::MSG_FULL, [ 'message' => 'Headers already sent.', 'line' => __LINE__, 'file' => self::class, diff --git a/DataStorage/Session/JWT.php b/DataStorage/Session/JWT.php index de978f5d7..c70546061 100644 --- a/DataStorage/Session/JWT.php +++ b/DataStorage/Session/JWT.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Auth * @copyright Dennis Eichhorn diff --git a/DataStorage/Session/SessionInterface.php b/DataStorage/Session/SessionInterface.php index 115c9ed43..867e9e291 100755 --- a/DataStorage/Session/SessionInterface.php +++ b/DataStorage/Session/SessionInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Session * @copyright Dennis Eichhorn diff --git a/Dispatcher/Dispatcher.php b/Dispatcher/Dispatcher.php index 1c65a1fd9..a3254f1af 100755 --- a/Dispatcher/Dispatcher.php +++ b/Dispatcher/Dispatcher.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Dispatcher * @copyright Dennis Eichhorn @@ -15,7 +15,6 @@ declare(strict_types=1); namespace phpOMS\Dispatcher; use phpOMS\Application\ApplicationAbstract; -use phpOMS\Autoloader; use phpOMS\System\File\PathException; /** @@ -41,10 +40,10 @@ final class Dispatcher implements DispatcherInterface * * Set in the module manager on module initialization. * - * @var array + * @var array * @since 1.0.0 */ - private array $controllers = []; + public array $controllers = []; /** * Constructor. @@ -81,102 +80,35 @@ final class Dispatcher implements DispatcherInterface // In a different language the Api functions would require a return type // If null is returned (i.e. void functions) these get ignored later in the response renderer as null is not "rendered" if (\is_string($controller)) { - $views += $this->dispatchString($controller, $data); - } elseif (\is_array($controller)) { - $views += $this->dispatchArray($controller, $data); - } else { - $views[] = $this->dispatchClosure($controller, $data); - } + $dispatch = \explode(':', $controller); - return $views; - } + if (($c = \count($dispatch)) === 3) { + /* Handling static functions */ + /** @var \Closure $function */ + $function = $dispatch[0] . '::' . $dispatch[2]; - /** - * Dispatch string. - * - * The dispatcher can dispatch static functions. - * String: `some/namespace/path::myStaticFunction` - * - * Additionally it's also possible to dispatch functions of modules. - * Modules are classes which can get instantiated with `new Class(ApplicationAbstract $app)` - * String: `some/namespace/path:myMethod` - * - * @param string $controller Controller string - * @param null|array $data Data - * - * @return array - * - * @throws PathException this exception is thrown if the function cannot be autoloaded - * @throws \Exception this exception is thrown if the function is not callable - * @throws \UnexpectedValueException this exception is thrown if the controller string is malformed - * - * @since 1.0.0 - */ - private function dispatchString(string $controller, ?array $data = null) : array - { - $views = []; - $dispatch = \explode(':', $controller); - - if (!Autoloader::exists($dispatch[0]) && !isset($this->controllers[$dispatch[0]])) { - throw new PathException($dispatch[0]); - } - - if (($c = \count($dispatch)) === 3) { - /* Handling static functions */ - $function = $dispatch[0] . '::' . $dispatch[2]; - - if (!\is_callable($function)) { - throw new \Exception('Endpoint "'. $function .'" is not callable!'); + $views[$controller] = $data === null ? $function() : $function(...$data); + } elseif ($c === 2) { + $obj = $this->getController($dispatch[0]); + $views[$controller] = $data === null + ? $obj->{$dispatch[1]}() + : $obj->{$dispatch[1]}(...$data); + } + } elseif (\is_array($controller)) { + foreach ($controller as $controllerSingle) { + $views += $data === null + ? $this->dispatch($controllerSingle) + : $this->dispatch($controllerSingle, ...$data); } - - $views[$controller] = $data === null ? $function() : $function(...$data); - } elseif ($c === 2) { - $obj = $this->getController($dispatch[0]); - $views[$controller] = $data === null - ? $obj->{$dispatch[1]}() - : $obj->{$dispatch[1]}(...$data); } else { - throw new \UnexpectedValueException('Unexpected function.'); + $views[] = $data === null + ? $controller($this->app) + : $controller($this->app, ...$data); } return $views; } - /** - * Dispatch array. - * - * @param array $controller Controller string - * @param null|array $data Data - * - * @return array - * - * @since 1.0.0 - */ - private function dispatchArray(array $controller, ?array $data = null) : array - { - $views = []; - foreach ($controller as $controllerSingle) { - $views += $data === null ? $this->dispatch($controllerSingle) : $this->dispatch($controllerSingle, ...$data); - } - - return $views; - } - - /** - * Dispatch closure. - * - * @param Callable $controller Controller string - * @param null|array $data Data - * - * @return mixed - * - * @since 1.0.0 - */ - private function dispatchClosure(callable $controller, ?array $data = null) : mixed - { - return $data === null ? $controller($this->app) : $controller($this->app, ...$data); - } - /** * Dispatch controller. * @@ -196,19 +128,4 @@ final class Dispatcher implements DispatcherInterface return $this->controllers[$controller]; } - - /** - * Set controller by alias. - * - * @param object $controller Controller - * @param string $name Controller string - * - * @return void - * - * @since 1.0.0 - */ - public function set(object $controller, string $name) : void - { - $this->controllers[$name] = $controller; - } } diff --git a/Dispatcher/DispatcherInterface.php b/Dispatcher/DispatcherInterface.php index 772eb6a84..df991694c 100755 --- a/Dispatcher/DispatcherInterface.php +++ b/Dispatcher/DispatcherInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Dispatcher * @copyright Dennis Eichhorn diff --git a/Event/EventManager.php b/Event/EventManager.php index c2ef3977a..5f8e45be4 100755 --- a/Event/EventManager.php +++ b/Event/EventManager.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Event * @copyright Dennis Eichhorn diff --git a/ICAL.txt b/ICLA.txt old mode 100755 new mode 100644 similarity index 100% rename from ICAL.txt rename to ICLA.txt diff --git a/Image/Kernel.php b/Image/Kernel.php index 37da68f93..7d80eb9e3 100755 --- a/Image/Kernel.php +++ b/Image/Kernel.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Image * @copyright Dennis Eichhorn diff --git a/Image/Skew.php b/Image/Skew.php index 6f4936ebc..3ffc81f47 100755 --- a/Image/Skew.php +++ b/Image/Skew.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Image * @copyright Dennis Eichhorn diff --git a/Image/Thresholding.php b/Image/Thresholding.php index 4759c381e..943c193aa 100755 --- a/Image/Thresholding.php +++ b/Image/Thresholding.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Image * @copyright Dennis Eichhorn diff --git a/LICENSE.txt b/LICENSE.txt index 4ba0161ba..02b1ff5c0 100755 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -46,3 +46,7 @@ Unless required by applicable law or agreed to in writing, Licensor provides the 7. Limitation of Liability In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +8. Future Changes + +The Licensor may change the License for future versions as he sees fit. diff --git a/Localization/BaseStringL11n.php b/Localization/BaseStringL11n.php index 326a633b3..b1d937ec7 100755 --- a/Localization/BaseStringL11n.php +++ b/Localization/BaseStringL11n.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/BaseStringL11nType.php b/Localization/BaseStringL11nType.php index 3600e26c1..f77f83b14 100644 --- a/Localization/BaseStringL11nType.php +++ b/Localization/BaseStringL11nType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/Defaults/City.php b/Localization/Defaults/City.php index 953e63425..2178b717a 100755 --- a/Localization/Defaults/City.php +++ b/Localization/Defaults/City.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Defaults * @copyright Dennis Eichhorn diff --git a/Localization/Defaults/CityMapper.php b/Localization/Defaults/CityMapper.php index 211b0bd6d..8bbf91872 100755 --- a/Localization/Defaults/CityMapper.php +++ b/Localization/Defaults/CityMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Defaults * @copyright Dennis Eichhorn @@ -17,7 +17,7 @@ namespace phpOMS\Localization\Defaults; use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; /** - * Mapper class. + * City mapper class. * * @package phpOMS\Localization\Defaults * @license OMS License 2.0 diff --git a/Localization/Defaults/Country.php b/Localization/Defaults/Country.php index 3a9cc9ef6..d688d3508 100755 --- a/Localization/Defaults/Country.php +++ b/Localization/Defaults/Country.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Defaults * @copyright Dennis Eichhorn diff --git a/Localization/Defaults/CountryMapper.php b/Localization/Defaults/CountryMapper.php index 68df85b3b..588223d59 100755 --- a/Localization/Defaults/CountryMapper.php +++ b/Localization/Defaults/CountryMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Defaults * @copyright Dennis Eichhorn @@ -17,7 +17,7 @@ namespace phpOMS\Localization\Defaults; use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; /** - * Mapper class. + * Country mapper class. * * @package phpOMS\Localization\Defaults * @license OMS License 2.0 diff --git a/Localization/Defaults/Currency.php b/Localization/Defaults/Currency.php index 1aa16f62c..97c5939ee 100755 --- a/Localization/Defaults/Currency.php +++ b/Localization/Defaults/Currency.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Defaults * @copyright Dennis Eichhorn diff --git a/Localization/Defaults/CurrencyMapper.php b/Localization/Defaults/CurrencyMapper.php index 61288e282..c685dd766 100755 --- a/Localization/Defaults/CurrencyMapper.php +++ b/Localization/Defaults/CurrencyMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Defaults * @copyright Dennis Eichhorn @@ -17,7 +17,7 @@ namespace phpOMS\Localization\Defaults; use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; /** - * Mapper class. + * Currency mapper class. * * @package phpOMS\Localization\Defaults * @license OMS License 2.0 diff --git a/Localization/Defaults/Definitions/it_IT.json b/Localization/Defaults/Definitions/it_IT.json deleted file mode 100755 index 07227099a..000000000 --- a/Localization/Defaults/Definitions/it_IT.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "language": "it", - "country": "IT", - "currency": { - "code": "EUR", - "position": 0, - "format": "1" - }, - "thousand": ",", - "decimal": ".", - "angle": "deg", - "temperature": "celsius", - "weight": { - "very_light": "mg", - "light": "g", - "medium": "kg", - "heavy": "t", - "very_heavy": "t" - }, - "speed": { - "very_slow": "mps", - "slow": "ms", - "medium": "kph", - "fast": "kph", - "very_fast": "mach", - "sea": "knot" - }, - "length": { - "very_short": "micron", - "short": "mm", - "medium": "cm", - "long": "m", - "very_long": "km", - "sea": "mile" - }, - "area": { - "very_small": "micron", - "small": "mm", - "medium": "cm", - "large": "m", - "very_large": "km" - }, - "volume": { - "very_small": "mul", - "small": "ml", - "medium": "l", - "large": "cm", - "very_large": "m", - "teaspoon": "Metric tsp", - "tablespoon": "Metric tblsp", - "glass": "Metric cup" - }, - "timezone": "Europe/Rome", - "datetime": { - "very_short": "d.m", - "short": "m.y", - "medium": "Y.m.d", - "long": "Y.m.d h:i", - "very_long": "Y.m.d h:i:s" - }, - "precision": { - "very_short": 0, - "short": 1, - "medium": 2, - "long": 3, - "very_long": 5 - } -} \ No newline at end of file diff --git a/Localization/Defaults/Iban.php b/Localization/Defaults/Iban.php index 5ebc3c3de..d4a7b9fb9 100755 --- a/Localization/Defaults/Iban.php +++ b/Localization/Defaults/Iban.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Defaults * @copyright Dennis Eichhorn diff --git a/Localization/Defaults/IbanMapper.php b/Localization/Defaults/IbanMapper.php index b413c36d6..2b58aca03 100755 --- a/Localization/Defaults/IbanMapper.php +++ b/Localization/Defaults/IbanMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Defaults * @copyright Dennis Eichhorn @@ -17,7 +17,7 @@ namespace phpOMS\Localization\Defaults; use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; /** - * Mapper class. + * Iban mapper class. * * @package phpOMS\Localization\Defaults * @license OMS License 2.0 diff --git a/Localization/Defaults/Language.php b/Localization/Defaults/Language.php index 2089e9fbb..59e5922fa 100755 --- a/Localization/Defaults/Language.php +++ b/Localization/Defaults/Language.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Defaults * @copyright Dennis Eichhorn diff --git a/Localization/Defaults/LanguageMapper.php b/Localization/Defaults/LanguageMapper.php index 876aaffbe..16a1c24a0 100755 --- a/Localization/Defaults/LanguageMapper.php +++ b/Localization/Defaults/LanguageMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Defaults * @copyright Dennis Eichhorn @@ -17,7 +17,7 @@ namespace phpOMS\Localization\Defaults; use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; /** - * Mapper class. + * Language mapper class. * * @package phpOMS\Localization\Defaults * @license OMS License 2.0 diff --git a/Localization/Defaults/NullCity.php b/Localization/Defaults/NullCity.php index ce735c0d6..f14faddf9 100755 --- a/Localization/Defaults/NullCity.php +++ b/Localization/Defaults/NullCity.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Defaults * @copyright Dennis Eichhorn diff --git a/Localization/Defaults/NullCountry.php b/Localization/Defaults/NullCountry.php index 918a7a44e..773712565 100755 --- a/Localization/Defaults/NullCountry.php +++ b/Localization/Defaults/NullCountry.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Defaults * @copyright Dennis Eichhorn diff --git a/Localization/Defaults/NullCurrency.php b/Localization/Defaults/NullCurrency.php index 63e54fb33..b925c1816 100755 --- a/Localization/Defaults/NullCurrency.php +++ b/Localization/Defaults/NullCurrency.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Defaults * @copyright Dennis Eichhorn diff --git a/Localization/Defaults/NullIban.php b/Localization/Defaults/NullIban.php index 29edc5d5d..4e0f8df28 100755 --- a/Localization/Defaults/NullIban.php +++ b/Localization/Defaults/NullIban.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Defaults * @copyright Dennis Eichhorn diff --git a/Localization/Defaults/NullLanguage.php b/Localization/Defaults/NullLanguage.php index 9fb9c5965..8afeeabfb 100755 --- a/Localization/Defaults/NullLanguage.php +++ b/Localization/Defaults/NullLanguage.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Defaults * @copyright Dennis Eichhorn diff --git a/Localization/ISO3166CharEnum.php b/Localization/ISO3166CharEnum.php index 3edfc092d..46bb772d5 100755 --- a/Localization/ISO3166CharEnum.php +++ b/Localization/ISO3166CharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/ISO3166NameEnum.php b/Localization/ISO3166NameEnum.php index b7f92f05e..99bd22931 100755 --- a/Localization/ISO3166NameEnum.php +++ b/Localization/ISO3166NameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/ISO3166NumEnum.php b/Localization/ISO3166NumEnum.php index ea040e2d5..2c48653e6 100755 --- a/Localization/ISO3166NumEnum.php +++ b/Localization/ISO3166NumEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/ISO3166Trait.php b/Localization/ISO3166Trait.php index 3e050a500..2443c6664 100644 --- a/Localization/ISO3166Trait.php +++ b/Localization/ISO3166Trait.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/ISO3166TwoEnum.php b/Localization/ISO3166TwoEnum.php index 5bb96e765..740656ff9 100755 --- a/Localization/ISO3166TwoEnum.php +++ b/Localization/ISO3166TwoEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/ISO4217CharEnum.php b/Localization/ISO4217CharEnum.php index 13519f4f3..acceb297e 100755 --- a/Localization/ISO4217CharEnum.php +++ b/Localization/ISO4217CharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/ISO4217DecimalEnum.php b/Localization/ISO4217DecimalEnum.php index bfe602265..6aff9c418 100755 --- a/Localization/ISO4217DecimalEnum.php +++ b/Localization/ISO4217DecimalEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/ISO4217Enum.php b/Localization/ISO4217Enum.php index c5882551b..92a1e1ff9 100755 --- a/Localization/ISO4217Enum.php +++ b/Localization/ISO4217Enum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/ISO4217NumEnum.php b/Localization/ISO4217NumEnum.php index cf582dfbe..e90f95bcb 100755 --- a/Localization/ISO4217NumEnum.php +++ b/Localization/ISO4217NumEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/ISO4217SubUnitEnum.php b/Localization/ISO4217SubUnitEnum.php index 896f47ddf..221f4926a 100755 --- a/Localization/ISO4217SubUnitEnum.php +++ b/Localization/ISO4217SubUnitEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/ISO4217SymbolEnum.php b/Localization/ISO4217SymbolEnum.php index 9df3994a4..6a0b123c1 100755 --- a/Localization/ISO4217SymbolEnum.php +++ b/Localization/ISO4217SymbolEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/ISO4217Trait.php b/Localization/ISO4217Trait.php index 3696542a2..845952619 100644 --- a/Localization/ISO4217Trait.php +++ b/Localization/ISO4217Trait.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/ISO639Enum.php b/Localization/ISO639Enum.php index dbda32fe8..14966ef31 100755 --- a/Localization/ISO639Enum.php +++ b/Localization/ISO639Enum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/ISO639Trait.php b/Localization/ISO639Trait.php index e67b7b541..581c71998 100644 --- a/Localization/ISO639Trait.php +++ b/Localization/ISO639Trait.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/ISO639x1Enum.php b/Localization/ISO639x1Enum.php index 9d96f1a33..09996a09e 100755 --- a/Localization/ISO639x1Enum.php +++ b/Localization/ISO639x1Enum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/ISO639x2Enum.php b/Localization/ISO639x2Enum.php index 97daa23e3..1321f326d 100755 --- a/Localization/ISO639x2Enum.php +++ b/Localization/ISO639x2Enum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/ISO8601EnumArray.php b/Localization/ISO8601EnumArray.php index e754c250b..4835334c6 100755 --- a/Localization/ISO8601EnumArray.php +++ b/Localization/ISO8601EnumArray.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/L11nManager.php b/Localization/L11nManager.php index fd57eced6..25e9d2261 100755 --- a/Localization/L11nManager.php +++ b/Localization/L11nManager.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn @@ -15,7 +15,6 @@ declare(strict_types=1); namespace phpOMS\Localization; use phpOMS\Autoloader; -use phpOMS\Log\FileLogger; use phpOMS\Module\ModuleAbstract; use phpOMS\Stdlib\Base\FloatInt; @@ -176,7 +175,7 @@ final class L11nManager $this->loadLanguage($code, $module, $class::getLocalization($code, $theme)); } catch (\Throwable $_) { // @codeCoverageIgnoreStart - FileLogger::getInstance()->warning(FileLogger::MSG_FULL, [ + \phpOMS\Log\FileLogger::getInstance()->warning(\phpOMS\Log\FileLogger::MSG_FULL, [ 'message' => 'Undefined translation for \'' . $code . '/' . $module . '/' . $translation . '\'.', ]); // @codeCoverageIgnoreEnd diff --git a/Localization/LanguageDetection/Language.php b/Localization/LanguageDetection/Language.php index d9b253831..0eae15747 100755 --- a/Localization/LanguageDetection/Language.php +++ b/Localization/LanguageDetection/Language.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\LanguageDetection * @author Patrick Schur diff --git a/Localization/LanguageDetection/LanguageResult.php b/Localization/LanguageDetection/LanguageResult.php index 643b76884..82225a0e1 100755 --- a/Localization/LanguageDetection/LanguageResult.php +++ b/Localization/LanguageDetection/LanguageResult.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\LanguageDetection * @author Patrick Schur diff --git a/Localization/LanguageDetection/NgramParser.php b/Localization/LanguageDetection/NgramParser.php index 20568df8d..4097a4893 100755 --- a/Localization/LanguageDetection/NgramParser.php +++ b/Localization/LanguageDetection/NgramParser.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\LanguageDetection * @author Patrick Schur diff --git a/Localization/LanguageDetection/Tokenizer/WhitespaceTokenizer.php b/Localization/LanguageDetection/Tokenizer/WhitespaceTokenizer.php index 6b80c7055..f0bcc4372 100755 --- a/Localization/LanguageDetection/Tokenizer/WhitespaceTokenizer.php +++ b/Localization/LanguageDetection/Tokenizer/WhitespaceTokenizer.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\LanguageDetection\Tokenizer * @author Patrick Schur diff --git a/Localization/LanguageDetection/Trainer.php b/Localization/LanguageDetection/Trainer.php index ba480fa39..e11cc24a8 100755 --- a/Localization/LanguageDetection/Trainer.php +++ b/Localization/LanguageDetection/Trainer.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\LanguageDetection * @author Patrick Schur diff --git a/Localization/LegalEntityType.php b/Localization/LegalEntityType.php index 4cbdb2e7c..9c9b04222 100755 --- a/Localization/LegalEntityType.php +++ b/Localization/LegalEntityType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/Localization.php b/Localization/Localization.php index eb1b0a528..a4330f36a 100755 --- a/Localization/Localization.php +++ b/Localization/Localization.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/Money.php b/Localization/Money.php index d70c19f77..d617e9b82 100755 --- a/Localization/Money.php +++ b/Localization/Money.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/NullBaseStringL11n.php b/Localization/NullBaseStringL11n.php index 9bf1a1166..863b7bbb3 100755 --- a/Localization/NullBaseStringL11n.php +++ b/Localization/NullBaseStringL11n.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/NullBaseStringL11nType.php b/Localization/NullBaseStringL11nType.php index 47364917d..4b593b050 100644 --- a/Localization/NullBaseStringL11nType.php +++ b/Localization/NullBaseStringL11nType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/NullLocalization.php b/Localization/NullLocalization.php index 293f61399..cd6239caf 100755 --- a/Localization/NullLocalization.php +++ b/Localization/NullLocalization.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/PhoneEnum.php b/Localization/PhoneEnum.php index b1f5c8f98..113b56c02 100755 --- a/Localization/PhoneEnum.php +++ b/Localization/PhoneEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/RegionEnum.php b/Localization/RegionEnum.php index 65b1133dc..78e38426d 100644 --- a/Localization/RegionEnum.php +++ b/Localization/RegionEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoATCharEnum.php b/Localization/Subregion/ISO3166TwoATCharEnum.php index 7dd9201b5..7d91653a7 100644 --- a/Localization/Subregion/ISO3166TwoATCharEnum.php +++ b/Localization/Subregion/ISO3166TwoATCharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoATNameEnum.php b/Localization/Subregion/ISO3166TwoATNameEnum.php index b5c97e000..4c845d16d 100644 --- a/Localization/Subregion/ISO3166TwoATNameEnum.php +++ b/Localization/Subregion/ISO3166TwoATNameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoBRCharEnum.php b/Localization/Subregion/ISO3166TwoBRCharEnum.php index f5fb6b392..53c023399 100644 --- a/Localization/Subregion/ISO3166TwoBRCharEnum.php +++ b/Localization/Subregion/ISO3166TwoBRCharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoBRNameEnum.php b/Localization/Subregion/ISO3166TwoBRNameEnum.php index d0d03158c..be540a047 100644 --- a/Localization/Subregion/ISO3166TwoBRNameEnum.php +++ b/Localization/Subregion/ISO3166TwoBRNameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoCACharEnum.php b/Localization/Subregion/ISO3166TwoCACharEnum.php index d90e3669a..51f28ed30 100644 --- a/Localization/Subregion/ISO3166TwoCACharEnum.php +++ b/Localization/Subregion/ISO3166TwoCACharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoCANameEnum.php b/Localization/Subregion/ISO3166TwoCANameEnum.php index 2ade3d4dc..b07c9c2b6 100644 --- a/Localization/Subregion/ISO3166TwoCANameEnum.php +++ b/Localization/Subregion/ISO3166TwoCANameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoCHCharEnum.php b/Localization/Subregion/ISO3166TwoCHCharEnum.php index 5ed45fb3f..845daeab9 100644 --- a/Localization/Subregion/ISO3166TwoCHCharEnum.php +++ b/Localization/Subregion/ISO3166TwoCHCharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoCHNameEnum.php b/Localization/Subregion/ISO3166TwoCHNameEnum.php index 33c0222b5..5a85fa9ff 100644 --- a/Localization/Subregion/ISO3166TwoCHNameEnum.php +++ b/Localization/Subregion/ISO3166TwoCHNameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoCNCharEnum.php b/Localization/Subregion/ISO3166TwoCNCharEnum.php index 9771a87e8..9fc641bca 100644 --- a/Localization/Subregion/ISO3166TwoCNCharEnum.php +++ b/Localization/Subregion/ISO3166TwoCNCharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoCNNameEnum.php b/Localization/Subregion/ISO3166TwoCNNameEnum.php index 135ccc719..e7d24e73d 100644 --- a/Localization/Subregion/ISO3166TwoCNNameEnum.php +++ b/Localization/Subregion/ISO3166TwoCNNameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoCZCharEnum.php b/Localization/Subregion/ISO3166TwoCZCharEnum.php index 40da72a36..6bbf4b3e7 100644 --- a/Localization/Subregion/ISO3166TwoCZCharEnum.php +++ b/Localization/Subregion/ISO3166TwoCZCharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoCZNameEnum.php b/Localization/Subregion/ISO3166TwoCZNameEnum.php index fd1c95d02..d8bb480ce 100644 --- a/Localization/Subregion/ISO3166TwoCZNameEnum.php +++ b/Localization/Subregion/ISO3166TwoCZNameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoDECharEnum.php b/Localization/Subregion/ISO3166TwoDECharEnum.php index 5e64990b4..e57530233 100644 --- a/Localization/Subregion/ISO3166TwoDECharEnum.php +++ b/Localization/Subregion/ISO3166TwoDECharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoDENameEnum.php b/Localization/Subregion/ISO3166TwoDENameEnum.php index 12c32da8b..3abcdf475 100644 --- a/Localization/Subregion/ISO3166TwoDENameEnum.php +++ b/Localization/Subregion/ISO3166TwoDENameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoDKCharEnum.php b/Localization/Subregion/ISO3166TwoDKCharEnum.php index 054841f46..7f6c34ce8 100644 --- a/Localization/Subregion/ISO3166TwoDKCharEnum.php +++ b/Localization/Subregion/ISO3166TwoDKCharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoDKNameEnum.php b/Localization/Subregion/ISO3166TwoDKNameEnum.php index fd5da6180..f9c2b2fd1 100644 --- a/Localization/Subregion/ISO3166TwoDKNameEnum.php +++ b/Localization/Subregion/ISO3166TwoDKNameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoFRCharEnum.php b/Localization/Subregion/ISO3166TwoFRCharEnum.php index 809c48b40..dee1afd2f 100644 --- a/Localization/Subregion/ISO3166TwoFRCharEnum.php +++ b/Localization/Subregion/ISO3166TwoFRCharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoFRNameEnum.php b/Localization/Subregion/ISO3166TwoFRNameEnum.php index c8003b7c9..a559372a1 100644 --- a/Localization/Subregion/ISO3166TwoFRNameEnum.php +++ b/Localization/Subregion/ISO3166TwoFRNameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoGBCharEnum.php b/Localization/Subregion/ISO3166TwoGBCharEnum.php index a0225817e..e847b6289 100644 --- a/Localization/Subregion/ISO3166TwoGBCharEnum.php +++ b/Localization/Subregion/ISO3166TwoGBCharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoGBNameEnum.php b/Localization/Subregion/ISO3166TwoGBNameEnum.php index 63d3c37f9..a78fa0fe5 100644 --- a/Localization/Subregion/ISO3166TwoGBNameEnum.php +++ b/Localization/Subregion/ISO3166TwoGBNameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoINCharEnum.php b/Localization/Subregion/ISO3166TwoINCharEnum.php index 98700b09b..aae077d52 100644 --- a/Localization/Subregion/ISO3166TwoINCharEnum.php +++ b/Localization/Subregion/ISO3166TwoINCharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoINNameEnum.php b/Localization/Subregion/ISO3166TwoINNameEnum.php index fe6416e33..aaae355fa 100644 --- a/Localization/Subregion/ISO3166TwoINNameEnum.php +++ b/Localization/Subregion/ISO3166TwoINNameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoITCharEnum.php b/Localization/Subregion/ISO3166TwoITCharEnum.php index 19d2726a6..e8062e29d 100644 --- a/Localization/Subregion/ISO3166TwoITCharEnum.php +++ b/Localization/Subregion/ISO3166TwoITCharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoITNameEnum.php b/Localization/Subregion/ISO3166TwoITNameEnum.php index ad034576e..bee81ee4d 100644 --- a/Localization/Subregion/ISO3166TwoITNameEnum.php +++ b/Localization/Subregion/ISO3166TwoITNameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoJPCharEnum.php b/Localization/Subregion/ISO3166TwoJPCharEnum.php index 8813f9b54..9ef3c2680 100644 --- a/Localization/Subregion/ISO3166TwoJPCharEnum.php +++ b/Localization/Subregion/ISO3166TwoJPCharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoJPNameEnum.php b/Localization/Subregion/ISO3166TwoJPNameEnum.php index 17252aedf..106709c92 100644 --- a/Localization/Subregion/ISO3166TwoJPNameEnum.php +++ b/Localization/Subregion/ISO3166TwoJPNameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoNLCharEnum.php b/Localization/Subregion/ISO3166TwoNLCharEnum.php index 66c8ddfe3..795603ef7 100644 --- a/Localization/Subregion/ISO3166TwoNLCharEnum.php +++ b/Localization/Subregion/ISO3166TwoNLCharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoNLNameEnum.php b/Localization/Subregion/ISO3166TwoNLNameEnum.php index 8544cbfa0..7832a0531 100644 --- a/Localization/Subregion/ISO3166TwoNLNameEnum.php +++ b/Localization/Subregion/ISO3166TwoNLNameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoNOCharEnum.php b/Localization/Subregion/ISO3166TwoNOCharEnum.php index 9dcc8ded0..c97a6f84f 100644 --- a/Localization/Subregion/ISO3166TwoNOCharEnum.php +++ b/Localization/Subregion/ISO3166TwoNOCharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoNONameEnum.php b/Localization/Subregion/ISO3166TwoNONameEnum.php index fa5fdf814..349f81784 100644 --- a/Localization/Subregion/ISO3166TwoNONameEnum.php +++ b/Localization/Subregion/ISO3166TwoNONameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoPLCharEnum.php b/Localization/Subregion/ISO3166TwoPLCharEnum.php index d2591544f..e95f4c4ee 100644 --- a/Localization/Subregion/ISO3166TwoPLCharEnum.php +++ b/Localization/Subregion/ISO3166TwoPLCharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoPLNameEnum.php b/Localization/Subregion/ISO3166TwoPLNameEnum.php index ceb07942b..41d4f7e75 100644 --- a/Localization/Subregion/ISO3166TwoPLNameEnum.php +++ b/Localization/Subregion/ISO3166TwoPLNameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoSECharEnum.php b/Localization/Subregion/ISO3166TwoSECharEnum.php index fd3a495ec..0c2d3cfab 100644 --- a/Localization/Subregion/ISO3166TwoSECharEnum.php +++ b/Localization/Subregion/ISO3166TwoSECharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoSENameEnum.php b/Localization/Subregion/ISO3166TwoSENameEnum.php index 806ad2d6d..477ec1ae2 100644 --- a/Localization/Subregion/ISO3166TwoSENameEnum.php +++ b/Localization/Subregion/ISO3166TwoSENameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoTRCharEnum.php b/Localization/Subregion/ISO3166TwoTRCharEnum.php index b813f7919..d994b0733 100644 --- a/Localization/Subregion/ISO3166TwoTRCharEnum.php +++ b/Localization/Subregion/ISO3166TwoTRCharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoTRNameEnum.php b/Localization/Subregion/ISO3166TwoTRNameEnum.php index 256d7a741..a4b056cd4 100644 --- a/Localization/Subregion/ISO3166TwoTRNameEnum.php +++ b/Localization/Subregion/ISO3166TwoTRNameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoUSCharEnum.php b/Localization/Subregion/ISO3166TwoUSCharEnum.php index 45b2cefd9..4a2670e15 100644 --- a/Localization/Subregion/ISO3166TwoUSCharEnum.php +++ b/Localization/Subregion/ISO3166TwoUSCharEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/Subregion/ISO3166TwoUSNameEnum.php b/Localization/Subregion/ISO3166TwoUSNameEnum.php index 576342d3b..442914077 100644 --- a/Localization/Subregion/ISO3166TwoUSNameEnum.php +++ b/Localization/Subregion/ISO3166TwoUSNameEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization\Subregion * @copyright Dennis Eichhorn diff --git a/Localization/TimeZoneEnumArray.php b/Localization/TimeZoneEnumArray.php index 6b7a43503..993a673cc 100755 --- a/Localization/TimeZoneEnumArray.php +++ b/Localization/TimeZoneEnumArray.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Localization * @copyright Dennis Eichhorn diff --git a/Log/FileLogger.php b/Log/FileLogger.php index b35639d71..81f797cc8 100755 --- a/Log/FileLogger.php +++ b/Log/FileLogger.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Log * @copyright Dennis Eichhorn diff --git a/Log/LogLevel.php b/Log/LogLevel.php index 682350fd6..10804e1df 100755 --- a/Log/LogLevel.php +++ b/Log/LogLevel.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Log * @copyright Dennis Eichhorn diff --git a/Log/LoggerInterface.php b/Log/LoggerInterface.php index 4be2aae43..c667d8057 100755 --- a/Log/LoggerInterface.php +++ b/Log/LoggerInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Log * @copyright Dennis Eichhorn diff --git a/Math/Exception/ZeroDivisionException.php b/Math/Exception/ZeroDivisionException.php index 206e4a8c2..e1645cda8 100755 --- a/Math/Exception/ZeroDivisionException.php +++ b/Math/Exception/ZeroDivisionException.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Exception * @copyright Dennis Eichhorn diff --git a/Math/Functions/Algebra.php b/Math/Functions/Algebra.php index a36841914..5d3cf52d6 100644 --- a/Math/Functions/Algebra.php +++ b/Math/Functions/Algebra.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Functions * @copyright Dennis Eichhorn diff --git a/Math/Functions/Beta.php b/Math/Functions/Beta.php index 23c05fd4d..cdd893721 100755 --- a/Math/Functions/Beta.php +++ b/Math/Functions/Beta.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Functions * @copyright Dennis Eichhorn diff --git a/Math/Functions/Fibonacci.php b/Math/Functions/Fibonacci.php index b56814e8f..41a39fc9d 100755 --- a/Math/Functions/Fibonacci.php +++ b/Math/Functions/Fibonacci.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Functions * @copyright Dennis Eichhorn diff --git a/Math/Functions/Functions.php b/Math/Functions/Functions.php index ff087f23f..0a14177f7 100755 --- a/Math/Functions/Functions.php +++ b/Math/Functions/Functions.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Functions * @copyright Dennis Eichhorn diff --git a/Math/Functions/Gamma.php b/Math/Functions/Gamma.php index 9858af4d2..bfb48d6aa 100755 --- a/Math/Functions/Gamma.php +++ b/Math/Functions/Gamma.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Functions * @copyright Dennis Eichhorn diff --git a/Math/Geometry/ConvexHull/GrahamScan.php b/Math/Geometry/ConvexHull/GrahamScan.php index 24dbab119..1909af8db 100644 --- a/Math/Geometry/ConvexHull/GrahamScan.php +++ b/Math/Geometry/ConvexHull/GrahamScan.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Geometry\ConvexHull * @copyright Dennis Eichhorn diff --git a/Math/Geometry/ConvexHull/MonotoneChain.php b/Math/Geometry/ConvexHull/MonotoneChain.php index 2cc2c4a1d..b73c2351d 100755 --- a/Math/Geometry/ConvexHull/MonotoneChain.php +++ b/Math/Geometry/ConvexHull/MonotoneChain.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Geometry\ConvexHull * @copyright Dennis Eichhorn diff --git a/Math/Geometry/Shape/D2/Circle.php b/Math/Geometry/Shape/D2/Circle.php index 1b77b76a1..e9f75107a 100755 --- a/Math/Geometry/Shape/D2/Circle.php +++ b/Math/Geometry/Shape/D2/Circle.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Geometry\Shape\D2 * @copyright Dennis Eichhorn diff --git a/Math/Geometry/Shape/D2/D2ShapeInterface.php b/Math/Geometry/Shape/D2/D2ShapeInterface.php index 8e9d351ba..38841d9f9 100755 --- a/Math/Geometry/Shape/D2/D2ShapeInterface.php +++ b/Math/Geometry/Shape/D2/D2ShapeInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Geometry\Shape\D2 * @copyright Dennis Eichhorn diff --git a/Math/Geometry/Shape/D2/Ellipse.php b/Math/Geometry/Shape/D2/Ellipse.php index 5e13daf80..744238315 100755 --- a/Math/Geometry/Shape/D2/Ellipse.php +++ b/Math/Geometry/Shape/D2/Ellipse.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Geometry\Shape\D2 * @copyright Dennis Eichhorn diff --git a/Math/Geometry/Shape/D2/Polygon.php b/Math/Geometry/Shape/D2/Polygon.php index 74a4065c0..51c20129c 100755 --- a/Math/Geometry/Shape/D2/Polygon.php +++ b/Math/Geometry/Shape/D2/Polygon.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Geometry\Shape\D2 * @copyright Dennis Eichhorn diff --git a/Math/Geometry/Shape/D2/Quadrilateral.php b/Math/Geometry/Shape/D2/Quadrilateral.php index a0f8ce40c..0508bceb4 100755 --- a/Math/Geometry/Shape/D2/Quadrilateral.php +++ b/Math/Geometry/Shape/D2/Quadrilateral.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package TBD * @copyright Dennis Eichhorn diff --git a/Math/Geometry/Shape/D2/Rectangle.php b/Math/Geometry/Shape/D2/Rectangle.php index b51dd3dbc..71a91aece 100755 --- a/Math/Geometry/Shape/D2/Rectangle.php +++ b/Math/Geometry/Shape/D2/Rectangle.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Geometry\Shape\D2 * @copyright Dennis Eichhorn diff --git a/Math/Geometry/Shape/D2/Trapezoid.php b/Math/Geometry/Shape/D2/Trapezoid.php index 1ec6d866b..cae080dfe 100755 --- a/Math/Geometry/Shape/D2/Trapezoid.php +++ b/Math/Geometry/Shape/D2/Trapezoid.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Geometry\Shape\D2 * @copyright Dennis Eichhorn diff --git a/Math/Geometry/Shape/D2/Triangle.php b/Math/Geometry/Shape/D2/Triangle.php index 112934944..3308aa30d 100755 --- a/Math/Geometry/Shape/D2/Triangle.php +++ b/Math/Geometry/Shape/D2/Triangle.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Geometry\Shape\D2 * @copyright Dennis Eichhorn diff --git a/Math/Geometry/Shape/D3/Cone.php b/Math/Geometry/Shape/D3/Cone.php index 935bd1ac8..efd56535a 100755 --- a/Math/Geometry/Shape/D3/Cone.php +++ b/Math/Geometry/Shape/D3/Cone.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Geometry\Shape\D3 * @copyright Dennis Eichhorn diff --git a/Math/Geometry/Shape/D3/Cuboid.php b/Math/Geometry/Shape/D3/Cuboid.php index 2361d9195..f711ca0d7 100755 --- a/Math/Geometry/Shape/D3/Cuboid.php +++ b/Math/Geometry/Shape/D3/Cuboid.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Geometry\Shape\D3 * @copyright Dennis Eichhorn diff --git a/Math/Geometry/Shape/D3/Cylinder.php b/Math/Geometry/Shape/D3/Cylinder.php index 4ea37ef6e..bfa9b2355 100755 --- a/Math/Geometry/Shape/D3/Cylinder.php +++ b/Math/Geometry/Shape/D3/Cylinder.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Geometry\Shape\D3 * @copyright Dennis Eichhorn diff --git a/Math/Geometry/Shape/D3/D3ShapeInterface.php b/Math/Geometry/Shape/D3/D3ShapeInterface.php index 788f9d7fa..8d8d61152 100755 --- a/Math/Geometry/Shape/D3/D3ShapeInterface.php +++ b/Math/Geometry/Shape/D3/D3ShapeInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Geometry\Shape\D3 * @copyright Dennis Eichhorn diff --git a/Math/Geometry/Shape/D3/Prism.php b/Math/Geometry/Shape/D3/Prism.php index c90864593..60bb1eebc 100755 --- a/Math/Geometry/Shape/D3/Prism.php +++ b/Math/Geometry/Shape/D3/Prism.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Geometry\Shape\D3 * @copyright Dennis Eichhorn diff --git a/Math/Geometry/Shape/D3/RectangularPyramid.php b/Math/Geometry/Shape/D3/RectangularPyramid.php index 3016d50a9..aabd3451d 100755 --- a/Math/Geometry/Shape/D3/RectangularPyramid.php +++ b/Math/Geometry/Shape/D3/RectangularPyramid.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Geometry\Shape\D3 * @copyright Dennis Eichhorn diff --git a/Math/Geometry/Shape/D3/Sphere.php b/Math/Geometry/Shape/D3/Sphere.php index b7a958572..3ddb8f5a6 100755 --- a/Math/Geometry/Shape/D3/Sphere.php +++ b/Math/Geometry/Shape/D3/Sphere.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Geometry\Shape\D3 * @copyright Dennis Eichhorn diff --git a/Math/Geometry/Shape/D3/Tetrahedron.php b/Math/Geometry/Shape/D3/Tetrahedron.php index a546fa268..8b28716b0 100755 --- a/Math/Geometry/Shape/D3/Tetrahedron.php +++ b/Math/Geometry/Shape/D3/Tetrahedron.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Geometry\Shape\D3 * @copyright Dennis Eichhorn diff --git a/Math/Geometry/Shape/ShapeInterface.php b/Math/Geometry/Shape/ShapeInterface.php index 613ccad97..6fc812929 100755 --- a/Math/Geometry/Shape/ShapeInterface.php +++ b/Math/Geometry/Shape/ShapeInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Geometry\Shape * @copyright Dennis Eichhorn diff --git a/Math/Matrix/CholeskyDecomposition.php b/Math/Matrix/CholeskyDecomposition.php index d872a5317..789efdec3 100755 --- a/Math/Matrix/CholeskyDecomposition.php +++ b/Math/Matrix/CholeskyDecomposition.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Matrix * @copyright Dennis Eichhorn diff --git a/Math/Matrix/EigenvalueDecomposition.php b/Math/Matrix/EigenvalueDecomposition.php index c12b9187e..b136f1b2f 100755 --- a/Math/Matrix/EigenvalueDecomposition.php +++ b/Math/Matrix/EigenvalueDecomposition.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Matrix * @copyright Dennis Eichhorn diff --git a/Math/Matrix/Exception/InvalidDimensionException.php b/Math/Matrix/Exception/InvalidDimensionException.php index 69006f043..d8751696e 100755 --- a/Math/Matrix/Exception/InvalidDimensionException.php +++ b/Math/Matrix/Exception/InvalidDimensionException.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Matrix\Exception * @copyright Dennis Eichhorn diff --git a/Math/Matrix/IdentityMatrix.php b/Math/Matrix/IdentityMatrix.php index d581c0d0e..2257c0c74 100755 --- a/Math/Matrix/IdentityMatrix.php +++ b/Math/Matrix/IdentityMatrix.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Matrix * @copyright Dennis Eichhorn diff --git a/Math/Matrix/LUDecomposition.php b/Math/Matrix/LUDecomposition.php index c336d3e90..f4a0f80de 100755 --- a/Math/Matrix/LUDecomposition.php +++ b/Math/Matrix/LUDecomposition.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Matrix * @copyright Dennis Eichhorn diff --git a/Math/Matrix/Matrix.php b/Math/Matrix/Matrix.php index 2ffb8d839..122a2171b 100755 --- a/Math/Matrix/Matrix.php +++ b/Math/Matrix/Matrix.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Matrix * @copyright Dennis Eichhorn @@ -852,8 +852,8 @@ class Matrix implements \ArrayAccess, \Iterator } $eig = new EigenvalueDecomposition($this); - $v = $eig->getV(); - $d = $eig->getD(); + $v = $eig->getV(); + $d = $eig->getD(); $vInv = $v->inverse(); diff --git a/Math/Matrix/QRDecomposition.php b/Math/Matrix/QRDecomposition.php index 167ffeac9..ddcf4e09b 100755 --- a/Math/Matrix/QRDecomposition.php +++ b/Math/Matrix/QRDecomposition.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Matrix * @copyright Dennis Eichhorn diff --git a/Math/Matrix/Vector.php b/Math/Matrix/Vector.php index 2ee9e3cf0..9c6f06aad 100755 --- a/Math/Matrix/Vector.php +++ b/Math/Matrix/Vector.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Matrix * @copyright Dennis Eichhorn diff --git a/Math/Number/Complex.php b/Math/Number/Complex.php index 51f139b59..e6c76a9b4 100755 --- a/Math/Number/Complex.php +++ b/Math/Number/Complex.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Number * @copyright Dennis Eichhorn diff --git a/Math/Number/Integer.php b/Math/Number/Integer.php index 3aef486f3..fff19e851 100755 --- a/Math/Number/Integer.php +++ b/Math/Number/Integer.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Number * @copyright Dennis Eichhorn diff --git a/Math/Number/Natural.php b/Math/Number/Natural.php index b5b837d58..a26840eec 100755 --- a/Math/Number/Natural.php +++ b/Math/Number/Natural.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Number * @copyright Dennis Eichhorn diff --git a/Math/Number/NumberType.php b/Math/Number/NumberType.php index c8faa4bac..3e64aaf9e 100755 --- a/Math/Number/NumberType.php +++ b/Math/Number/NumberType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Number * @copyright Dennis Eichhorn diff --git a/Math/Number/Numbers.php b/Math/Number/Numbers.php index bcb1e3338..446ffb60d 100755 --- a/Math/Number/Numbers.php +++ b/Math/Number/Numbers.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Number * @copyright Dennis Eichhorn diff --git a/Math/Number/OperationInterface.php b/Math/Number/OperationInterface.php index 2604cf276..b7b35c42d 100755 --- a/Math/Number/OperationInterface.php +++ b/Math/Number/OperationInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Number * @copyright Dennis Eichhorn diff --git a/Math/Number/Prime.php b/Math/Number/Prime.php index 6c2e0dac4..606a9974e 100755 --- a/Math/Number/Prime.php +++ b/Math/Number/Prime.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Number * @copyright Dennis Eichhorn diff --git a/Math/Numerics/Integration.php b/Math/Numerics/Integration.php index 352387d44..a0a714bd9 100755 --- a/Math/Numerics/Integration.php +++ b/Math/Numerics/Integration.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Numerics * @copyright Dennis Eichhorn diff --git a/Math/Numerics/Interpolation/CubicSplineInterpolation.php b/Math/Numerics/Interpolation/CubicSplineInterpolation.php index 7e6f609ba..72852c164 100755 --- a/Math/Numerics/Interpolation/CubicSplineInterpolation.php +++ b/Math/Numerics/Interpolation/CubicSplineInterpolation.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Numerics\Interpolation * @copyright Dennis Eichhorn diff --git a/Math/Numerics/Interpolation/DerivativeType.php b/Math/Numerics/Interpolation/DerivativeType.php index 9a6ad0ab9..cc069a158 100755 --- a/Math/Numerics/Interpolation/DerivativeType.php +++ b/Math/Numerics/Interpolation/DerivativeType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Numerics\Interpolation * @copyright Dennis Eichhorn diff --git a/Math/Numerics/Interpolation/InterpolationInterface.php b/Math/Numerics/Interpolation/InterpolationInterface.php index 36ea76caf..01f42402f 100755 --- a/Math/Numerics/Interpolation/InterpolationInterface.php +++ b/Math/Numerics/Interpolation/InterpolationInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Numerics\Interpolation * @copyright Dennis Eichhorn diff --git a/Math/Numerics/Interpolation/LagrangeInterpolation.php b/Math/Numerics/Interpolation/LagrangeInterpolation.php index 70b9a31cd..2ef7ba13c 100755 --- a/Math/Numerics/Interpolation/LagrangeInterpolation.php +++ b/Math/Numerics/Interpolation/LagrangeInterpolation.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Numerics\Interpolation * @copyright Dennis Eichhorn diff --git a/Math/Numerics/Interpolation/LinearInterpolation.php b/Math/Numerics/Interpolation/LinearInterpolation.php index 0ec184965..447ecf933 100755 --- a/Math/Numerics/Interpolation/LinearInterpolation.php +++ b/Math/Numerics/Interpolation/LinearInterpolation.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Numerics\Interpolation * @copyright Dennis Eichhorn diff --git a/Math/Optimization/Simplex.php b/Math/Optimization/Simplex.php index 91d497f6d..2efb08a78 100644 --- a/Math/Optimization/Simplex.php +++ b/Math/Optimization/Simplex.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Optimization * @copyright Dennis Eichhorn diff --git a/Math/Parser/Evaluator.php b/Math/Parser/Evaluator.php index bdf1952ae..15f50c61f 100755 --- a/Math/Parser/Evaluator.php +++ b/Math/Parser/Evaluator.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Parser * @copyright Dennis Eichhorn diff --git a/Math/Solver/Root/Bisection.php b/Math/Solver/Root/Bisection.php index cb92dab64..4be5faf10 100644 --- a/Math/Solver/Root/Bisection.php +++ b/Math/Solver/Root/Bisection.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Solver\Root * @copyright Dennis Eichhorn diff --git a/Math/Solver/Root/Illinois.php b/Math/Solver/Root/Illinois.php index 1e7965762..2796f79ee 100644 --- a/Math/Solver/Root/Illinois.php +++ b/Math/Solver/Root/Illinois.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Solver\Root * @copyright Dennis Eichhorn diff --git a/Math/Solver/Root/RegulaFalsi.php b/Math/Solver/Root/RegulaFalsi.php index 361d18b23..ac43bc779 100644 --- a/Math/Solver/Root/RegulaFalsi.php +++ b/Math/Solver/Root/RegulaFalsi.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Solver\Root * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Average.php b/Math/Statistic/Average.php index 18d81bb0a..c45fd1c52 100755 --- a/Math/Statistic/Average.php +++ b/Math/Statistic/Average.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Basic.php b/Math/Statistic/Basic.php index 9826b581b..b426eb805 100755 --- a/Math/Statistic/Basic.php +++ b/Math/Statistic/Basic.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Correlation.php b/Math/Statistic/Correlation.php index 278d35932..15f307c47 100755 --- a/Math/Statistic/Correlation.php +++ b/Math/Statistic/Correlation.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/ARIMA/ARIMA.php b/Math/Statistic/Forecast/ARIMA/ARIMA.php index bca02fb40..aa1d71765 100755 --- a/Math/Statistic/Forecast/ARIMA/ARIMA.php +++ b/Math/Statistic/Forecast/ARIMA/ARIMA.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/ARIMA/SARIMA.php b/Math/Statistic/Forecast/ARIMA/SARIMA.php index bca02fb40..aa1d71765 100755 --- a/Math/Statistic/Forecast/ARIMA/SARIMA.php +++ b/Math/Statistic/Forecast/ARIMA/SARIMA.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/ARIMA/SARIMAX.php b/Math/Statistic/Forecast/ARIMA/SARIMAX.php index bca02fb40..aa1d71765 100755 --- a/Math/Statistic/Forecast/ARIMA/SARIMAX.php +++ b/Math/Statistic/Forecast/ARIMA/SARIMAX.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/BayesianStructuralTimeSeries.php b/Math/Statistic/Forecast/BayesianStructuralTimeSeries.php index bca02fb40..aa1d71765 100755 --- a/Math/Statistic/Forecast/BayesianStructuralTimeSeries.php +++ b/Math/Statistic/Forecast/BayesianStructuralTimeSeries.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/DynamicLinearModels.php b/Math/Statistic/Forecast/DynamicLinearModels.php index bca02fb40..aa1d71765 100755 --- a/Math/Statistic/Forecast/DynamicLinearModels.php +++ b/Math/Statistic/Forecast/DynamicLinearModels.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/Error.php b/Math/Statistic/Forecast/Error.php index 6372f7a8a..559e2d3c5 100755 --- a/Math/Statistic/Forecast/Error.php +++ b/Math/Statistic/Forecast/Error.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/ExponentialSmoothing.php b/Math/Statistic/Forecast/ExponentialSmoothing.php index bca02fb40..aa1d71765 100755 --- a/Math/Statistic/Forecast/ExponentialSmoothing.php +++ b/Math/Statistic/Forecast/ExponentialSmoothing.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/Forecasts.php b/Math/Statistic/Forecast/Forecasts.php index 6a2e0e9d9..c55782c06 100755 --- a/Math/Statistic/Forecast/Forecasts.php +++ b/Math/Statistic/Forecast/Forecasts.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/GradientBoostingMachines.php b/Math/Statistic/Forecast/GradientBoostingMachines.php index bca02fb40..aa1d71765 100755 --- a/Math/Statistic/Forecast/GradientBoostingMachines.php +++ b/Math/Statistic/Forecast/GradientBoostingMachines.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/LongShortTermMemoryNetworks.php b/Math/Statistic/Forecast/LongShortTermMemoryNetworks.php index bca02fb40..aa1d71765 100755 --- a/Math/Statistic/Forecast/LongShortTermMemoryNetworks.php +++ b/Math/Statistic/Forecast/LongShortTermMemoryNetworks.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/Prophet.php b/Math/Statistic/Forecast/Prophet.php index bca02fb40..aa1d71765 100755 --- a/Math/Statistic/Forecast/Prophet.php +++ b/Math/Statistic/Forecast/Prophet.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/Regression/LevelLevelRegression.php b/Math/Statistic/Forecast/Regression/LevelLevelRegression.php index 853659a9c..eb708f0ff 100755 --- a/Math/Statistic/Forecast/Regression/LevelLevelRegression.php +++ b/Math/Statistic/Forecast/Regression/LevelLevelRegression.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast\Regression * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/Regression/LevelLogRegression.php b/Math/Statistic/Forecast/Regression/LevelLogRegression.php index 6635d881a..e421ec6b8 100755 --- a/Math/Statistic/Forecast/Regression/LevelLogRegression.php +++ b/Math/Statistic/Forecast/Regression/LevelLogRegression.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast\Regression * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/Regression/LogLevelRegression.php b/Math/Statistic/Forecast/Regression/LogLevelRegression.php index 59a96427c..0bd4bf34b 100755 --- a/Math/Statistic/Forecast/Regression/LogLevelRegression.php +++ b/Math/Statistic/Forecast/Regression/LogLevelRegression.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast\Regression * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/Regression/LogLogRegression.php b/Math/Statistic/Forecast/Regression/LogLogRegression.php index 1ce7a17df..91946f238 100755 --- a/Math/Statistic/Forecast/Regression/LogLogRegression.php +++ b/Math/Statistic/Forecast/Regression/LogLogRegression.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast\Regression * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php b/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php index 57eb5ec52..fb9e60f05 100755 --- a/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php +++ b/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package TBD * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/Regression/PolynomialRegression.php b/Math/Statistic/Forecast/Regression/PolynomialRegression.php index bec61209a..0998b192b 100755 --- a/Math/Statistic/Forecast/Regression/PolynomialRegression.php +++ b/Math/Statistic/Forecast/Regression/PolynomialRegression.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast\Regression * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/Regression/RegressionAbstract.php b/Math/Statistic/Forecast/Regression/RegressionAbstract.php index b08d87603..218172576 100755 --- a/Math/Statistic/Forecast/Regression/RegressionAbstract.php +++ b/Math/Statistic/Forecast/Regression/RegressionAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast\Regression * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/SeasonalTrendDecomposition.php b/Math/Statistic/Forecast/SeasonalTrendDecomposition.php index bca02fb40..aa1d71765 100755 --- a/Math/Statistic/Forecast/SeasonalTrendDecomposition.php +++ b/Math/Statistic/Forecast/SeasonalTrendDecomposition.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast * @copyright Dennis Eichhorn diff --git a/Math/Statistic/Forecast/VectorAutoregression.php b/Math/Statistic/Forecast/VectorAutoregression.php index bca02fb40..aa1d71765 100755 --- a/Math/Statistic/Forecast/VectorAutoregression.php +++ b/Math/Statistic/Forecast/VectorAutoregression.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic\Forecast * @copyright Dennis Eichhorn diff --git a/Math/Statistic/MeasureOfDispersion.php b/Math/Statistic/MeasureOfDispersion.php index f2b59da8d..9109531cf 100755 --- a/Math/Statistic/MeasureOfDispersion.php +++ b/Math/Statistic/MeasureOfDispersion.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Statistic * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/BernoulliDistribution.php b/Math/Stochastic/Distribution/BernoulliDistribution.php index 7ed1065b0..56121aafd 100755 --- a/Math/Stochastic/Distribution/BernoulliDistribution.php +++ b/Math/Stochastic/Distribution/BernoulliDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/BetaDistribution.php b/Math/Stochastic/Distribution/BetaDistribution.php index 42d553acf..92a304fad 100755 --- a/Math/Stochastic/Distribution/BetaDistribution.php +++ b/Math/Stochastic/Distribution/BetaDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/BinomialDistribution.php b/Math/Stochastic/Distribution/BinomialDistribution.php index 1cb483ec9..1dff4445d 100755 --- a/Math/Stochastic/Distribution/BinomialDistribution.php +++ b/Math/Stochastic/Distribution/BinomialDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/CauchyDistribution.php b/Math/Stochastic/Distribution/CauchyDistribution.php index 5bebb4bdd..ba0ce5150 100755 --- a/Math/Stochastic/Distribution/CauchyDistribution.php +++ b/Math/Stochastic/Distribution/CauchyDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/ChiSquaredDistribution.php b/Math/Stochastic/Distribution/ChiSquaredDistribution.php index d8e582090..ca015bd0b 100755 --- a/Math/Stochastic/Distribution/ChiSquaredDistribution.php +++ b/Math/Stochastic/Distribution/ChiSquaredDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/ExponentialDistribution.php b/Math/Stochastic/Distribution/ExponentialDistribution.php index 7a7446ffd..a6b0d390c 100755 --- a/Math/Stochastic/Distribution/ExponentialDistribution.php +++ b/Math/Stochastic/Distribution/ExponentialDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/FDistribution.php b/Math/Stochastic/Distribution/FDistribution.php index a36f6b0b8..0196fd279 100755 --- a/Math/Stochastic/Distribution/FDistribution.php +++ b/Math/Stochastic/Distribution/FDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/GammaDistribution.php b/Math/Stochastic/Distribution/GammaDistribution.php index 9b100baf9..47503b24a 100755 --- a/Math/Stochastic/Distribution/GammaDistribution.php +++ b/Math/Stochastic/Distribution/GammaDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/GeometricDistribution.php b/Math/Stochastic/Distribution/GeometricDistribution.php index b58b4a4c1..df96ff874 100755 --- a/Math/Stochastic/Distribution/GeometricDistribution.php +++ b/Math/Stochastic/Distribution/GeometricDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/HypergeometricDistribution.php b/Math/Stochastic/Distribution/HypergeometricDistribution.php index 03a598033..4f66b6aef 100755 --- a/Math/Stochastic/Distribution/HypergeometricDistribution.php +++ b/Math/Stochastic/Distribution/HypergeometricDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/LaplaceDistribution.php b/Math/Stochastic/Distribution/LaplaceDistribution.php index fbf92f0a7..7bd9f60f4 100755 --- a/Math/Stochastic/Distribution/LaplaceDistribution.php +++ b/Math/Stochastic/Distribution/LaplaceDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/LogDistribution.php b/Math/Stochastic/Distribution/LogDistribution.php index 043333726..a63b378ab 100755 --- a/Math/Stochastic/Distribution/LogDistribution.php +++ b/Math/Stochastic/Distribution/LogDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/LogNormalDistribution.php b/Math/Stochastic/Distribution/LogNormalDistribution.php index 0644e0f20..5f04236b5 100755 --- a/Math/Stochastic/Distribution/LogNormalDistribution.php +++ b/Math/Stochastic/Distribution/LogNormalDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/LogisticDistribution.php b/Math/Stochastic/Distribution/LogisticDistribution.php index 632f85fb2..84019c63a 100755 --- a/Math/Stochastic/Distribution/LogisticDistribution.php +++ b/Math/Stochastic/Distribution/LogisticDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/NormalDistribution.php b/Math/Stochastic/Distribution/NormalDistribution.php index 22724e598..cb7eb921b 100755 --- a/Math/Stochastic/Distribution/NormalDistribution.php +++ b/Math/Stochastic/Distribution/NormalDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/ParetoDistribution.php b/Math/Stochastic/Distribution/ParetoDistribution.php index 831cd1da5..658166e59 100755 --- a/Math/Stochastic/Distribution/ParetoDistribution.php +++ b/Math/Stochastic/Distribution/ParetoDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/PoissonDistribution.php b/Math/Stochastic/Distribution/PoissonDistribution.php index ca419760e..8b54578af 100755 --- a/Math/Stochastic/Distribution/PoissonDistribution.php +++ b/Math/Stochastic/Distribution/PoissonDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/TDistribution.php b/Math/Stochastic/Distribution/TDistribution.php index 3b0cafd28..69560b7df 100755 --- a/Math/Stochastic/Distribution/TDistribution.php +++ b/Math/Stochastic/Distribution/TDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/UniformDistributionContinuous.php b/Math/Stochastic/Distribution/UniformDistributionContinuous.php index f931b29b4..1667b0ef2 100755 --- a/Math/Stochastic/Distribution/UniformDistributionContinuous.php +++ b/Math/Stochastic/Distribution/UniformDistributionContinuous.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/UniformDistributionDiscrete.php b/Math/Stochastic/Distribution/UniformDistributionDiscrete.php index eba8982d2..1d222a3bb 100755 --- a/Math/Stochastic/Distribution/UniformDistributionDiscrete.php +++ b/Math/Stochastic/Distribution/UniformDistributionDiscrete.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/WeibullDistribution.php b/Math/Stochastic/Distribution/WeibullDistribution.php index dc439fa5b..fa9407903 100755 --- a/Math/Stochastic/Distribution/WeibullDistribution.php +++ b/Math/Stochastic/Distribution/WeibullDistribution.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/Distribution/ZTesting.php b/Math/Stochastic/Distribution/ZTesting.php index c50ca5ca5..daab66b19 100755 --- a/Math/Stochastic/Distribution/ZTesting.php +++ b/Math/Stochastic/Distribution/ZTesting.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic\Distribution * @copyright Dennis Eichhorn diff --git a/Math/Stochastic/NaiveBayesClassifier.php b/Math/Stochastic/NaiveBayesClassifier.php index eda2acc0e..5b2b46393 100755 --- a/Math/Stochastic/NaiveBayesClassifier.php +++ b/Math/Stochastic/NaiveBayesClassifier.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Stochastic * @copyright Dennis Eichhorn diff --git a/Math/Topology/Kernel2D.php b/Math/Topology/Kernel2D.php index 73bf2b2fa..2a8f2e7fc 100644 --- a/Math/Topology/Kernel2D.php +++ b/Math/Topology/Kernel2D.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Topology * @copyright Dennis Eichhorn diff --git a/Math/Topology/KernelsND.php b/Math/Topology/KernelsND.php index 01e33e7be..54268a9d9 100644 --- a/Math/Topology/KernelsND.php +++ b/Math/Topology/KernelsND.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Topology * @copyright Dennis Eichhorn diff --git a/Math/Topology/Metrics2D.php b/Math/Topology/Metrics2D.php index 8a1fab7da..f43873f1f 100755 --- a/Math/Topology/Metrics2D.php +++ b/Math/Topology/Metrics2D.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Topology * @copyright Dennis Eichhorn diff --git a/Math/Topology/MetricsND.php b/Math/Topology/MetricsND.php index d6097d1d1..d892711a9 100755 --- a/Math/Topology/MetricsND.php +++ b/Math/Topology/MetricsND.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Math\Topology * @copyright Dennis Eichhorn @@ -52,7 +52,7 @@ final class MetricsND */ public static function manhattan(array $a, array $b) : float { - if (\count($a) !== \count($b)) { + if (\count($a) > \count($b)) { throw new InvalidDimensionException(\count($a) . 'x' . \count($b)); } @@ -74,13 +74,11 @@ final class MetricsND * * @return float * - * @throws InvalidDimensionException - * * @since 1.0.0 */ public static function euclidean(array $a, array $b) : float { - if (\count($a) !== \count($b)) { + if (\count($a) > \count($b)) { throw new InvalidDimensionException(\count($a) . 'x' . \count($b)); } @@ -106,7 +104,7 @@ final class MetricsND */ public static function cosine(array $a, array $b) : float { - if (\count($a) !== \count($b)) { + if (\count($a) > \count($b)) { throw new InvalidDimensionException(\count($a) . 'x' . \count($b)); } @@ -150,7 +148,7 @@ final class MetricsND */ public static function chebyshev(array $a, array $b) : float { - if (\count($a) !== \count($b)) { + if (\count($a) > \count($b)) { throw new InvalidDimensionException(\count($a) . 'x' . \count($b)); } @@ -179,7 +177,7 @@ final class MetricsND */ public static function minkowski(array $a, array $b, int $lambda) : float { - if (\count($a) !== \count($b)) { + if (\count($a) > \count($b)) { throw new InvalidDimensionException(\count($a) . 'x' . \count($b)); } @@ -207,7 +205,7 @@ final class MetricsND */ public static function canberra(array $a, array $b) : float { - if (\count($a) !== \count($b)) { + if (\count($a) > \count($b)) { throw new InvalidDimensionException(\count($a) . 'x' . \count($b)); } @@ -235,7 +233,7 @@ final class MetricsND */ public static function brayCurtis(array $a, array $b) : float { - if (\count($a) !== \count($b)) { + if (\count($a) > \count($b)) { throw new InvalidDimensionException(\count($a) . 'x' . \count($b)); } @@ -265,7 +263,7 @@ final class MetricsND */ public static function angularSeparation(array $a, array $b) : float { - if (\count($a) !== \count($b)) { + if (\count($a) > \count($b)) { throw new InvalidDimensionException(\count($a) . 'x' . \count($b)); } diff --git a/Message/Cli/CliHeader.php b/Message/Cli/CliHeader.php index e1b47a860..de2d56eb1 100755 --- a/Message/Cli/CliHeader.php +++ b/Message/Cli/CliHeader.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Cli * @copyright Dennis Eichhorn diff --git a/Message/Cli/CliRequest.php b/Message/Cli/CliRequest.php index b4ab87d0c..079a5eefa 100755 --- a/Message/Cli/CliRequest.php +++ b/Message/Cli/CliRequest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Cli * @copyright Dennis Eichhorn diff --git a/Message/Cli/CliResponse.php b/Message/Cli/CliResponse.php index 3be1e9887..3d2c90082 100755 --- a/Message/Cli/CliResponse.php +++ b/Message/Cli/CliResponse.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Cli * @copyright Dennis Eichhorn @@ -16,7 +16,6 @@ namespace phpOMS\Message\Cli; use phpOMS\Contract\RenderableInterface; use phpOMS\Localization\Localization; -use phpOMS\Log\FileLogger; use phpOMS\Message\Http\RequestStatusCode; use phpOMS\Message\ResponseAbstract; use phpOMS\System\MimeType; @@ -158,9 +157,9 @@ final class CliResponse extends ResponseAbstract implements RenderableInterface } elseif ($response === null) { continue; } else { - FileLogger::getInstance() + \phpOMS\Log\FileLogger::getInstance() ->error( - FileLogger::MSG_FULL, [ + \phpOMS\Log\FileLogger::MSG_FULL, [ 'message' => 'Unknown type.', 'line' => __LINE__, 'file' => self::class, diff --git a/Message/HeaderAbstract.php b/Message/HeaderAbstract.php index aabffba6e..41c451f86 100755 --- a/Message/HeaderAbstract.php +++ b/Message/HeaderAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message * @copyright Dennis Eichhorn diff --git a/Message/Http/BrowserType.php b/Message/Http/BrowserType.php index 6b2212acf..5ac6008a8 100755 --- a/Message/Http/BrowserType.php +++ b/Message/Http/BrowserType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Http * @copyright Dennis Eichhorn diff --git a/Message/Http/HttpHeader.php b/Message/Http/HttpHeader.php index 6192a5dee..9b46345cf 100755 --- a/Message/Http/HttpHeader.php +++ b/Message/Http/HttpHeader.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Http * @copyright Dennis Eichhorn diff --git a/Message/Http/HttpRequest.php b/Message/Http/HttpRequest.php index 361e422d8..11614d31e 100755 --- a/Message/Http/HttpRequest.php +++ b/Message/Http/HttpRequest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Http * @copyright Dennis Eichhorn @@ -21,7 +21,6 @@ use phpOMS\Message\RequestAbstract; use phpOMS\Router\RouteVerb; use phpOMS\Security\Guard; use phpOMS\Uri\HttpUri; -use phpOMS\Uri\UriInterface; /** * Request class. @@ -34,6 +33,7 @@ use phpOMS\Uri\UriInterface; * @SuppressWarnings(PHPMD.Superglobals) * * @property HttpHeader $header + * @property HttpUri $uri */ final class HttpRequest extends RequestAbstract { @@ -72,12 +72,12 @@ final class HttpRequest extends RequestAbstract /** * Constructor. * - * @param UriInterface $uri Uri + * @param HttpUri $uri Uri * @param Localization $l11n Localization * * @since 1.0.0 */ - public function __construct(?UriInterface $uri = null, ?Localization $l11n = null) + public function __construct(?HttpUri $uri = null, ?Localization $l11n = null) { $this->header = new HttpHeader(); $this->header->l11n = $l11n ?? new Localization(); @@ -454,13 +454,13 @@ final class HttpRequest extends RequestAbstract /** * Set request uri. * - * @param UriInterface $uri Uri + * @param HttpUri $uri Uri * * @return void * * @since 1.0.0 */ - public function setUri(UriInterface $uri) : void + public function setUri(HttpUri $uri) : void { $this->uri = $uri; $this->data += $uri->getQueryArray(); @@ -493,6 +493,10 @@ final class HttpRequest extends RequestAbstract $paths[] = $pathArray[$j]; } + // @bug Since we are hashing the path elements without delimiter /test/path/here is the same as /testpath/here + // The reason for doing this without delimiter was probably because of different environments (web vs socket vs console) + // However, we could literally choose any delimiter INTERNALLY as long as it is the same across all Request classes. + // If this ever gets changed remember to also change the Navigation/ApiController.php file $this->hash[] = \sha1(\implode('', $paths)); } } diff --git a/Message/Http/HttpResponse.php b/Message/Http/HttpResponse.php index 4fbe034fd..2213b63b9 100755 --- a/Message/Http/HttpResponse.php +++ b/Message/Http/HttpResponse.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Http * @copyright Dennis Eichhorn @@ -16,7 +16,6 @@ namespace phpOMS\Message\Http; use phpOMS\Contract\RenderableInterface; use phpOMS\Localization\Localization; -use phpOMS\Log\FileLogger; use phpOMS\Message\ResponseAbstract; use phpOMS\System\MimeType; use phpOMS\Utils\ArrayUtils; @@ -190,9 +189,9 @@ final class HttpResponse extends ResponseAbstract implements RenderableInterface } elseif ($response === null) { continue; } else { - FileLogger::getInstance() + \phpOMS\Log\FileLogger::getInstance() ->error( - FileLogger::MSG_FULL, [ + \phpOMS\Log\FileLogger::MSG_FULL, [ 'message' => 'Unknown type.', 'line' => __LINE__, 'file' => self::class, diff --git a/Message/Http/ImpressionStat.php b/Message/Http/ImpressionStat.php index b51116fe0..284d58b17 100644 --- a/Message/Http/ImpressionStat.php +++ b/Message/Http/ImpressionStat.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Statistic * @copyright Dennis Eichhorn diff --git a/Message/Http/OSType.php b/Message/Http/OSType.php index 5a0ca734c..9ce0db64b 100755 --- a/Message/Http/OSType.php +++ b/Message/Http/OSType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Http * @copyright Dennis Eichhorn diff --git a/Message/Http/RequestMethod.php b/Message/Http/RequestMethod.php index ecc1dd968..8bfd2b511 100755 --- a/Message/Http/RequestMethod.php +++ b/Message/Http/RequestMethod.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Http * @copyright Dennis Eichhorn diff --git a/Message/Http/RequestStatus.php b/Message/Http/RequestStatus.php index f2968a3c4..a968af4d0 100755 --- a/Message/Http/RequestStatus.php +++ b/Message/Http/RequestStatus.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Http * @copyright Dennis Eichhorn diff --git a/Message/Http/RequestStatusCode.php b/Message/Http/RequestStatusCode.php index 1704b3c12..ff1573fcb 100755 --- a/Message/Http/RequestStatusCode.php +++ b/Message/Http/RequestStatusCode.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Http * @copyright Dennis Eichhorn diff --git a/Message/Http/Rest.php b/Message/Http/Rest.php index 7c4efb92d..67ba9485b 100755 --- a/Message/Http/Rest.php +++ b/Message/Http/Rest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Http * @copyright Dennis Eichhorn diff --git a/Message/Mail/DispositionType.php b/Message/Mail/DispositionType.php index ad2474e74..b23110531 100755 --- a/Message/Mail/DispositionType.php +++ b/Message/Mail/DispositionType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Mail * @copyright Dennis Eichhorn diff --git a/Message/Mail/DsnNotificationType.php b/Message/Mail/DsnNotificationType.php index f9c7ab473..7a7941711 100755 --- a/Message/Mail/DsnNotificationType.php +++ b/Message/Mail/DsnNotificationType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Mail * @copyright Dennis Eichhorn diff --git a/Message/Mail/Email.php b/Message/Mail/Email.php index 684d46253..6d638439d 100755 --- a/Message/Mail/Email.php +++ b/Message/Mail/Email.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Mail * @copyright Dennis Eichhorn diff --git a/Message/Mail/EncodingType.php b/Message/Mail/EncodingType.php index d0ddfb5a9..740da96c4 100755 --- a/Message/Mail/EncodingType.php +++ b/Message/Mail/EncodingType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Mail * @copyright Dennis Eichhorn diff --git a/Message/Mail/EncryptionType.php b/Message/Mail/EncryptionType.php index 8ed0c7f67..783e2ac59 100755 --- a/Message/Mail/EncryptionType.php +++ b/Message/Mail/EncryptionType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Mail * @copyright Dennis Eichhorn diff --git a/Message/Mail/HeaderContext.php b/Message/Mail/HeaderContext.php index a695e04b2..97a8644ff 100755 --- a/Message/Mail/HeaderContext.php +++ b/Message/Mail/HeaderContext.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Mail * @copyright Dennis Eichhorn diff --git a/Message/Mail/ICALMethodType.php b/Message/Mail/ICALMethodType.php index 45ac16a28..2f2725299 100755 --- a/Message/Mail/ICALMethodType.php +++ b/Message/Mail/ICALMethodType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Mail * @copyright Dennis Eichhorn diff --git a/Message/Mail/Imap.php b/Message/Mail/Imap.php index 9d8bbab00..3ebc36d35 100755 --- a/Message/Mail/Imap.php +++ b/Message/Mail/Imap.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Mail * @copyright Dennis Eichhorn diff --git a/Message/Mail/MailBoxInterface.php b/Message/Mail/MailBoxInterface.php index 021d279a5..954e9dd98 100755 --- a/Message/Mail/MailBoxInterface.php +++ b/Message/Mail/MailBoxInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Mail * @copyright Dennis Eichhorn diff --git a/Message/Mail/MailHandler.php b/Message/Mail/MailHandler.php index 33d188ed0..8a675b1b2 100755 --- a/Message/Mail/MailHandler.php +++ b/Message/Mail/MailHandler.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Mail * @license GLGPL 2.1 License diff --git a/Message/Mail/Pop3.php b/Message/Mail/Pop3.php index 760b734fd..e0233f71e 100755 --- a/Message/Mail/Pop3.php +++ b/Message/Mail/Pop3.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Mail * @copyright Dennis Eichhorn diff --git a/Message/Mail/SMTPAuthType.php b/Message/Mail/SMTPAuthType.php index 22c3a3af7..8745799ce 100755 --- a/Message/Mail/SMTPAuthType.php +++ b/Message/Mail/SMTPAuthType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Mail * @copyright Dennis Eichhorn diff --git a/Message/Mail/Smtp.php b/Message/Mail/Smtp.php index 339949152..f87d27597 100755 --- a/Message/Mail/Smtp.php +++ b/Message/Mail/Smtp.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Mail * @license GLGPL 2.1 License diff --git a/Message/Mail/SmtpTransactionPattern.php b/Message/Mail/SmtpTransactionPattern.php index 1d3f75b29..0982f2687 100755 --- a/Message/Mail/SmtpTransactionPattern.php +++ b/Message/Mail/SmtpTransactionPattern.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Mail * @copyright Dennis Eichhorn diff --git a/Message/Mail/SubmitType.php b/Message/Mail/SubmitType.php index b182cfe11..c031b2e8d 100755 --- a/Message/Mail/SubmitType.php +++ b/Message/Mail/SubmitType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Mail * @copyright Dennis Eichhorn diff --git a/Message/MessageInterface.php b/Message/MessageInterface.php index d180bdf68..2324d1fe8 100755 --- a/Message/MessageInterface.php +++ b/Message/MessageInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message * @copyright Dennis Eichhorn diff --git a/Message/NotificationLevel.php b/Message/NotificationLevel.php index e146967ff..7a27d0238 100755 --- a/Message/NotificationLevel.php +++ b/Message/NotificationLevel.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message * @copyright Dennis Eichhorn diff --git a/Message/RequestAbstract.php b/Message/RequestAbstract.php index 1524a4882..9c049c06c 100755 --- a/Message/RequestAbstract.php +++ b/Message/RequestAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message * @copyright Dennis Eichhorn diff --git a/Message/ResponseAbstract.php b/Message/ResponseAbstract.php index 6339e4d04..d5b01a14c 100755 --- a/Message/ResponseAbstract.php +++ b/Message/ResponseAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message * @copyright Dennis Eichhorn diff --git a/Message/Socket/PacketManager.php b/Message/Socket/PacketManager.php index 2715a3e29..438528e5e 100755 --- a/Message/Socket/PacketManager.php +++ b/Message/Socket/PacketManager.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Socket * @copyright Dennis Eichhorn diff --git a/Message/Socket/PacketType.php b/Message/Socket/PacketType.php index f64f178cf..af3ad2a4e 100755 --- a/Message/Socket/PacketType.php +++ b/Message/Socket/PacketType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Socket * @copyright Dennis Eichhorn diff --git a/Message/Socket/SocketHeader.php b/Message/Socket/SocketHeader.php index 5505ca499..56f5868c3 100755 --- a/Message/Socket/SocketHeader.php +++ b/Message/Socket/SocketHeader.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Socket * @copyright Dennis Eichhorn diff --git a/Message/Socket/SocketRequest.php b/Message/Socket/SocketRequest.php index d84825b3e..0eaa663c4 100755 --- a/Message/Socket/SocketRequest.php +++ b/Message/Socket/SocketRequest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Socket * @copyright Dennis Eichhorn diff --git a/Message/Socket/SocketResponse.php b/Message/Socket/SocketResponse.php index 1e6c5561a..ba212724d 100755 --- a/Message/Socket/SocketResponse.php +++ b/Message/Socket/SocketResponse.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message\Socket * @copyright Dennis Eichhorn diff --git a/Message/UploadedFileInterface.php b/Message/UploadedFileInterface.php index a4db4222c..31e20de68 100755 --- a/Message/UploadedFileInterface.php +++ b/Message/UploadedFileInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Message * @copyright Dennis Eichhorn diff --git a/Model/Html/FormElementGenerator.php b/Model/Html/FormElementGenerator.php index d3542999c..32320df5b 100755 --- a/Model/Html/FormElementGenerator.php +++ b/Model/Html/FormElementGenerator.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Model\Html * @copyright Dennis Eichhorn @@ -74,7 +74,7 @@ final class FormElementGenerator $element .= ' ' . $attribute . '="' . $val . '"'; } - $value ??= $json['default']['value'] ?? ''; + $value ??= $json['default']['value'] ?? null; $element .= (isset($json['default']) || $value !== null ? ' value="' . ($json['subtype'] === 'datetime' ? (new SmartDateTime($value))->format($json['default']['format']) : $value) . '"' : ''); diff --git a/Model/Html/Head.php b/Model/Html/Head.php index 9607ea11e..ac5691e12 100755 --- a/Model/Html/Head.php +++ b/Model/Html/Head.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Model\Html * @copyright Dennis Eichhorn diff --git a/Model/Html/Meta.php b/Model/Html/Meta.php index 773678702..953574f30 100755 --- a/Model/Html/Meta.php +++ b/Model/Html/Meta.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Model\Html * @copyright Dennis Eichhorn diff --git a/Model/Message/Dom.php b/Model/Message/Dom.php index 86a6fbc22..a20299cc2 100755 --- a/Model/Message/Dom.php +++ b/Model/Message/Dom.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Model\Message * @copyright Dennis Eichhorn diff --git a/Model/Message/DomAction.php b/Model/Message/DomAction.php index 1db69e4fd..4afad6dde 100755 --- a/Model/Message/DomAction.php +++ b/Model/Message/DomAction.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Model\Message * @copyright Dennis Eichhorn diff --git a/Model/Message/DynamicList.php b/Model/Message/DynamicList.php index 0292a0829..c3e122caf 100755 --- a/Model/Message/DynamicList.php +++ b/Model/Message/DynamicList.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Uri * @copyright Dennis Eichhorn diff --git a/Model/Message/FormValidation.php b/Model/Message/FormValidation.php index 6b2cd06dd..61f53a6e0 100755 --- a/Model/Message/FormValidation.php +++ b/Model/Message/FormValidation.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Model\Message * @copyright Dennis Eichhorn diff --git a/Model/Message/Notify.php b/Model/Message/Notify.php index 09f9a717f..ad416115f 100755 --- a/Model/Message/Notify.php +++ b/Model/Message/Notify.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Model\Message * @copyright Dennis Eichhorn diff --git a/Model/Message/Redirect.php b/Model/Message/Redirect.php index 8115b17e9..7ae254f80 100755 --- a/Model/Message/Redirect.php +++ b/Model/Message/Redirect.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Model\Message * @copyright Dennis Eichhorn diff --git a/Model/Message/Reload.php b/Model/Message/Reload.php index 24b46bc3a..8d73a78fd 100755 --- a/Model/Message/Reload.php +++ b/Model/Message/Reload.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Model\Message * @copyright Dennis Eichhorn diff --git a/Module/CliInterface.php b/Module/CliInterface.php index d7bc37662..abc456af5 100755 --- a/Module/CliInterface.php +++ b/Module/CliInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Module * @copyright Dennis Eichhorn diff --git a/Module/Exception/InvalidModuleException.php b/Module/Exception/InvalidModuleException.php index a86b75ab6..92411106f 100755 --- a/Module/Exception/InvalidModuleException.php +++ b/Module/Exception/InvalidModuleException.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Module\Exception * @copyright Dennis Eichhorn diff --git a/Module/Exception/InvalidThemeException.php b/Module/Exception/InvalidThemeException.php index a7d47c889..025fa4e3a 100755 --- a/Module/Exception/InvalidThemeException.php +++ b/Module/Exception/InvalidThemeException.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Module\Exception * @copyright Dennis Eichhorn diff --git a/Module/InstallerAbstract.php b/Module/InstallerAbstract.php index 8e14c189b..43b41c3fe 100755 --- a/Module/InstallerAbstract.php +++ b/Module/InstallerAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Module * @copyright Dennis Eichhorn diff --git a/Module/ModuleAbstract.php b/Module/ModuleAbstract.php index f53e7f75a..61e5f9426 100755 --- a/Module/ModuleAbstract.php +++ b/Module/ModuleAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Module * @copyright Dennis Eichhorn diff --git a/Module/ModuleInfo.php b/Module/ModuleInfo.php index be8553623..fda636573 100755 --- a/Module/ModuleInfo.php +++ b/Module/ModuleInfo.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Module * @copyright Dennis Eichhorn diff --git a/Module/ModuleManager.php b/Module/ModuleManager.php index bdf50cd90..525edccd6 100755 --- a/Module/ModuleManager.php +++ b/Module/ModuleManager.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Module * @copyright Dennis Eichhorn @@ -674,7 +674,7 @@ final class ModuleManager $ctrl = $this->get($module, $ctlName); if ($this->app->dispatcher !== null) { - $this->app->dispatcher->set($ctrl, $name); + $this->app->dispatcher->controllers[$name] = $ctrl; } // Handle providing->receiving diff --git a/Module/ModuleStatus.php b/Module/ModuleStatus.php index 64024f9ec..765cdce08 100755 --- a/Module/ModuleStatus.php +++ b/Module/ModuleStatus.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Module * @copyright Dennis Eichhorn diff --git a/Module/NullModule.php b/Module/NullModule.php index 2cc502da7..506a521d1 100755 --- a/Module/NullModule.php +++ b/Module/NullModule.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Module * @copyright Dennis Eichhorn @@ -14,8 +14,6 @@ declare(strict_types=1); namespace phpOMS\Module; -use phpOMS\Log\FileLogger; - /** * Mull module class. * @@ -35,9 +33,9 @@ final class NullModule extends ModuleAbstract /** {@inheritdoc} */ public static function __callStatic(string $name, array $arguments) : void { - FileLogger::getInstance() + \phpOMS\Log\FileLogger::getInstance() ->error( - FileLogger::MSG_FULL, [ + \phpOMS\Log\FileLogger::MSG_FULL, [ 'message' => 'Expected module/controller but got NullModule.', 'line' => __LINE__, 'file' => self::class, diff --git a/Module/PackageManager.php b/Module/PackageManager.php index 88f3b96bd..cc09148ed 100755 --- a/Module/PackageManager.php +++ b/Module/PackageManager.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Module * @copyright Dennis Eichhorn diff --git a/Module/SocketInterface.php b/Module/SocketInterface.php index 9db3dfe69..392b52e98 100755 --- a/Module/SocketInterface.php +++ b/Module/SocketInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Module * @copyright Dennis Eichhorn diff --git a/Module/StatusAbstract.php b/Module/StatusAbstract.php index 7cf27501f..253935f56 100755 --- a/Module/StatusAbstract.php +++ b/Module/StatusAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Module * @copyright Dennis Eichhorn diff --git a/Module/UninstallerAbstract.php b/Module/UninstallerAbstract.php index 4d7102664..45509d05a 100755 --- a/Module/UninstallerAbstract.php +++ b/Module/UninstallerAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Module * @copyright Dennis Eichhorn diff --git a/Module/UpdaterAbstract.php b/Module/UpdaterAbstract.php index 97e228b72..de745e837 100755 --- a/Module/UpdaterAbstract.php +++ b/Module/UpdaterAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Module * @copyright Dennis Eichhorn diff --git a/Module/WebInterface.php b/Module/WebInterface.php index d717d2474..12197f225 100755 --- a/Module/WebInterface.php +++ b/Module/WebInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Module * @copyright Dennis Eichhorn diff --git a/Preloader.php b/Preloader.php index b855f8e29..f21425edc 100755 --- a/Preloader.php +++ b/Preloader.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS * @copyright Dennis Eichhorn diff --git a/README.md b/README.md index 2d308fd78..3a772e7d4 100755 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ With Karaka you have one partner who can provide all the tools and software solu ## Requirements -* PHP 8.1 -* PHP extension: php8.1-dev php8.1-cli php8.1-common php8.1-mysql php8.1-pgsql php8.1-xdebug php8.1-opcache php8.1-pdo php8.1-sqlite php8.1-mbstring php8.1-curl php8.1-imap php8.1-bcmath php8.1-zip php8.1-dom php8.1-xml php8.1-phar php8.1-gd php-pear +* PHP 8.2 +* PHP extension: php8.2-dev php8.2-cli php8.2-common php8.2-intl php8.2-mysql php8.2-pgsql php8.2-xdebug php8.2-opcache php8.2-pdo php8.2-sqlite php8.2-mbstring php8.2-curl php8.2-imap php8.2-bcmath php8.2-zip php8.2-dom php8.2-xml php8.2-phar php8.2-gd php-pear * apache2 (recommended) or nginx * mysql-server (recommended) or postgresql postgresql-contrib * Tools: tesseract-ocr, pdftotext, pdftoppm diff --git a/Router/RouteStatus.php b/Router/RouteStatus.php index 2ec62a773..7d2a1802d 100755 --- a/Router/RouteStatus.php +++ b/Router/RouteStatus.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Router * @copyright Dennis Eichhorn diff --git a/Router/RouteVerb.php b/Router/RouteVerb.php index 1be7400b9..214acbc35 100755 --- a/Router/RouteVerb.php +++ b/Router/RouteVerb.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Router * @copyright Dennis Eichhorn diff --git a/Router/RouterInterface.php b/Router/RouterInterface.php index ffcfc013a..c3e11852a 100755 --- a/Router/RouterInterface.php +++ b/Router/RouterInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\DataStorage\Database\Schema * @copyright Dennis Eichhorn diff --git a/Router/SocketRouter.php b/Router/SocketRouter.php index 079257df1..5e364f394 100755 --- a/Router/SocketRouter.php +++ b/Router/SocketRouter.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Router * @copyright Dennis Eichhorn @@ -29,7 +29,7 @@ final class SocketRouter implements RouterInterface /** * Routes. * - * @var array + * @var array> * @since 1.0.0 */ private array $routes = []; @@ -40,15 +40,19 @@ final class SocketRouter implements RouterInterface * Files need to return a php array of the following structure (see PermissionHandlingTrait): * return [ * '{REGEX_PATH}' => [ - * 'dest' => '{DESTINATION_NAMESPACE:method}', // use :: for static functions - * 'permission' => [ // optional - * 'module' => '{NAME}', - * 'type' => PermissionType::{TYPE}, - * 'category' => PermissionCategory::{STATE}, + * [ + * 'dest' => '{DESTINATION_NAMESPACE:method}', // use :: for static functions + * 'verb' => RouteVerb::{VERB}, + * 'csrf' => true, + * 'permission' => [ // optional + * 'module' => '{NAME}', + * 'type' => PermissionType::{TYPE}, + * 'category' => PermissionCategory::{STATE}, + * ], * ], * // define different destination for different verb - * ], - * // define another regex path, destination, permission here + * ] + * // define another regex path here * ]; * * @param string $path Route file path @@ -125,21 +129,25 @@ final class SocketRouter implements RouterInterface } foreach ($destination as $d) { + if (!($d['active'] ?? true)) { + continue; + } + if ((!isset($d['verb']) || $d['verb'] === RouteVerb::ANY) || $verb === RouteVerb::ANY || ($verb & $d['verb']) === $verb ) { // if csrf is required but not set - if (isset($d['csrf']) && $d['csrf'] && $csrf === null) { + if (($d['csrf'] ?? false) && $csrf === null) { return ['dest' => RouteStatus::INVALID_CSRF]; } // if permission check is invalid - if (isset($d['permission']) && !empty($d['permission']) + if (!empty($d['permission'] ?? null) && ($account === null || $account->id === 0) ) { return ['dest' => RouteStatus::NOT_LOGGED_IN]; - } elseif (isset($d['permission']) && !empty($d['permission']) + } elseif (!empty($d['permission'] ?? null) && !($account?->hasPermission( $d['permission']['type'] ?? 0, $d['permission']['unit'] ?? $unitId, diff --git a/Router/WebRouter.php b/Router/WebRouter.php index 0e3796516..dcdd033de 100755 --- a/Router/WebRouter.php +++ b/Router/WebRouter.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Router * @copyright Dennis Eichhorn @@ -30,13 +30,17 @@ use phpOMS\Account\Account; * * @todo Instead of doing only regex matching, combine it with a tree search, this should be faster * https://github.com/Karaka-Management/phpOMS/issues/276 + * + * @question Consider to build Routes.php files from class Attributes. + * This way we would have the advantage of both worlds. + * Of course the update and install function would be a bit more complicated */ final class WebRouter implements RouterInterface { /** * Routes. * - * @var array + * @var array> * @since 1.0.0 */ private array $routes = []; @@ -47,17 +51,19 @@ final class WebRouter implements RouterInterface * Files need to return a php array of the following structure (see PermissionHandlingTrait): * return [ * '{REGEX_PATH}' => [ - * 'dest' => '{DESTINATION_NAMESPACE:method}', // use :: for static functions - * 'verb' => RouteVerb::{VERB}, - * 'csrf' => true, - * 'permission' => [ // optional - * 'module' => '{NAME}', - * 'type' => PermissionType::{TYPE}, - * 'category' => PermissionCategory::{STATE}, + * [ + * 'dest' => '{DESTINATION_NAMESPACE:method}', // use :: for static functions + * 'verb' => RouteVerb::{VERB}, + * 'csrf' => true, + * 'permission' => [ // optional + * 'module' => '{NAME}', + * 'type' => PermissionType::{TYPE}, + * 'category' => PermissionCategory::{STATE}, + * ], * ], * // define different destination for different verb - * ], - * // define another regex path, destination, permission here + * ] + * // define another regex path here * ]; * * @param string $path Route file path @@ -109,6 +115,7 @@ final class WebRouter implements RouterInterface 'dest' => $destination, 'verb' => $verb, 'csrf' => $csrf, + 'active' => true, 'validation' => empty($validation) ? null : $validation, 'pattern' => empty($dataPattern) ? null : $dataPattern, ]; @@ -134,21 +141,25 @@ final class WebRouter implements RouterInterface } foreach ($destination as $d) { + if (!($d['active'] ?? true)) { + continue; + } + if ($d['verb'] === RouteVerb::ANY || $verb === RouteVerb::ANY || ($verb & $d['verb']) === $verb ) { // if csrf is required but not set - if (isset($d['csrf']) && $d['csrf'] && $csrf === null) { + if (($d['csrf'] ?? false) && $csrf === null) { return ['dest' => RouteStatus::INVALID_CSRF]; } // if permission check is invalid - if (isset($d['permission']) && !empty($d['permission']) + if (!empty($d['permission'] ?? null) && ($account === null || $account->id === 0) ) { return ['dest' => RouteStatus::NOT_LOGGED_IN]; - } elseif (isset($d['permission']) && !empty($d['permission']) + } elseif (!empty($d['permission'] ?? null) && !($account?->hasPermission( $d['permission']['type'] ?? 0, $d['permission']['unit'] ?? $unitId, diff --git a/Security/EncryptionHelper.php b/Security/EncryptionHelper.php index 0ba24b64c..2f8fa2fe7 100755 --- a/Security/EncryptionHelper.php +++ b/Security/EncryptionHelper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Security * @copyright Dennis Eichhorn diff --git a/Security/Guard.php b/Security/Guard.php index 4f9d773bf..3376d1f35 100755 --- a/Security/Guard.php +++ b/Security/Guard.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Security * @copyright Dennis Eichhorn diff --git a/Security/PhpCode.php b/Security/PhpCode.php index 536e0cec6..238f3e83d 100755 --- a/Security/PhpCode.php +++ b/Security/PhpCode.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Security * @copyright Dennis Eichhorn diff --git a/Socket/Client/Client.php b/Socket/Client/Client.php index e90eeba7e..e1eca6d95 100755 --- a/Socket/Client/Client.php +++ b/Socket/Client/Client.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Socket\Client * @copyright Dennis Eichhorn diff --git a/Socket/Client/ClientConnection.php b/Socket/Client/ClientConnection.php index f10d4bf5a..6e2986d53 100755 --- a/Socket/Client/ClientConnection.php +++ b/Socket/Client/ClientConnection.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Socket\Client * @copyright Dennis Eichhorn diff --git a/Socket/Client/NullClientConnection.php b/Socket/Client/NullClientConnection.php index edb23c5e3..ff61af0e0 100755 --- a/Socket/Client/NullClientConnection.php +++ b/Socket/Client/NullClientConnection.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Socket\Client * @copyright Dennis Eichhorn diff --git a/Socket/Server/ClientManager.php b/Socket/Server/ClientManager.php index a4fef2823..b050a06a5 100755 --- a/Socket/Server/ClientManager.php +++ b/Socket/Server/ClientManager.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Socket\Server * @copyright Dennis Eichhorn diff --git a/Socket/Server/Server.php b/Socket/Server/Server.php index af1cc78a5..d1c6d2edf 100755 --- a/Socket/Server/Server.php +++ b/Socket/Server/Server.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Socket\Server * @copyright Dennis Eichhorn diff --git a/Socket/SocketAbstract.php b/Socket/SocketAbstract.php index 80354ad87..e75d09f69 100755 --- a/Socket/SocketAbstract.php +++ b/Socket/SocketAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Socket * @copyright Dennis Eichhorn diff --git a/Socket/SocketInterface.php b/Socket/SocketInterface.php index 7b20fdf55..5cec80de3 100755 --- a/Socket/SocketInterface.php +++ b/Socket/SocketInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Socket * @copyright Dennis Eichhorn diff --git a/Stdlib/Base/Address.php b/Stdlib/Base/Address.php index bcda6fbbe..ec960a7fa 100755 --- a/Stdlib/Base/Address.php +++ b/Stdlib/Base/Address.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Base * @copyright Dennis Eichhorn diff --git a/Stdlib/Base/AddressType.php b/Stdlib/Base/AddressType.php index f5cff24c3..241acb77f 100755 --- a/Stdlib/Base/AddressType.php +++ b/Stdlib/Base/AddressType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Base * @copyright Dennis Eichhorn diff --git a/Stdlib/Base/Enum.php b/Stdlib/Base/Enum.php index 1e873d0fc..77a715381 100755 --- a/Stdlib/Base/Enum.php +++ b/Stdlib/Base/Enum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Base * @copyright Dennis Eichhorn diff --git a/Stdlib/Base/EnumArray.php b/Stdlib/Base/EnumArray.php index 87a25fb32..c82337a7f 100755 --- a/Stdlib/Base/EnumArray.php +++ b/Stdlib/Base/EnumArray.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Base * @copyright Dennis Eichhorn diff --git a/Stdlib/Base/Exception/InvalidEnumName.php b/Stdlib/Base/Exception/InvalidEnumName.php index dd9950fab..d5e088bbc 100755 --- a/Stdlib/Base/Exception/InvalidEnumName.php +++ b/Stdlib/Base/Exception/InvalidEnumName.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Base\Exception * @copyright Dennis Eichhorn diff --git a/Stdlib/Base/Exception/InvalidEnumValue.php b/Stdlib/Base/Exception/InvalidEnumValue.php index 93d121ca3..e239c107d 100755 --- a/Stdlib/Base/Exception/InvalidEnumValue.php +++ b/Stdlib/Base/Exception/InvalidEnumValue.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Base\Exception * @copyright Dennis Eichhorn diff --git a/Stdlib/Base/FloatInt.php b/Stdlib/Base/FloatInt.php index 82f08a84e..a76100506 100755 --- a/Stdlib/Base/FloatInt.php +++ b/Stdlib/Base/FloatInt.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib * @copyright Dennis Eichhorn @@ -285,7 +285,7 @@ class FloatInt implements SerializableInterface } /** - * Mult. + * Multiply. * * @param int|float $value Value to multiply with * @@ -347,7 +347,7 @@ class FloatInt implements SerializableInterface } /** - * Searialze. + * Serialize. * * @return string * diff --git a/Stdlib/Base/Heap.php b/Stdlib/Base/Heap.php index aad6b0ccc..5185655b0 100755 --- a/Stdlib/Base/Heap.php +++ b/Stdlib/Base/Heap.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Base * @copyright Dennis Eichhorn diff --git a/Stdlib/Base/HeapItemInterface.php b/Stdlib/Base/HeapItemInterface.php index f02ed1edb..0976586ed 100755 --- a/Stdlib/Base/HeapItemInterface.php +++ b/Stdlib/Base/HeapItemInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Base * @copyright Dennis Eichhorn diff --git a/Stdlib/Base/Iban.php b/Stdlib/Base/Iban.php index bbe49de9e..b339a3c55 100755 --- a/Stdlib/Base/Iban.php +++ b/Stdlib/Base/Iban.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Base * @copyright Dennis Eichhorn diff --git a/Stdlib/Base/Location.php b/Stdlib/Base/Location.php index 2260cabef..f1f0ed6b8 100755 --- a/Stdlib/Base/Location.php +++ b/Stdlib/Base/Location.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Base * @copyright Dennis Eichhorn diff --git a/Stdlib/Base/NullAddress.php b/Stdlib/Base/NullAddress.php index b4e477311..3b372d395 100644 --- a/Stdlib/Base/NullAddress.php +++ b/Stdlib/Base/NullAddress.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Base * @copyright Dennis Eichhorn diff --git a/Stdlib/Base/NullLocation.php b/Stdlib/Base/NullLocation.php index b5d95b361..be3d542ec 100755 --- a/Stdlib/Base/NullLocation.php +++ b/Stdlib/Base/NullLocation.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Base * @copyright Dennis Eichhorn diff --git a/Stdlib/Base/PhoneType.php b/Stdlib/Base/PhoneType.php index 7091ea87d..74bc45bcf 100755 --- a/Stdlib/Base/PhoneType.php +++ b/Stdlib/Base/PhoneType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Base * @copyright Dennis Eichhorn diff --git a/Stdlib/Base/SmartDateTime.php b/Stdlib/Base/SmartDateTime.php index 7b7ec08f7..5570014cc 100755 --- a/Stdlib/Base/SmartDateTime.php +++ b/Stdlib/Base/SmartDateTime.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Base * @copyright Dennis Eichhorn diff --git a/Stdlib/Graph/Edge.php b/Stdlib/Graph/Edge.php index 3477a83aa..0ff3e1600 100755 --- a/Stdlib/Graph/Edge.php +++ b/Stdlib/Graph/Edge.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Graph * @copyright Dennis Eichhorn diff --git a/Stdlib/Graph/Graph.php b/Stdlib/Graph/Graph.php index 9fdc3df47..a6f8af2d5 100755 --- a/Stdlib/Graph/Graph.php +++ b/Stdlib/Graph/Graph.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Graph * @copyright Dennis Eichhorn diff --git a/Stdlib/Graph/Node.php b/Stdlib/Graph/Node.php index ba0848645..e51226898 100755 --- a/Stdlib/Graph/Node.php +++ b/Stdlib/Graph/Node.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Graph * @copyright Dennis Eichhorn diff --git a/Stdlib/Map/KeyType.php b/Stdlib/Map/KeyType.php index f0ac454eb..9b0c91515 100755 --- a/Stdlib/Map/KeyType.php +++ b/Stdlib/Map/KeyType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Map * @copyright Dennis Eichhorn diff --git a/Stdlib/Map/MultiMap.php b/Stdlib/Map/MultiMap.php index fa5fa752f..33b47625f 100755 --- a/Stdlib/Map/MultiMap.php +++ b/Stdlib/Map/MultiMap.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Map * @copyright Dennis Eichhorn diff --git a/Stdlib/Map/OrderType.php b/Stdlib/Map/OrderType.php index 464b50466..48d6a10d2 100755 --- a/Stdlib/Map/OrderType.php +++ b/Stdlib/Map/OrderType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Map * @copyright Dennis Eichhorn diff --git a/Stdlib/Queue/PriorityMode.php b/Stdlib/Queue/PriorityMode.php index bab717742..94e53e033 100755 --- a/Stdlib/Queue/PriorityMode.php +++ b/Stdlib/Queue/PriorityMode.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Queue * @copyright Dennis Eichhorn diff --git a/Stdlib/Queue/PriorityQueue.php b/Stdlib/Queue/PriorityQueue.php index ce9a8cee5..2e731e9c3 100755 --- a/Stdlib/Queue/PriorityQueue.php +++ b/Stdlib/Queue/PriorityQueue.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Queue * @copyright Dennis Eichhorn diff --git a/Stdlib/Tree/BinarySearchTree.php b/Stdlib/Tree/BinarySearchTree.php index f5fe8779e..42b6d9cc1 100644 --- a/Stdlib/Tree/BinarySearchTree.php +++ b/Stdlib/Tree/BinarySearchTree.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Tree * @copyright Dennis Eichhorn diff --git a/Stdlib/Tree/Node.php b/Stdlib/Tree/Node.php index 7a6730bec..83a605dcb 100644 --- a/Stdlib/Tree/Node.php +++ b/Stdlib/Tree/Node.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Stdlib\Tree * @copyright Dennis Eichhorn diff --git a/System/CharsetType.php b/System/CharsetType.php index de41e490d..a339f276d 100755 --- a/System/CharsetType.php +++ b/System/CharsetType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System * @copyright Dennis Eichhorn diff --git a/System/File/ContainerInterface.php b/System/File/ContainerInterface.php index bd03f65fd..2bf5c98a1 100755 --- a/System/File/ContainerInterface.php +++ b/System/File/ContainerInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File * @copyright Dennis Eichhorn diff --git a/System/File/ContentPutMode.php b/System/File/ContentPutMode.php index 3cd2a8cbc..6afddbe7f 100755 --- a/System/File/ContentPutMode.php +++ b/System/File/ContentPutMode.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File * @copyright Dennis Eichhorn diff --git a/System/File/DirectoryInterface.php b/System/File/DirectoryInterface.php index 4117bdb86..009431e16 100755 --- a/System/File/DirectoryInterface.php +++ b/System/File/DirectoryInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File * @copyright Dennis Eichhorn diff --git a/System/File/ExtensionType.php b/System/File/ExtensionType.php index f82ee99e6..1d3e39d4a 100755 --- a/System/File/ExtensionType.php +++ b/System/File/ExtensionType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File * @copyright Dennis Eichhorn diff --git a/System/File/FileInterface.php b/System/File/FileInterface.php index 0e77614ba..f032f0ad8 100755 --- a/System/File/FileInterface.php +++ b/System/File/FileInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File * @copyright Dennis Eichhorn diff --git a/System/File/FileUtils.php b/System/File/FileUtils.php index 7d7cb8bfa..748c2db4d 100755 --- a/System/File/FileUtils.php +++ b/System/File/FileUtils.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File * @copyright Dennis Eichhorn diff --git a/System/File/Ftp/Directory.php b/System/File/Ftp/Directory.php index 8496c6c11..ecd8a51c7 100755 --- a/System/File/Ftp/Directory.php +++ b/System/File/Ftp/Directory.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File\Ftp * @copyright Dennis Eichhorn diff --git a/System/File/Ftp/File.php b/System/File/Ftp/File.php index 16d13e227..876a86330 100755 --- a/System/File/Ftp/File.php +++ b/System/File/Ftp/File.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File\Ftp * @copyright Dennis Eichhorn diff --git a/System/File/Ftp/FileAbstract.php b/System/File/Ftp/FileAbstract.php index 7a3b63606..8fca31fb4 100755 --- a/System/File/Ftp/FileAbstract.php +++ b/System/File/Ftp/FileAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File\Ftp * @copyright Dennis Eichhorn diff --git a/System/File/Ftp/FtpContainerInterface.php b/System/File/Ftp/FtpContainerInterface.php index b2b3ed3cb..e692c777d 100755 --- a/System/File/Ftp/FtpContainerInterface.php +++ b/System/File/Ftp/FtpContainerInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File * @copyright Dennis Eichhorn diff --git a/System/File/Ftp/FtpStorage.php b/System/File/Ftp/FtpStorage.php index b5bcbee4d..3b2fa2704 100755 --- a/System/File/Ftp/FtpStorage.php +++ b/System/File/Ftp/FtpStorage.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File\Ftp * @copyright Dennis Eichhorn diff --git a/System/File/Local/Directory.php b/System/File/Local/Directory.php index aa309a9d3..5284692c5 100755 --- a/System/File/Local/Directory.php +++ b/System/File/Local/Directory.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File\Local * @copyright Dennis Eichhorn diff --git a/System/File/Local/File.php b/System/File/Local/File.php index b3c1e5a83..391c53d67 100755 --- a/System/File/Local/File.php +++ b/System/File/Local/File.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File\Local * @copyright Dennis Eichhorn diff --git a/System/File/Local/FileAbstract.php b/System/File/Local/FileAbstract.php index 644a28c43..79bc07e42 100755 --- a/System/File/Local/FileAbstract.php +++ b/System/File/Local/FileAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File\Local * @copyright Dennis Eichhorn diff --git a/System/File/Local/LocalContainerInterface.php b/System/File/Local/LocalContainerInterface.php index 0697ffa83..0dbce7edb 100755 --- a/System/File/Local/LocalContainerInterface.php +++ b/System/File/Local/LocalContainerInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File * @copyright Dennis Eichhorn diff --git a/System/File/Local/LocalStorage.php b/System/File/Local/LocalStorage.php index 48c5542bf..dda555b50 100755 --- a/System/File/Local/LocalStorage.php +++ b/System/File/Local/LocalStorage.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File\Local * @copyright Dennis Eichhorn diff --git a/System/File/PathException.php b/System/File/PathException.php index f399a28b9..dc8ecd783 100755 --- a/System/File/PathException.php +++ b/System/File/PathException.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File * @copyright Dennis Eichhorn diff --git a/System/File/PermissionException.php b/System/File/PermissionException.php index ef19bf726..bec04debd 100755 --- a/System/File/PermissionException.php +++ b/System/File/PermissionException.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File * @copyright Dennis Eichhorn diff --git a/System/File/Storage.php b/System/File/Storage.php index 7adb5956c..c4859c5b0 100755 --- a/System/File/Storage.php +++ b/System/File/Storage.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File * @copyright Dennis Eichhorn diff --git a/System/File/StorageAbstract.php b/System/File/StorageAbstract.php index 3dc3e0aae..4a1dd1e38 100755 --- a/System/File/StorageAbstract.php +++ b/System/File/StorageAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\File * @copyright Dennis Eichhorn diff --git a/System/MimeType.php b/System/MimeType.php index d2beb82bc..2a9501993 100755 --- a/System/MimeType.php +++ b/System/MimeType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System * @copyright Dennis Eichhorn diff --git a/System/OperatingSystem.php b/System/OperatingSystem.php index 13485f3f4..346abfc2d 100755 --- a/System/OperatingSystem.php +++ b/System/OperatingSystem.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System * @copyright Dennis Eichhorn diff --git a/System/Search/StringSearch.php b/System/Search/StringSearch.php index 262614280..5cbccf2ca 100755 --- a/System/Search/StringSearch.php +++ b/System/Search/StringSearch.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System\Search * @copyright Dennis Eichhorn diff --git a/System/SystemType.php b/System/SystemType.php index 5cc5a9c45..f0e04e434 100755 --- a/System/SystemType.php +++ b/System/SystemType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System * @copyright Dennis Eichhorn diff --git a/System/SystemUtils.php b/System/SystemUtils.php index c079aa00a..de1c8be2d 100755 --- a/System/SystemUtils.php +++ b/System/SystemUtils.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\System * @copyright Dennis Eichhorn diff --git a/UnhandledHandler.php b/UnhandledHandler.php index 7d42815cb..2c6f64cac 100755 --- a/UnhandledHandler.php +++ b/UnhandledHandler.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS * @copyright Dennis Eichhorn diff --git a/Uri/Argument.php b/Uri/Argument.php index 8ad4b6898..b312594de 100755 --- a/Uri/Argument.php +++ b/Uri/Argument.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Uri * @copyright Dennis Eichhorn diff --git a/Uri/HttpUri.php b/Uri/HttpUri.php index ce54e79a3..cf3ab8472 100755 --- a/Uri/HttpUri.php +++ b/Uri/HttpUri.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Uri * @copyright Dennis Eichhorn diff --git a/Uri/InvalidUriException.php b/Uri/InvalidUriException.php index 1ed36c379..330a4bc32 100755 --- a/Uri/InvalidUriException.php +++ b/Uri/InvalidUriException.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Uri * @copyright Dennis Eichhorn diff --git a/Uri/UriFactory.php b/Uri/UriFactory.php index ad22286a2..fe9facc4b 100755 --- a/Uri/UriFactory.php +++ b/Uri/UriFactory.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Uri * @copyright Dennis Eichhorn @@ -127,13 +127,13 @@ final class UriFactory /** * Setup uri builder based on current request * - * @param UriInterface $uri Uri + * @param HttpUri $uri Uri * * @return void * * @since 1.0.0 */ - public static function setupUriBuilder(UriInterface $uri) : void + public static function setupUriBuilder(HttpUri $uri) : void { self::setQuery('/scheme', $uri->scheme); self::setQuery('/host', $uri->host); @@ -228,6 +228,12 @@ final class UriFactory ); */ + // @feature Implement whitelisting/blacklisting for {?} + // Currently it copies all parameters + // Ideally you could use + // {?+para1,para2} for whitelisting + // {?-para1,para2} for blacklisting + if (\stripos($url, '?') === false && ($pos = \stripos($url, '&')) !== false) { $url = \substr_replace($url, '?', $pos, 1); } diff --git a/Uri/UriInterface.php b/Uri/UriInterface.php index 66efac66e..9d98d7553 100755 --- a/Uri/UriInterface.php +++ b/Uri/UriInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Uri * @copyright Dennis Eichhorn diff --git a/Uri/UriScheme.php b/Uri/UriScheme.php index 47e1cedc9..e08cf7c4b 100755 --- a/Uri/UriScheme.php +++ b/Uri/UriScheme.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Uri * @copyright Dennis Eichhorn diff --git a/Utils/ArrayUtils.php b/Utils/ArrayUtils.php index 7217ff1cb..24b35a9d2 100755 --- a/Utils/ArrayUtils.php +++ b/Utils/ArrayUtils.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils * @copyright Dennis Eichhorn diff --git a/Utils/Barcode/Aztec.php b/Utils/Barcode/Aztec.php index f3ba36e7c..bb2597b8f 100755 --- a/Utils/Barcode/Aztec.php +++ b/Utils/Barcode/Aztec.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Barcode * @copyright Dennis Eichhorn diff --git a/Utils/Barcode/BarAbstract.php b/Utils/Barcode/BarAbstract.php index 19025e28c..13a085411 100755 --- a/Utils/Barcode/BarAbstract.php +++ b/Utils/Barcode/BarAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Barcode * @copyright Dennis Eichhorn @@ -70,7 +70,7 @@ abstract class BarAbstract extends CodeAbstract /** * {@inheritdoc} */ - public function get() : mixed + public function get() : ?\GdImage { $codeString = static::$CODE_START . $this->generateCodeString() . static::$CODE_END; @@ -137,7 +137,7 @@ abstract class BarAbstract extends CodeAbstract * * @since 1.0.0 */ - protected function createImage(string $codeString) : mixed + protected function createImage(string $codeString) : \GdImage { $dimensions = $this->calculateDimensions($codeString); $image = \imagecreate($dimensions['width'], $dimensions['height']); diff --git a/Utils/Barcode/C128a.php b/Utils/Barcode/C128a.php index 8112d5a21..a18fb1bc2 100755 --- a/Utils/Barcode/C128a.php +++ b/Utils/Barcode/C128a.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Barcode * @copyright Dennis Eichhorn diff --git a/Utils/Barcode/C128b.php b/Utils/Barcode/C128b.php index 44f5bc465..ea7373e4a 100755 --- a/Utils/Barcode/C128b.php +++ b/Utils/Barcode/C128b.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Barcode * @copyright Dennis Eichhorn diff --git a/Utils/Barcode/C128c.php b/Utils/Barcode/C128c.php index d4a202990..81362b02d 100755 --- a/Utils/Barcode/C128c.php +++ b/Utils/Barcode/C128c.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Barcode * @copyright Dennis Eichhorn diff --git a/Utils/Barcode/C25.php b/Utils/Barcode/C25.php index f8b7cb6ec..ffefad6a3 100755 --- a/Utils/Barcode/C25.php +++ b/Utils/Barcode/C25.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Barcode * @copyright Dennis Eichhorn diff --git a/Utils/Barcode/C39.php b/Utils/Barcode/C39.php index 9531fd8df..6244e0e13 100755 --- a/Utils/Barcode/C39.php +++ b/Utils/Barcode/C39.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Barcode * @copyright Dennis Eichhorn diff --git a/Utils/Barcode/CodeAbstract.php b/Utils/Barcode/CodeAbstract.php index 7a612e264..4a2ff6e0a 100755 --- a/Utils/Barcode/CodeAbstract.php +++ b/Utils/Barcode/CodeAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Barcode * @copyright Dennis Eichhorn @@ -217,6 +217,9 @@ abstract class CodeAbstract public function saveToPngFile(string $file) : void { $res = $this->get(); + if ($res === null) { + return; + } \imagepng($res, $file); \imagedestroy($res); @@ -234,6 +237,9 @@ abstract class CodeAbstract public function saveToJpgFile(string $file) : void { $res = $this->get(); + if ($res === null) { + return; + } \imagejpeg($res, $file); \imagedestroy($res); @@ -242,9 +248,9 @@ abstract class CodeAbstract /** * Get image reference * - * @return \GdImage + * @return null|\GdImage * * @since 1.0.0 */ - abstract public function get() : mixed; + abstract public function get() : ?\GdImage; } diff --git a/Utils/Barcode/Codebar.php b/Utils/Barcode/Codebar.php index 23b19db62..4bf08399b 100755 --- a/Utils/Barcode/Codebar.php +++ b/Utils/Barcode/Codebar.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Barcode * @copyright Dennis Eichhorn diff --git a/Utils/Barcode/Datamatrix.php b/Utils/Barcode/Datamatrix.php index 8c2115d0b..7f616f00f 100755 --- a/Utils/Barcode/Datamatrix.php +++ b/Utils/Barcode/Datamatrix.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Barcode * @author Nicola Asuni - Tecnick.com LTD - www.tecnick.com diff --git a/Utils/Barcode/OrientationType.php b/Utils/Barcode/OrientationType.php index 813945af3..27f0077f8 100755 --- a/Utils/Barcode/OrientationType.php +++ b/Utils/Barcode/OrientationType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Barcode * @copyright Dennis Eichhorn diff --git a/Utils/Barcode/QR.php b/Utils/Barcode/QR.php index 8530565f7..c3490a0f6 100755 --- a/Utils/Barcode/QR.php +++ b/Utils/Barcode/QR.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Barcode * @author Nicola Asuni - Tecnick.com LTD - www.tecnick.com diff --git a/Utils/Barcode/TwoDAbstract.php b/Utils/Barcode/TwoDAbstract.php index 8a9196b3f..3e5a96abe 100755 --- a/Utils/Barcode/TwoDAbstract.php +++ b/Utils/Barcode/TwoDAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Barcode * @author Nicola Asuni - Tecnick.com LTD - www.tecnick.com @@ -28,7 +28,7 @@ abstract class TwoDAbstract extends CodeAbstract /** * {@inheritdoc} */ - public function get() : mixed + public function get() : ?\GdImage { $codeArray = $this->generateCodeArray(); @@ -49,14 +49,18 @@ abstract class TwoDAbstract extends CodeAbstract * * @param array $codeArray Code array to render * - * @return \GdImage + * @return null|\GdImage * * @throws \Exception * * @since 1.0.0 */ - protected function createImage(array $codeArray) : mixed + protected function createImage(array $codeArray) : ?\GdImage { + if (empty($codeArray)) { + return null; + } + $dimensions = $this->calculateDimensions($codeArray); $image = \imagecreate($dimensions['width'], $dimensions['height']); @@ -115,6 +119,13 @@ abstract class TwoDAbstract extends CodeAbstract */ private function calculateDimensions(array $codeArray) : array { + if (empty($codeArray)) { + return [ + 'width' => 0, + 'height' => 0, + ]; + } + $matrixDimension = \max(\count($codeArray), \count(\reset($codeArray))); $imageDimension = \max($this->dimension['width'], $this->dimension['width']); diff --git a/Utils/ColorUtils.php b/Utils/ColorUtils.php index 37855ec11..582087e79 100755 --- a/Utils/ColorUtils.php +++ b/Utils/ColorUtils.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils * @copyright Dennis Eichhorn @@ -71,4 +71,53 @@ final class ColorUtils return $i; } + + /** + * Calculate the color distance + * + * Important: This is not how humans perceive color differences + * + * @param array $rgb1 RGB 1 + * @param array $rgb2 RGB 2 + * + * @return float + * + * @see approximateColorDistance + * + * @since 1.0.0 + */ + public static function colorDistance(array $rgb1, array $rgb2) : float + { + $r = ($rgb2['r'] - $rgb1['r']); + $g = ($rgb2['g'] - $rgb1['g']); + $b = ($rgb2['b'] - $rgb1['b']); + + return \sqrt($r * $r + $g * $g + $b * $b); + } + + /** + * Approximate the perceived color distance + * + * @param array $rgb1 RGB 1 + * @param array $rgb2 RGB 2 + * + * @return float + * + * @see https://www.compuphase.com/cmetric.htm + * + * @since 1.0.0 + */ + public static function approximateColorDistance(array $rgb1, array $rgb2) : float + { + $rMean = (int) (($rgb1['r'] + $rgb2['r']) / 2); + $r = ($rgb2['r'] - $rgb1['r']); + $g = ($rgb2['g'] - $rgb1['g']); + $b = ($rgb2['b'] - $rgb1['b']); + + return \sqrt( + (((512 + $rMean) * $r * $r) >> 8) + + 4 * $g * $g + + (((767 - $rMean) * $b * $b) >> 8) + ); + } } diff --git a/Utils/Compression/CompressionInterface.php b/Utils/Compression/CompressionInterface.php index dc024eec7..0ace96138 100755 --- a/Utils/Compression/CompressionInterface.php +++ b/Utils/Compression/CompressionInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Compression * @copyright Dennis Eichhorn diff --git a/Utils/Compression/LZW.php b/Utils/Compression/LZW.php index 0c4c80cd0..c3e49ca8f 100755 --- a/Utils/Compression/LZW.php +++ b/Utils/Compression/LZW.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Compression * @copyright Dennis Eichhorn diff --git a/Utils/Converter/AngleType.php b/Utils/Converter/AngleType.php index d6bccfe20..cbfdd4dd4 100755 --- a/Utils/Converter/AngleType.php +++ b/Utils/Converter/AngleType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Converter * @copyright Dennis Eichhorn diff --git a/Utils/Converter/AreaType.php b/Utils/Converter/AreaType.php index 2b431f083..05ecd7a14 100755 --- a/Utils/Converter/AreaType.php +++ b/Utils/Converter/AreaType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Converter * @copyright Dennis Eichhorn diff --git a/Utils/Converter/Currency.php b/Utils/Converter/Currency.php index 17c85eaf1..874012dd5 100755 --- a/Utils/Converter/Currency.php +++ b/Utils/Converter/Currency.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Converter * @copyright Dennis Eichhorn diff --git a/Utils/Converter/EnergyPowerType.php b/Utils/Converter/EnergyPowerType.php index 037437b1f..29bcf4cbd 100755 --- a/Utils/Converter/EnergyPowerType.php +++ b/Utils/Converter/EnergyPowerType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Converter * @copyright Dennis Eichhorn diff --git a/Utils/Converter/File.php b/Utils/Converter/File.php index 09aa009ee..21a84fb55 100755 --- a/Utils/Converter/File.php +++ b/Utils/Converter/File.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Converter * @copyright Dennis Eichhorn diff --git a/Utils/Converter/FileSizeType.php b/Utils/Converter/FileSizeType.php index 3ed63d2de..4308e2fe9 100755 --- a/Utils/Converter/FileSizeType.php +++ b/Utils/Converter/FileSizeType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Converter * @copyright Dennis Eichhorn diff --git a/Utils/Converter/Ip.php b/Utils/Converter/Ip.php index a96171946..94e73341e 100755 --- a/Utils/Converter/Ip.php +++ b/Utils/Converter/Ip.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Converter * @copyright Dennis Eichhorn diff --git a/Utils/Converter/LengthType.php b/Utils/Converter/LengthType.php index 4e657098c..2ecea4709 100755 --- a/Utils/Converter/LengthType.php +++ b/Utils/Converter/LengthType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Converter * @copyright Dennis Eichhorn diff --git a/Utils/Converter/Measurement.php b/Utils/Converter/Measurement.php index 9abaf33cd..231e159ec 100755 --- a/Utils/Converter/Measurement.php +++ b/Utils/Converter/Measurement.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Converter * @copyright Dennis Eichhorn diff --git a/Utils/Converter/Numeric.php b/Utils/Converter/Numeric.php index 26206e86f..b269d3619 100755 --- a/Utils/Converter/Numeric.php +++ b/Utils/Converter/Numeric.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Converter * @copyright Dennis Eichhorn diff --git a/Utils/Converter/PressureType.php b/Utils/Converter/PressureType.php index 0d2916f4d..134c53746 100755 --- a/Utils/Converter/PressureType.php +++ b/Utils/Converter/PressureType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Converter * @copyright Dennis Eichhorn diff --git a/Utils/Converter/SpeedType.php b/Utils/Converter/SpeedType.php index 1f0a96bd6..6ecc62fef 100755 --- a/Utils/Converter/SpeedType.php +++ b/Utils/Converter/SpeedType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Converter * @copyright Dennis Eichhorn diff --git a/Utils/Converter/TemperatureType.php b/Utils/Converter/TemperatureType.php index 6d54a1248..3dd68c339 100755 --- a/Utils/Converter/TemperatureType.php +++ b/Utils/Converter/TemperatureType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Converter * @copyright Dennis Eichhorn diff --git a/Utils/Converter/TimeType.php b/Utils/Converter/TimeType.php index e4abe83e8..1404318f0 100755 --- a/Utils/Converter/TimeType.php +++ b/Utils/Converter/TimeType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Converter * @copyright Dennis Eichhorn diff --git a/Utils/Converter/VolumeType.php b/Utils/Converter/VolumeType.php index 313f40c9f..b3634c7e5 100755 --- a/Utils/Converter/VolumeType.php +++ b/Utils/Converter/VolumeType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Converter * @copyright Dennis Eichhorn diff --git a/Utils/Converter/WeightType.php b/Utils/Converter/WeightType.php index adc538eb9..768799c9c 100755 --- a/Utils/Converter/WeightType.php +++ b/Utils/Converter/WeightType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Converter * @copyright Dennis Eichhorn diff --git a/Utils/Encoding/Base64Url.php b/Utils/Encoding/Base64Url.php index d647a1647..a8dd4b554 100644 --- a/Utils/Encoding/Base64Url.php +++ b/Utils/Encoding/Base64Url.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Encoding * @copyright Dennis Eichhorn diff --git a/Utils/Encoding/Caesar.php b/Utils/Encoding/Caesar.php index ac8cba292..ed9c5a3a2 100755 --- a/Utils/Encoding/Caesar.php +++ b/Utils/Encoding/Caesar.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Encoding * @copyright Dennis Eichhorn diff --git a/Utils/Encoding/EncodingInterface.php b/Utils/Encoding/EncodingInterface.php index 2b071827f..3b12dfcce 100755 --- a/Utils/Encoding/EncodingInterface.php +++ b/Utils/Encoding/EncodingInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Encoding * @copyright Dennis Eichhorn diff --git a/Utils/Encoding/Gray.php b/Utils/Encoding/Gray.php index 63a47b1fb..70c9ca3f9 100755 --- a/Utils/Encoding/Gray.php +++ b/Utils/Encoding/Gray.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Encoding * @copyright Dennis Eichhorn diff --git a/Utils/Encoding/Huffman/Dictionary.php b/Utils/Encoding/Huffman/Dictionary.php index 0560c0e0c..1f7da2ed3 100755 --- a/Utils/Encoding/Huffman/Dictionary.php +++ b/Utils/Encoding/Huffman/Dictionary.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Encoding\Huffman * @copyright Dennis Eichhorn diff --git a/Utils/Encoding/Huffman/Huffman.php b/Utils/Encoding/Huffman/Huffman.php index b44befdce..9278d3ff7 100755 --- a/Utils/Encoding/Huffman/Huffman.php +++ b/Utils/Encoding/Huffman/Huffman.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Encoding\Huffman * @copyright Dennis Eichhorn diff --git a/Utils/Encoding/XorEncoding.php b/Utils/Encoding/XorEncoding.php index 953d38191..28f5b0025 100755 --- a/Utils/Encoding/XorEncoding.php +++ b/Utils/Encoding/XorEncoding.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Encoding * @copyright Dennis Eichhorn diff --git a/Utils/Formatter/HtmlFormatter.php b/Utils/Formatter/HtmlFormatter.php index f8c396b1b..4edfdc026 100644 --- a/Utils/Formatter/HtmlFormatter.php +++ b/Utils/Formatter/HtmlFormatter.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Formatter * @copyright Dennis Eichhorn diff --git a/Utils/Git/Author.php b/Utils/Git/Author.php index a56b219b8..e64244145 100755 --- a/Utils/Git/Author.php +++ b/Utils/Git/Author.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Git * @copyright Dennis Eichhorn diff --git a/Utils/Git/Branch.php b/Utils/Git/Branch.php index 3cec8edc5..cd7a8a2e6 100755 --- a/Utils/Git/Branch.php +++ b/Utils/Git/Branch.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Git * @copyright Dennis Eichhorn diff --git a/Utils/Git/Commit.php b/Utils/Git/Commit.php index f2e6f5166..908517105 100755 --- a/Utils/Git/Commit.php +++ b/Utils/Git/Commit.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Git * @copyright Dennis Eichhorn diff --git a/Utils/Git/Git.php b/Utils/Git/Git.php index fe0346f26..9eccb992c 100755 --- a/Utils/Git/Git.php +++ b/Utils/Git/Git.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Git * @copyright Dennis Eichhorn diff --git a/Utils/Git/NullCommit.php b/Utils/Git/NullCommit.php index eea9c3b63..4615623a5 100755 --- a/Utils/Git/NullCommit.php +++ b/Utils/Git/NullCommit.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Git * @copyright Dennis Eichhorn diff --git a/Utils/Git/Repository.php b/Utils/Git/Repository.php index 3efbacdef..88e9ccf3c 100755 --- a/Utils/Git/Repository.php +++ b/Utils/Git/Repository.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Git * @copyright Dennis Eichhorn diff --git a/Utils/Git/Tag.php b/Utils/Git/Tag.php index c9d6fb0ca..31312d12d 100755 --- a/Utils/Git/Tag.php +++ b/Utils/Git/Tag.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Git * @copyright Dennis Eichhorn diff --git a/Utils/IO/Csv/CsvDatabaseMapper.php b/Utils/IO/Csv/CsvDatabaseMapper.php index 5f884db05..17a13ef94 100644 --- a/Utils/IO/Csv/CsvDatabaseMapper.php +++ b/Utils/IO/Csv/CsvDatabaseMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\IO\Csv * @copyright Dennis Eichhorn diff --git a/Utils/IO/Csv/CsvInterface.php b/Utils/IO/Csv/CsvInterface.php index da88cd9f4..777d35d2e 100755 --- a/Utils/IO/Csv/CsvInterface.php +++ b/Utils/IO/Csv/CsvInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\IO\Csv * @copyright Dennis Eichhorn diff --git a/Utils/IO/Csv/CsvSettings.php b/Utils/IO/Csv/CsvSettings.php index 0d1fa06b1..41bc76a28 100755 --- a/Utils/IO/Csv/CsvSettings.php +++ b/Utils/IO/Csv/CsvSettings.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\IO\Csv * @copyright Dennis Eichhorn diff --git a/Utils/IO/ExchangeInterface.php b/Utils/IO/ExchangeInterface.php index 94522f806..e622eed44 100755 --- a/Utils/IO/ExchangeInterface.php +++ b/Utils/IO/ExchangeInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\IO * @copyright Dennis Eichhorn diff --git a/Utils/IO/IODatabaseMapper.php b/Utils/IO/IODatabaseMapper.php index 7324dd7e6..55821843c 100755 --- a/Utils/IO/IODatabaseMapper.php +++ b/Utils/IO/IODatabaseMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\IO * @copyright Dennis Eichhorn diff --git a/Utils/IO/Json/InvalidJsonException.php b/Utils/IO/Json/InvalidJsonException.php index 9a0a24bda..44d70deb1 100755 --- a/Utils/IO/Json/InvalidJsonException.php +++ b/Utils/IO/Json/InvalidJsonException.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\IO\Json * @copyright Dennis Eichhorn diff --git a/Utils/IO/Json/JsonInterface.php b/Utils/IO/Json/JsonInterface.php index bef04e9f7..89a501313 100755 --- a/Utils/IO/Json/JsonInterface.php +++ b/Utils/IO/Json/JsonInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\IO\Json * @copyright Dennis Eichhorn diff --git a/Utils/IO/Pdf/PdfInterface.php b/Utils/IO/Pdf/PdfInterface.php index bc0dfd27c..45623dcc7 100755 --- a/Utils/IO/Pdf/PdfInterface.php +++ b/Utils/IO/Pdf/PdfInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\IO\Pdf * @copyright Dennis Eichhorn diff --git a/Utils/IO/Spreadsheet/SpreadsheetDatabaseMapper.php b/Utils/IO/Spreadsheet/SpreadsheetDatabaseMapper.php index dfdcba4c5..baeb81223 100755 --- a/Utils/IO/Spreadsheet/SpreadsheetDatabaseMapper.php +++ b/Utils/IO/Spreadsheet/SpreadsheetDatabaseMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\IO\Spreadsheet * @copyright Dennis Eichhorn diff --git a/Utils/IO/Spreadsheet/SpreadsheetInterface.php b/Utils/IO/Spreadsheet/SpreadsheetInterface.php index 78aa9c8ed..ae4c77478 100755 --- a/Utils/IO/Spreadsheet/SpreadsheetInterface.php +++ b/Utils/IO/Spreadsheet/SpreadsheetInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\IO\Spreadsheet * @copyright Dennis Eichhorn diff --git a/Utils/IO/Zip/ArchiveInterface.php b/Utils/IO/Zip/ArchiveInterface.php index 609ca78eb..0bd302fbe 100755 --- a/Utils/IO/Zip/ArchiveInterface.php +++ b/Utils/IO/Zip/ArchiveInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\IO\Zip * @copyright Dennis Eichhorn diff --git a/Utils/IO/Zip/Gz.php b/Utils/IO/Zip/Gz.php index 11144277e..b4479f603 100755 --- a/Utils/IO/Zip/Gz.php +++ b/Utils/IO/Zip/Gz.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\IO\Zip * @copyright Dennis Eichhorn diff --git a/Utils/IO/Zip/Tar.php b/Utils/IO/Zip/Tar.php index a9b7380f3..d3489a93f 100755 --- a/Utils/IO/Zip/Tar.php +++ b/Utils/IO/Zip/Tar.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\IO\Zip * @copyright Dennis Eichhorn diff --git a/Utils/IO/Zip/TarGz.php b/Utils/IO/Zip/TarGz.php index b960a2838..3f77e5cf9 100755 --- a/Utils/IO/Zip/TarGz.php +++ b/Utils/IO/Zip/TarGz.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\IO\Zip * @copyright Dennis Eichhorn diff --git a/Utils/IO/Zip/Zip.php b/Utils/IO/Zip/Zip.php index d1b2a80ae..bc817de60 100755 --- a/Utils/IO/Zip/Zip.php +++ b/Utils/IO/Zip/Zip.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\IO\Zip * @copyright Dennis Eichhorn diff --git a/Utils/ImageUtils.php b/Utils/ImageUtils.php index 0f7ca4575..b21857953 100755 --- a/Utils/ImageUtils.php +++ b/Utils/ImageUtils.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils * @copyright Dennis Eichhorn @@ -72,7 +72,7 @@ final class ImageUtils } /** - * Calculate lightess from rgb values + * Calculate lightness from rgb values * * @param int $r Red * @param int $g Green @@ -365,7 +365,7 @@ final class ImageUtils * * @since 1.0.0 */ - private static function getAverageColor($src, $x, $y, $width, $height, $area = 10) : int + private static function getAverageColor(\GdImage $src, int $x, int $y, int $width, int $height, int $area = 10) : int { $colors = []; @@ -387,4 +387,26 @@ final class ImageUtils return (int) (\array_sum($colors) / \count($colors)); } + + /** + * Calculate the average color based on random probes + * + * @param \GdImage $src Image resource + * @param int $probes Count of random color probes/samples + * + * @return int + * + * @since 1.0.0 + */ + public static function averageColorRandom(\GdImage $src, int $probes = 25) : int + { + $dim = [\imagesx($src), \imagesy($src)]; + + $color = 0; + for ($i = 0; $i < $probes; ++$i) { + $color += \imagecolorat($src, \mt_rand(0, $dim[0]), \mt_rand(0, $dim[1])); + } + + return $color / $probes; + } } diff --git a/Utils/MbStringUtils.php b/Utils/MbStringUtils.php index 94139b509..a1bfd2217 100755 --- a/Utils/MbStringUtils.php +++ b/Utils/MbStringUtils.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils * @copyright Dennis Eichhorn diff --git a/Utils/NumericUtils.php b/Utils/NumericUtils.php index 27adc32f7..b6b785f6e 100755 --- a/Utils/NumericUtils.php +++ b/Utils/NumericUtils.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils * @copyright Dennis Eichhorn diff --git a/Utils/Parser/Calendar/ICalParser.php b/Utils/Parser/Calendar/ICalParser.php index 86d730bce..6519ac371 100755 --- a/Utils/Parser/Calendar/ICalParser.php +++ b/Utils/Parser/Calendar/ICalParser.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Parser\Calendar * @copyright Dennis Eichhorn diff --git a/Utils/Parser/Document/DocumentParser.php b/Utils/Parser/Document/DocumentParser.php index 1a63ebe9f..5e60d1cf6 100755 --- a/Utils/Parser/Document/DocumentParser.php +++ b/Utils/Parser/Document/DocumentParser.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Parser\Document * @copyright Dennis Eichhorn diff --git a/Utils/Parser/Document/DocumentWriter.php b/Utils/Parser/Document/DocumentWriter.php index b3af2ad5d..5e1957d0e 100755 --- a/Utils/Parser/Document/DocumentWriter.php +++ b/Utils/Parser/Document/DocumentWriter.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Parser\Document * @copyright Dennis Eichhorn diff --git a/Utils/Parser/Html/HtmlParser.php b/Utils/Parser/Html/HtmlParser.php index 5f1290105..55deb9c20 100644 --- a/Utils/Parser/Html/HtmlParser.php +++ b/Utils/Parser/Html/HtmlParser.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Parser\Html * @copyright Dennis Eichhorn diff --git a/Utils/Parser/Markdown/Markdown.php b/Utils/Parser/Markdown/Markdown.php index e536aa5e2..738401d11 100755 --- a/Utils/Parser/Markdown/Markdown.php +++ b/Utils/Parser/Markdown/Markdown.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Parser\Markdown * @copyright Original & extra license Emanuil Rusev, erusev.com (MIT) @@ -338,7 +338,7 @@ class Markdown * @var array{}|array{text:string, id:string, level:string} * @since 1.0.0 */ - protected $contentsListArray = []; + protected array $contentsListArray = []; /** * TOC string after parsing headers @@ -346,7 +346,7 @@ class Markdown * @var string * @since 1.0.0 */ - protected $contentsListString = ''; + protected string $contentsListString = ''; /** * First head level @@ -362,7 +362,7 @@ class Markdown * @var bool * @since 1.0.0 */ - protected $isBlacklistInitialized = false; + protected bool $isBlacklistInitialized = false; /** * Header duplicates (same header text) @@ -370,7 +370,7 @@ class Markdown * @var array * @since 1.0.0 */ - protected $anchorDuplicates = []; + protected array $anchorDuplicates = []; // TOC: end /** @@ -387,7 +387,7 @@ class Markdown * @var string * @since 1.0.0 */ - private string $currentAbreviation; + private string $currentAbbreviation; /** * Current abbreviation meaning @@ -420,7 +420,7 @@ class Markdown $this->firstHeadLevel = 0; $this->anchorDuplicates = []; $this->footnoteCount = 0; - $this->currentAbreviation = ''; + $this->currentAbbreviation = ''; $this->currentMeaning = ''; } @@ -729,7 +729,7 @@ class Markdown return null; } - $url = UriFactory::build($matches[1]); + $url = UriFactory::build(\str_replace('{$CSRF}', 'ERROR', $matches[1])); if (!isset($matches[2])) { $url = "mailto:{$url}"; @@ -943,7 +943,7 @@ class Markdown return null; } - $url = UriFactory::build($matches[0][0]); + $url = UriFactory::build(\str_replace('{$CSRF}', 'ERROR', $matches[0][0])); return [ 'extent' => \strlen($matches[0][0]), @@ -976,7 +976,7 @@ class Markdown return null; } - $url = UriFactory::build($matches[1]); + $url = UriFactory::build(\str_replace('{$CSRF}', 'ERROR', $matches[1])); return [ 'extent' => \strlen($matches[0]), @@ -1390,7 +1390,7 @@ class Markdown default: $element = 'video'; $attributes = [ - 'src' => UriFactory::build($url), + 'src' => UriFactory::build(\str_replace('{$CSRF}', 'ERROR', $url)), 'controls' => '', ]; } @@ -1410,7 +1410,7 @@ class Markdown 'name' => 'audio', 'text' => $matches[1], 'attributes' => [ - 'src' => UriFactory::build($url), + 'src' => UriFactory::build(\str_replace('{$CSRF}', 'ERROR', $url)), 'controls' => '', ], ], @@ -2310,7 +2310,7 @@ class Markdown $id = \strtolower($matches[1]); $this->definitionData['Reference'][$id] = [ - 'url' => UriFactory::build($matches[2]), + 'url' => UriFactory::build(\str_replace('{$CSRF}', 'ERROR', $matches[2])), 'title' => isset($matches[3]) ? $matches[3] : null, ]; @@ -3514,14 +3514,14 @@ class Markdown } $element['elements'] = self::pregReplaceElements( - '/\b' . \preg_quote($this->currentAbreviation, '/') . '\b/', + '/\b' . \preg_quote($this->currentAbbreviation, '/') . '\b/', [ [ 'name' => 'abbr', 'attributes' => [ 'title' => $this->currentMeaning, ], - 'text' => $this->currentAbreviation, + 'text' => $this->currentAbbreviation, ], ], $element['text'] @@ -3563,7 +3563,7 @@ class Markdown } foreach ($this->definitionData['Abbreviation'] as $abbreviation => $meaning) { - $this->currentAbreviation = $abbreviation; + $this->currentAbbreviation = $abbreviation; $this->currentMeaning = $meaning; $inline['element'] = $this->elementApplyRecursiveDepthFirst( @@ -4394,7 +4394,7 @@ class Markdown } if (\preg_match('/^[(]\s*+((?:[^ ()]++|[(][^ )]+[)])++)(?:[ ]+("[^"]*+"|\'[^\']*+\'))?\s*+[)]/', $remainder, $matches)) { - $element['attributes']['href'] = UriFactory::build($matches[1]); + $element['attributes']['href'] = UriFactory::build(\str_replace('{$CSRF}', 'ERROR', $matches[1])); if (isset($matches[2])) { $element['attributes']['title'] = \substr($matches[2], 1, - 1); @@ -4576,7 +4576,7 @@ class Markdown } $permitRawHtml = false; - $text = null; + $text = null; if (isset($element['text'])) { $text = $element['text']; diff --git a/Utils/Parser/Pdf/PdfParser.php b/Utils/Parser/Pdf/PdfParser.php index 8f6876562..fd61854ce 100755 --- a/Utils/Parser/Pdf/PdfParser.php +++ b/Utils/Parser/Pdf/PdfParser.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Parser\Pdf * @copyright Dennis Eichhorn diff --git a/Utils/Parser/Php/ArrayParser.php b/Utils/Parser/Php/ArrayParser.php index eb66bef1f..dd5a09250 100755 --- a/Utils/Parser/Php/ArrayParser.php +++ b/Utils/Parser/Php/ArrayParser.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Parser\Php * @copyright Dennis Eichhorn diff --git a/Utils/Parser/Presentation/PresentationParser.php b/Utils/Parser/Presentation/PresentationParser.php index 6bc0ed368..7bfbcf0df 100755 --- a/Utils/Parser/Presentation/PresentationParser.php +++ b/Utils/Parser/Presentation/PresentationParser.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Parser\Presentation * @copyright Dennis Eichhorn diff --git a/Utils/Parser/Presentation/PresentationWriter.php b/Utils/Parser/Presentation/PresentationWriter.php index 96c25e2e6..c114a8506 100755 --- a/Utils/Parser/Presentation/PresentationWriter.php +++ b/Utils/Parser/Presentation/PresentationWriter.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Parser\Presentation * @copyright Dennis Eichhorn diff --git a/Utils/Parser/Spreadsheet/SpreadsheetParser.php b/Utils/Parser/Spreadsheet/SpreadsheetParser.php index b85fc0f4c..61bfa78e7 100755 --- a/Utils/Parser/Spreadsheet/SpreadsheetParser.php +++ b/Utils/Parser/Spreadsheet/SpreadsheetParser.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Parser\Spreadsheet * @copyright Dennis Eichhorn diff --git a/Utils/Parser/Spreadsheet/SpreadsheetWriter.php b/Utils/Parser/Spreadsheet/SpreadsheetWriter.php index 5ddf7fae6..428126223 100755 --- a/Utils/Parser/Spreadsheet/SpreadsheetWriter.php +++ b/Utils/Parser/Spreadsheet/SpreadsheetWriter.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Parser\Spreadsheet * @copyright Dennis Eichhorn diff --git a/Utils/Parser/Xml/XmlParser.php b/Utils/Parser/Xml/XmlParser.php index 3c772a652..c872e6e82 100644 --- a/Utils/Parser/Xml/XmlParser.php +++ b/Utils/Parser/Xml/XmlParser.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\Parser\Xml * @copyright Dennis Eichhorn diff --git a/Utils/Permutation.php b/Utils/Permutation.php index d2f62106e..1ba4211d6 100755 --- a/Utils/Permutation.php +++ b/Utils/Permutation.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils * @copyright Dennis Eichhorn diff --git a/Utils/RnG/ArrayRandomize.php b/Utils/RnG/ArrayRandomize.php index 6619e3b11..69bc70969 100755 --- a/Utils/RnG/ArrayRandomize.php +++ b/Utils/RnG/ArrayRandomize.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\RnG * @copyright Dennis Eichhorn diff --git a/Utils/RnG/DateTime.php b/Utils/RnG/DateTime.php index 704a8e39f..7c7b495d7 100755 --- a/Utils/RnG/DateTime.php +++ b/Utils/RnG/DateTime.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\RnG * @copyright Dennis Eichhorn diff --git a/Utils/RnG/DistributionType.php b/Utils/RnG/DistributionType.php index d9e5df948..2f86b31fa 100755 --- a/Utils/RnG/DistributionType.php +++ b/Utils/RnG/DistributionType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\RnG * @copyright Dennis Eichhorn diff --git a/Utils/RnG/Email.php b/Utils/RnG/Email.php index 50a71dcca..aea5b38e8 100755 --- a/Utils/RnG/Email.php +++ b/Utils/RnG/Email.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\RnG * @copyright Dennis Eichhorn diff --git a/Utils/RnG/File.php b/Utils/RnG/File.php index 87288bf29..f4578b4fc 100755 --- a/Utils/RnG/File.php +++ b/Utils/RnG/File.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\RnG * @copyright Dennis Eichhorn diff --git a/Utils/RnG/LinearCongruentialGenerator.php b/Utils/RnG/LinearCongruentialGenerator.php index c10e42258..a48e96b3d 100755 --- a/Utils/RnG/LinearCongruentialGenerator.php +++ b/Utils/RnG/LinearCongruentialGenerator.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\RnG * @copyright Dennis Eichhorn diff --git a/Utils/RnG/Name.php b/Utils/RnG/Name.php index dff549c46..964c8c043 100755 --- a/Utils/RnG/Name.php +++ b/Utils/RnG/Name.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\RnG * @copyright Dennis Eichhorn diff --git a/Utils/RnG/Number.php b/Utils/RnG/Number.php index 3bc1a7c47..84a6e78c7 100644 --- a/Utils/RnG/Number.php +++ b/Utils/RnG/Number.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\RnG * @copyright Dennis Eichhorn diff --git a/Utils/RnG/Phone.php b/Utils/RnG/Phone.php index 805c42f3b..87246f6f8 100755 --- a/Utils/RnG/Phone.php +++ b/Utils/RnG/Phone.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\RnG * @copyright Dennis Eichhorn diff --git a/Utils/RnG/StringUtils.php b/Utils/RnG/StringUtils.php index 1cc6c73d0..f297c26b8 100755 --- a/Utils/RnG/StringUtils.php +++ b/Utils/RnG/StringUtils.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\RnG * @copyright Dennis Eichhorn diff --git a/Utils/RnG/Text.php b/Utils/RnG/Text.php index d07cc0236..c338c3cfc 100755 --- a/Utils/RnG/Text.php +++ b/Utils/RnG/Text.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\RnG * @copyright Dennis Eichhorn diff --git a/Utils/RnG/UUID.php b/Utils/RnG/UUID.php index a7661145f..968574c16 100755 --- a/Utils/RnG/UUID.php +++ b/Utils/RnG/UUID.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\RnG * @copyright Dennis Eichhorn diff --git a/Utils/StringCompare.php b/Utils/StringCompare.php index fbdc02609..2e8c09528 100755 --- a/Utils/StringCompare.php +++ b/Utils/StringCompare.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils * @copyright Dennis Eichhorn diff --git a/Utils/StringUtils.php b/Utils/StringUtils.php index e82295714..deea46ac8 100755 --- a/Utils/StringUtils.php +++ b/Utils/StringUtils.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils * @copyright Dennis Eichhorn diff --git a/Utils/TaskSchedule/Cron.php b/Utils/TaskSchedule/Cron.php index e3b98a063..47b558e3a 100755 --- a/Utils/TaskSchedule/Cron.php +++ b/Utils/TaskSchedule/Cron.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\TaskSchedule * @copyright Dennis Eichhorn diff --git a/Utils/TaskSchedule/CronJob.php b/Utils/TaskSchedule/CronJob.php index 496676342..400bd242f 100755 --- a/Utils/TaskSchedule/CronJob.php +++ b/Utils/TaskSchedule/CronJob.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\TaskSchedule * @copyright Dennis Eichhorn diff --git a/Utils/TaskSchedule/Interval.php b/Utils/TaskSchedule/Interval.php index 775f061f4..b76a5c4fa 100755 --- a/Utils/TaskSchedule/Interval.php +++ b/Utils/TaskSchedule/Interval.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\TaskSchedule * @copyright Dennis Eichhorn diff --git a/Utils/TaskSchedule/NullCronJob.php b/Utils/TaskSchedule/NullCronJob.php index b0e856e53..ca25083a6 100755 --- a/Utils/TaskSchedule/NullCronJob.php +++ b/Utils/TaskSchedule/NullCronJob.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\TaskSchedule * @copyright Dennis Eichhorn diff --git a/Utils/TaskSchedule/NullSchedule.php b/Utils/TaskSchedule/NullSchedule.php index 7607d2156..6b7805130 100755 --- a/Utils/TaskSchedule/NullSchedule.php +++ b/Utils/TaskSchedule/NullSchedule.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\TaskSchedule * @copyright Dennis Eichhorn diff --git a/Utils/TaskSchedule/Schedule.php b/Utils/TaskSchedule/Schedule.php index 9991020d8..52547659c 100755 --- a/Utils/TaskSchedule/Schedule.php +++ b/Utils/TaskSchedule/Schedule.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\TaskSchedule * @copyright Dennis Eichhorn diff --git a/Utils/TaskSchedule/SchedulerAbstract.php b/Utils/TaskSchedule/SchedulerAbstract.php index 1efc8c096..41a21b00b 100755 --- a/Utils/TaskSchedule/SchedulerAbstract.php +++ b/Utils/TaskSchedule/SchedulerAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\TaskSchedule * @copyright Dennis Eichhorn diff --git a/Utils/TaskSchedule/SchedulerFactory.php b/Utils/TaskSchedule/SchedulerFactory.php index 880b5e04e..0e9f8091c 100755 --- a/Utils/TaskSchedule/SchedulerFactory.php +++ b/Utils/TaskSchedule/SchedulerFactory.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\TaskSchedule * @copyright Dennis Eichhorn diff --git a/Utils/TaskSchedule/TaskAbstract.php b/Utils/TaskSchedule/TaskAbstract.php index 586720f0b..b786bea50 100755 --- a/Utils/TaskSchedule/TaskAbstract.php +++ b/Utils/TaskSchedule/TaskAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\TaskSchedule * @copyright Dennis Eichhorn diff --git a/Utils/TaskSchedule/TaskFactory.php b/Utils/TaskSchedule/TaskFactory.php index eaeb978b9..af011a40e 100755 --- a/Utils/TaskSchedule/TaskFactory.php +++ b/Utils/TaskSchedule/TaskFactory.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\TaskSchedule * @copyright Dennis Eichhorn diff --git a/Utils/TaskSchedule/TaskScheduler.php b/Utils/TaskSchedule/TaskScheduler.php index cdba42256..dc5542108 100755 --- a/Utils/TaskSchedule/TaskScheduler.php +++ b/Utils/TaskSchedule/TaskScheduler.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\TaskSchedule * @copyright Dennis Eichhorn diff --git a/Utils/TaskSchedule/TaskStatus.php b/Utils/TaskSchedule/TaskStatus.php index 8a3f03a56..b847cf7e6 100755 --- a/Utils/TaskSchedule/TaskStatus.php +++ b/Utils/TaskSchedule/TaskStatus.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils\TaskSchedule * @copyright Dennis Eichhorn diff --git a/Utils/TestUtils.php b/Utils/TestUtils.php index 882da0e70..49e420335 100755 --- a/Utils/TestUtils.php +++ b/Utils/TestUtils.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Utils * @copyright Dennis Eichhorn diff --git a/Validation/Base/DateTime.php b/Validation/Base/DateTime.php index 38ddbcfc9..310408959 100755 --- a/Validation/Base/DateTime.php +++ b/Validation/Base/DateTime.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Validation\Base * @copyright Dennis Eichhorn diff --git a/Validation/Base/Json.php b/Validation/Base/Json.php index 78e285cec..94d7d758b 100755 --- a/Validation/Base/Json.php +++ b/Validation/Base/Json.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Validation\Base * @copyright Dennis Eichhorn diff --git a/Validation/Finance/BIC.php b/Validation/Finance/BIC.php index d63dc9004..1c538b2e1 100755 --- a/Validation/Finance/BIC.php +++ b/Validation/Finance/BIC.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Validation\Finance * @copyright Dennis Eichhorn diff --git a/Validation/Finance/CreditCard.php b/Validation/Finance/CreditCard.php index 05a292010..667d36fb6 100755 --- a/Validation/Finance/CreditCard.php +++ b/Validation/Finance/CreditCard.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Validation\Finance * @copyright Dennis Eichhorn diff --git a/Validation/Finance/EUVat.php b/Validation/Finance/EUVat.php index 92e1776e3..13a986a78 100644 --- a/Validation/Finance/EUVat.php +++ b/Validation/Finance/EUVat.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Validation\Finance * @copyright Dennis Eichhorn diff --git a/Validation/Finance/Iban.php b/Validation/Finance/Iban.php index e30f2b803..110da4815 100755 --- a/Validation/Finance/Iban.php +++ b/Validation/Finance/Iban.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Validation\Finance * @copyright Dennis Eichhorn diff --git a/Validation/Finance/IbanEnum.php b/Validation/Finance/IbanEnum.php index 31c7ec98e..a7cc92e25 100755 --- a/Validation/Finance/IbanEnum.php +++ b/Validation/Finance/IbanEnum.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Validation\Finance * @copyright Dennis Eichhorn diff --git a/Validation/Finance/IbanErrorType.php b/Validation/Finance/IbanErrorType.php index 66b0d0226..b3c6a8f56 100755 --- a/Validation/Finance/IbanErrorType.php +++ b/Validation/Finance/IbanErrorType.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Validation\Finance * @copyright Dennis Eichhorn diff --git a/Validation/Network/Email.php b/Validation/Network/Email.php index 81a6dc209..4a27bd24f 100755 --- a/Validation/Network/Email.php +++ b/Validation/Network/Email.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Validation\Network * @copyright Dennis Eichhorn diff --git a/Validation/Network/Hostname.php b/Validation/Network/Hostname.php index 7b6aa25a5..e0231b565 100755 --- a/Validation/Network/Hostname.php +++ b/Validation/Network/Hostname.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Validation\Network * @copyright Dennis Eichhorn diff --git a/Validation/Network/Ip.php b/Validation/Network/Ip.php index dafffce06..90f1fa4f5 100755 --- a/Validation/Network/Ip.php +++ b/Validation/Network/Ip.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Validation\Network * @copyright Dennis Eichhorn diff --git a/Validation/Validator.php b/Validation/Validator.php index 80d879cf7..4899ca51a 100755 --- a/Validation/Validator.php +++ b/Validation/Validator.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Validation * @copyright Dennis Eichhorn diff --git a/Validation/ValidatorAbstract.php b/Validation/ValidatorAbstract.php index 0849f793e..8cb8f48cb 100755 --- a/Validation/ValidatorAbstract.php +++ b/Validation/ValidatorAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Validation * @copyright Dennis Eichhorn diff --git a/Validation/ValidatorInterface.php b/Validation/ValidatorInterface.php index 48b419fab..8146d562b 100755 --- a/Validation/ValidatorInterface.php +++ b/Validation/ValidatorInterface.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Validation * @copyright Dennis Eichhorn diff --git a/Version/Version.php b/Version/Version.php index 8aecd7ca7..649d91dd7 100755 --- a/Version/Version.php +++ b/Version/Version.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Version * @copyright Dennis Eichhorn diff --git a/Views/NullView.php b/Views/NullView.php index 9b15de165..0ba87faab 100755 --- a/Views/NullView.php +++ b/Views/NullView.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Views * @copyright Dennis Eichhorn diff --git a/Views/PaginationView.php b/Views/PaginationView.php index 688e8167b..30f08d456 100755 --- a/Views/PaginationView.php +++ b/Views/PaginationView.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Views * @copyright Dennis Eichhorn diff --git a/Views/View.php b/Views/View.php index 15863d165..335dafb96 100755 --- a/Views/View.php +++ b/Views/View.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Views * @copyright Dennis Eichhorn @@ -307,6 +307,22 @@ class View extends ViewAbstract return \htmlspecialchars($this->getText($translation, $module, $theme)); } + /** + * Print html output. + * + * @param ?string $text Text + * + * @return string + * + * @since 1.0.0 + */ + public function printTextarea(?string $text) : string + { + return $text === null + ? '' + : \trim(\str_replace(["\r\n", "\n"], [' ', ' '], \htmlspecialchars($text))); + } + /** * Print a numeric value * diff --git a/Views/ViewAbstract.php b/Views/ViewAbstract.php index f218c0274..f0a85087c 100755 --- a/Views/ViewAbstract.php +++ b/Views/ViewAbstract.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\Views * @copyright Dennis Eichhorn diff --git a/composer.json b/composer.json index e7054bd27..cde54837d 100755 --- a/composer.json +++ b/composer.json @@ -8,15 +8,14 @@ } ], "require-dev": { - "phpunit/phpunit": ">=9.4", - "friendsofphp/php-cs-fixer": ">=3.8", - "squizlabs/php_codesniffer": ">=3.6", + "phpunit/phpunit": ">=11.0", + "friendsofphp/php-cs-fixer": ">=3.51", + "squizlabs/php_codesniffer": ">=3.7", "phpmd/phpmd": ">=2.9", - "phpstan/phpstan": ">=1.8.6", + "phpstan/phpstan": ">=1.10.62", "phan/phan": ">=3.2.6", - "phploc/phploc": ">=7.0", "phpmetrics/phpmetrics": ">=2.8", - "rector/rector": ">=0.18.0" + "rector/rector": ">=1.0.3" }, "minimum-stability": "dev", "prefer-stable": true diff --git a/composer.lock b/composer.lock index 04ef4e13a..1865c69cc 100755 --- a/composer.lock +++ b/composer.lock @@ -4,21 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9bcc9266d17ea8738b9c48f84f6cb515", + "content-hash": "f04e82fc37d1d7e2693a7ea32d4571ca", "packages": [], "packages-dev": [ { "name": "composer/pcre", - "version": "3.1.0", + "version": "3.1.3", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" + "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", - "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "url": "https://api.github.com/repos/composer/pcre/zipball/5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", + "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", "shasum": "" }, "require": { @@ -60,7 +60,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.0" + "source": "https://github.com/composer/pcre/tree/3.1.3" }, "funding": [ { @@ -76,7 +76,7 @@ "type": "tidelift" } ], - "time": "2022-11-17T09:50:14+00:00" + "time": "2024-03-19T10:26:25+00:00" }, { "name": "composer/semver", @@ -161,16 +161,16 @@ }, { "name": "composer/xdebug-handler", - "version": "3.0.3", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" + "reference": "4f988f8fdf580d53bdb2d1278fe93d1ed5462255" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", - "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/4f988f8fdf580d53bdb2d1278fe93d1ed5462255", + "reference": "4f988f8fdf580d53bdb2d1278fe93d1ed5462255", "shasum": "" }, "require": { @@ -181,7 +181,7 @@ "require-dev": { "phpstan/phpstan": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^6.0" + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, "type": "library", "autoload": { @@ -205,9 +205,9 @@ "performance" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.4" }, "funding": [ { @@ -223,20 +223,20 @@ "type": "tidelift" } ], - "time": "2022-02-25T21:32:43+00:00" + "time": "2024-03-26T18:29:49+00:00" }, { "name": "doctrine/deprecations", - "version": "v1.1.1", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3" + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", - "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", "shasum": "" }, "require": { @@ -268,79 +268,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v1.1.1" + "source": "https://github.com/doctrine/deprecations/tree/1.1.3" }, - "time": "2023-06-03T09:27:29+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "doctrine/coding-standard": "^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/2.0.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-12-30T00:23:10+00:00" + "time": "2024-01-30T19:34:25+00:00" }, { "name": "felixfbecker/advanced-json-rpc", @@ -389,52 +319,50 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.28.0", + "version": "v3.54.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "113e09fea3d2306319ffaa2423fe3de768b28cff" + "reference": "2aecbc8640d7906c38777b3dcab6f4ca79004d08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/113e09fea3d2306319ffaa2423fe3de768b28cff", - "reference": "113e09fea3d2306319ffaa2423fe3de768b28cff", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/2aecbc8640d7906c38777b3dcab6f4ca79004d08", + "reference": "2aecbc8640d7906c38777b3dcab6f4ca79004d08", "shasum": "" }, "require": { - "composer/semver": "^3.3", + "composer/semver": "^3.4", "composer/xdebug-handler": "^3.0.3", + "ext-filter": "*", "ext-json": "*", "ext-tokenizer": "*", "php": "^7.4 || ^8.0", - "sebastian/diff": "^4.0 || ^5.0", - "symfony/console": "^5.4 || ^6.0", - "symfony/event-dispatcher": "^5.4 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0", - "symfony/finder": "^5.4 || ^6.0", - "symfony/options-resolver": "^5.4 || ^6.0", - "symfony/polyfill-mbstring": "^1.27", - "symfony/polyfill-php80": "^1.27", - "symfony/polyfill-php81": "^1.27", - "symfony/process": "^5.4 || ^6.0", - "symfony/stopwatch": "^5.4 || ^6.0" + "sebastian/diff": "^4.0 || ^5.0 || ^6.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.28", + "symfony/polyfill-php80": "^1.28", + "symfony/polyfill-php81": "^1.28", + "symfony/process": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { "facile-it/paraunit": "^1.3 || ^2.0", + "infection/infection": "^0.27.11", "justinrainbow/json-schema": "^5.2", - "keradus/cli-executor": "^2.0", + "keradus/cli-executor": "^2.1", "mikey179/vfsstream": "^1.6.11", - "php-coveralls/php-coveralls": "^2.5.3", + "php-coveralls/php-coveralls": "^2.7", "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy": "^1.16", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "phpunitgoodpractices/polyfill": "^1.6", - "phpunitgoodpractices/traits": "^1.9.2", - "symfony/phpunit-bridge": "^6.2.3", - "symfony/yaml": "^5.4 || ^6.0" + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", + "phpunit/phpunit": "^9.6 || ^10.5.5 || ^11.0.2", + "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" }, "suggest": { "ext-dom": "For handling output formats in XML", @@ -472,7 +400,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.28.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.54.0" }, "funding": [ { @@ -480,7 +408,7 @@ "type": "github" } ], - "time": "2023-09-22T20:43:40+00:00" + "time": "2024-04-17T08:12:13+00:00" }, { "name": "microsoft/tolerant-php-parser", @@ -588,16 +516,16 @@ }, { "name": "netresearch/jsonmapper", - "version": "v4.2.0", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "f60565f8c0566a31acf06884cdaa591867ecc956" + "reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/f60565f8c0566a31acf06884cdaa591867ecc956", - "reference": "f60565f8c0566a31acf06884cdaa591867ecc956", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/132c75c7dd83e45353ebb9c6c9f591952995bbf0", + "reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0", "shasum": "" }, "require": { @@ -608,7 +536,7 @@ "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0", + "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0 || ~10.0", "squizlabs/php_codesniffer": "~3.5" }, "type": "library", @@ -633,31 +561,33 @@ "support": { "email": "cweiske@cweiske.de", "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v4.2.0" + "source": "https://github.com/cweiske/jsonmapper/tree/v4.4.1" }, - "time": "2023-04-09T17:37:40+00:00" + "time": "2024-01-31T06:18:54+00:00" }, { "name": "nikic/php-parser", - "version": "v4.17.1", + "version": "v5.0.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", "shasum": "" }, "require": { + "ext-ctype": "*", + "ext-json": "*", "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.4" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -665,7 +595,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -689,34 +619,34 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" }, - "time": "2023-08-13T19:53:39+00:00" + "time": "2024-03-05T20:51:40+00:00" }, { "name": "pdepend/pdepend", - "version": "2.15.0", + "version": "2.16.2", "source": { "type": "git", "url": "https://github.com/pdepend/pdepend.git", - "reference": "0d4d8fb87aa74c358c1c4364514017f34b4a68b9" + "reference": "f942b208dc2a0868454d01b29f0c75bbcfc6ed58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pdepend/pdepend/zipball/0d4d8fb87aa74c358c1c4364514017f34b4a68b9", - "reference": "0d4d8fb87aa74c358c1c4364514017f34b4a68b9", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/f942b208dc2a0868454d01b29f0c75bbcfc6ed58", + "reference": "f942b208dc2a0868454d01b29f0c75bbcfc6ed58", "shasum": "" }, "require": { "php": ">=5.3.7", - "symfony/config": "^2.3.0|^3|^4|^5|^6.0", - "symfony/dependency-injection": "^2.3.0|^3|^4|^5|^6.0", - "symfony/filesystem": "^2.3.0|^3|^4|^5|^6.0" + "symfony/config": "^2.3.0|^3|^4|^5|^6.0|^7.0", + "symfony/dependency-injection": "^2.3.0|^3|^4|^5|^6.0|^7.0", + "symfony/filesystem": "^2.3.0|^3|^4|^5|^6.0|^7.0", + "symfony/polyfill-mbstring": "^1.19" }, "require-dev": { "easy-doc/easy-doc": "0.0.0|^1.2.3", "gregwar/rst": "^1.0", - "phpunit/phpunit": "^4.8.36|^5.7.27", "squizlabs/php_codesniffer": "^2.0.0" }, "bin": [ @@ -746,7 +676,7 @@ ], "support": { "issues": "https://github.com/pdepend/pdepend/issues", - "source": "https://github.com/pdepend/pdepend/tree/2.15.0" + "source": "https://github.com/pdepend/pdepend/tree/2.16.2" }, "funding": [ { @@ -754,20 +684,20 @@ "type": "tidelift" } ], - "time": "2023-09-22T02:30:39+00:00" + "time": "2023-12-17T18:09:59+00:00" }, { "name": "phan/phan", - "version": "5.4.2", + "version": "5.4.3", "source": { "type": "git", "url": "https://github.com/phan/phan.git", - "reference": "4f2870ed6fea320f62f3c3c63f3274d357a7980e" + "reference": "86a7acd99c1239b8867b49feca2398851212e7fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phan/phan/zipball/4f2870ed6fea320f62f3c3c63f3274d357a7980e", - "reference": "4f2870ed6fea320f62f3c3c63f3274d357a7980e", + "url": "https://api.github.com/repos/phan/phan/zipball/86a7acd99c1239b8867b49feca2398851212e7fe", + "reference": "86a7acd99c1239b8867b49feca2398851212e7fe", "shasum": "" }, "require": { @@ -781,7 +711,7 @@ "netresearch/jsonmapper": "^1.6.0|^2.0|^3.0|^4.0", "php": "^7.2.0|^8.0.0", "sabre/event": "^5.1.3", - "symfony/console": "^3.2|^4.0|^5.0|^6.0", + "symfony/console": "^3.2|^4.0|^5.0|^6.0|^7.0", "symfony/polyfill-mbstring": "^1.11.0", "symfony/polyfill-php80": "^1.20.0", "tysonandre/var_representation_polyfill": "^0.0.2|^0.1.0" @@ -827,30 +757,32 @@ "keywords": [ "analyzer", "php", - "static" + "static", + "static analysis" ], "support": { "issues": "https://github.com/phan/phan/issues", - "source": "https://github.com/phan/phan/tree/5.4.2" + "source": "https://github.com/phan/phan/tree/5.4.3" }, - "time": "2023-03-03T17:20:24+00:00" + "time": "2023-12-26T17:57:35+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", @@ -891,9 +823,15 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", @@ -1001,28 +939,35 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", + "version": "5.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + "reference": "298d2febfe79d03fe714eb871d5538da55205b1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/298d2febfe79d03fe714eb871d5538da55205b1a", + "reference": "298d2febfe79d03fe714eb871d5538da55205b1a", "shasum": "" }, "require": { + "doctrine/deprecations": "^1.1", "ext-filter": "*", - "php": "^7.2 || ^8.0", + "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", + "phpdocumentor/type-resolver": "^1.7", + "phpstan/phpdoc-parser": "^1.7", "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" + "mockery/mockery": "~1.3.5", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-webmozart-assert": "^1.2", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^5.13" }, "type": "library", "extra": { @@ -1046,33 +991,33 @@ }, { "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" + "email": "opensource@ijaap.nl" } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.0" }, - "time": "2021-10-19T17:43:47+00:00" + "time": "2024-04-09T21:13:58+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.7.3", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419" + "reference": "153ae662783729388a584b4361f2545e4d841e3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419", - "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", + "reference": "153ae662783729388a584b4361f2545e4d841e3c", "shasum": "" }, "require": { "doctrine/deprecations": "^1.0", - "php": "^7.4 || ^8.0", + "php": "^7.3 || ^8.0", "phpdocumentor/reflection-common": "^2.0", "phpstan/phpdoc-parser": "^1.13" }, @@ -1110,90 +1055,28 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.3" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2" }, - "time": "2023-08-12T11:01:26+00:00" - }, - { - "name": "phploc/phploc", - "version": "7.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phploc.git", - "reference": "af0d5fc84f3f7725513ba59cdcbe670ac2a4532a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phploc/zipball/af0d5fc84f3f7725513ba59cdcbe670ac2a4532a", - "reference": "af0d5fc84f3f7725513ba59cdcbe670ac2a4532a", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0", - "sebastian/cli-parser": "^1.0", - "sebastian/version": "^3.0" - }, - "bin": [ - "phploc" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "A tool for quickly measuring the size of a PHP project.", - "homepage": "https://github.com/sebastianbergmann/phploc", - "support": { - "issues": "https://github.com/sebastianbergmann/phploc/issues", - "source": "https://github.com/sebastianbergmann/phploc/tree/7.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "abandoned": true, - "time": "2020-12-07T05:51:20+00:00" + "time": "2024-02-23T11:10:43+00:00" }, { "name": "phpmd/phpmd", - "version": "2.13.0", + "version": "2.15.0", "source": { "type": "git", "url": "https://github.com/phpmd/phpmd.git", - "reference": "dad0228156856b3ad959992f9748514fa943f3e3" + "reference": "74a1f56e33afad4128b886e334093e98e1b5e7c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmd/phpmd/zipball/dad0228156856b3ad959992f9748514fa943f3e3", - "reference": "dad0228156856b3ad959992f9748514fa943f3e3", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/74a1f56e33afad4128b886e334093e98e1b5e7c0", + "reference": "74a1f56e33afad4128b886e334093e98e1b5e7c0", "shasum": "" }, "require": { "composer/xdebug-handler": "^1.0 || ^2.0 || ^3.0", "ext-xml": "*", - "pdepend/pdepend": "^2.12.1", + "pdepend/pdepend": "^2.16.1", "php": ">=5.3.9" }, "require-dev": { @@ -1202,8 +1085,7 @@ "ext-simplexml": "*", "gregwar/rst": "^1.0", "mikey179/vfsstream": "^1.6.8", - "phpunit/phpunit": "^4.8.36 || ^5.7.27", - "squizlabs/php_codesniffer": "^2.0" + "squizlabs/php_codesniffer": "^2.9.2 || ^3.7.2" }, "bin": [ "src/bin/phpmd" @@ -1240,6 +1122,7 @@ "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.", "homepage": "https://phpmd.org/", "keywords": [ + "dev", "mess detection", "mess detector", "pdepend", @@ -1249,7 +1132,7 @@ "support": { "irc": "irc://irc.freenode.org/phpmd", "issues": "https://github.com/phpmd/phpmd/issues", - "source": "https://github.com/phpmd/phpmd/tree/2.13.0" + "source": "https://github.com/phpmd/phpmd/tree/2.15.0" }, "funding": [ { @@ -1257,48 +1140,55 @@ "type": "tidelift" } ], - "time": "2022-09-10T08:44:15+00:00" + "time": "2023-12-11T08:22:20+00:00" }, { "name": "phpmetrics/phpmetrics", - "version": "v2.8.2", + "version": "v3.0.0rc6", "source": { "type": "git", "url": "https://github.com/phpmetrics/PhpMetrics.git", - "reference": "4b77140a11452e63c7a9b98e0648320bf6710090" + "reference": "6c68b4b4f863d57139cd32eee00c9bf149bf12dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmetrics/PhpMetrics/zipball/4b77140a11452e63c7a9b98e0648320bf6710090", - "reference": "4b77140a11452e63c7a9b98e0648320bf6710090", + "url": "https://api.github.com/repos/phpmetrics/PhpMetrics/zipball/6c68b4b4f863d57139cd32eee00c9bf149bf12dd", + "reference": "6c68b4b4f863d57139cd32eee00c9bf149bf12dd", "shasum": "" }, "require": { - "ext-dom": "*", "ext-tokenizer": "*", - "nikic/php-parser": "^3|^4", - "php": ">=5.5" + "nikic/php-parser": "^5.0", + "php": ">=8.1" }, "replace": { "halleck45/php-metrics": "*", "halleck45/phpmetrics": "*" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14", - "sebastian/comparator": ">=1.2.3", - "squizlabs/php_codesniffer": "^3.5", - "symfony/dom-crawler": "^3.0 || ^4.0 || ^5.0" + "phake/phake": "^4.4.0", + "phpstan/extension-installer": "^1.3", + "phpstan/phpstan": "^1.10", + "phpstan/phpstan-deprecation-rules": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpstan/phpstan-strict-rules": "^1.5", + "phpunit/phpunit": "^10.5", + "roave/security-advisories": "dev-latest", + "sebastian/comparator": ">=5.0.0", + "squizlabs/php_codesniffer": "^3.8", + "symfony/dom-crawler": "^6.4" + }, + "suggest": { + "ext-dom": "To allow XML parsing and report results.", + "ext-yaml": "To allow yaml parsing of configuration files." }, "bin": [ "bin/phpmetrics" ], "type": "library", "autoload": { - "files": [ - "./src/functions.php" - ], - "psr-0": { - "Hal\\": "./src/" + "psr-4": { + "Hal\\": "src/Hal" } }, "notification-url": "https://packagist.org/downloads/", @@ -1323,22 +1213,22 @@ ], "support": { "issues": "https://github.com/PhpMetrics/PhpMetrics/issues", - "source": "https://github.com/phpmetrics/PhpMetrics/tree/v2.8.2" + "source": "https://github.com/phpmetrics/PhpMetrics/tree/v3.0.0rc6" }, - "time": "2023-03-08T15:03:36+00:00" + "time": "2024-02-08T11:24:59+00:00" }, { "name": "phpstan/phpdoc-parser", - "version": "1.24.1", + "version": "1.28.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "9f854d275c2dbf84915a5c0ec9a2d17d2cd86b01" + "reference": "cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/9f854d275c2dbf84915a5c0ec9a2d17d2cd86b01", - "reference": "9f854d275c2dbf84915a5c0ec9a2d17d2cd86b01", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb", + "reference": "cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb", "shasum": "" }, "require": { @@ -1370,22 +1260,22 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.28.0" }, - "time": "2023-09-18T12:18:02+00:00" + "time": "2024-04-03T18:51:33+00:00" }, { "name": "phpstan/phpstan", - "version": "1.10.35", + "version": "1.10.67", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e730e5facb75ffe09dfb229795e8c01a459f26c3" + "reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e730e5facb75ffe09dfb229795e8c01a459f26c3", - "reference": "e730e5facb75ffe09dfb229795e8c01a459f26c3", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/16ddbe776f10da6a95ebd25de7c1dbed397dc493", + "reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493", "shasum": "" }, "require": { @@ -1428,45 +1318,41 @@ { "url": "https://github.com/phpstan", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" } ], - "time": "2023-09-19T15:27:56+00:00" + "time": "2024-04-16T07:22:02+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.29", + "version": "11.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76" + "reference": "7e35a2cbcabac0e6865fd373742ea432a3c34f92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76", - "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7e35a2cbcabac0e6865fd373742ea432a3c34f92", + "reference": "7e35a2cbcabac0e6865fd373742ea432a3c34f92", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.15", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", + "nikic/php-parser": "^5.0", + "php": ">=8.2", + "phpunit/php-file-iterator": "^5.0", + "phpunit/php-text-template": "^4.0", + "sebastian/code-unit-reverse-lookup": "^4.0", + "sebastian/complexity": "^4.0", + "sebastian/environment": "^7.0", + "sebastian/lines-of-code": "^3.0", + "sebastian/version": "^5.0", "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -1475,7 +1361,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "11.0-dev" } }, "autoload": { @@ -1504,7 +1390,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.3" }, "funding": [ { @@ -1512,32 +1398,32 @@ "type": "github" } ], - "time": "2023-09-19T04:57:46+00:00" + "time": "2024-03-12T15:35:40+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "reference": "99e95c94ad9500daca992354fa09d7b99abe2210" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/99e95c94ad9500daca992354fa09d7b99abe2210", + "reference": "99e95c94ad9500daca992354fa09d7b99abe2210", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -1564,7 +1450,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.0.0" }, "funding": [ { @@ -1572,28 +1459,28 @@ "type": "github" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2024-02-02T06:05:04+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.1.1", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "reference": "5d8d9355a16d8cc5a1305b0a85342cfa420612be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5d8d9355a16d8cc5a1305b0a85342cfa420612be", + "reference": "5d8d9355a16d8cc5a1305b0a85342cfa420612be", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "suggest": { "ext-pcntl": "*" @@ -1601,7 +1488,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -1627,7 +1514,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/5.0.0" }, "funding": [ { @@ -1635,32 +1523,32 @@ "type": "github" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2024-02-02T06:05:50+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.4", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "reference": "d38f6cbff1cdb6f40b03c9811421561668cc133e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/d38f6cbff1cdb6f40b03c9811421561668cc133e", + "reference": "d38f6cbff1cdb6f40b03c9811421561668cc133e", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -1686,7 +1574,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/4.0.0" }, "funding": [ { @@ -1694,32 +1583,32 @@ "type": "github" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2024-02-02T06:06:56+00:00" }, { "name": "phpunit/php-timer", - "version": "5.0.3", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "reference": "8a59d9e25720482ee7fcdf296595e08795b84dc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8a59d9e25720482ee7fcdf296595e08795b84dc5", + "reference": "8a59d9e25720482ee7fcdf296595e08795b84dc5", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -1745,7 +1634,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "security": "https://github.com/sebastianbergmann/php-timer/security/policy", + "source": "https://github.com/sebastianbergmann/php-timer/tree/7.0.0" }, "funding": [ { @@ -1753,24 +1643,23 @@ "type": "github" } ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2024-02-02T06:08:01+00:00" }, { "name": "phpunit/phpunit", - "version": "9.6.13", + "version": "11.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be" + "reference": "d475be032238173ca3b0a516f5cc291d174708ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3d767f7f9e191eab4189abe41ab37797e30b1be", - "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d475be032238173ca3b0a516f5cc291d174708ae", + "reference": "d475be032238173ca3b0a516f5cc291d174708ae", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -1780,27 +1669,25 @@ "myclabs/deep-copy": "^1.10.1", "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.28", - "phpunit/php-file-iterator": "^3.0.5", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", - "sebastian/version": "^3.0.2" + "php": ">=8.2", + "phpunit/php-code-coverage": "^11.0", + "phpunit/php-file-iterator": "^5.0", + "phpunit/php-invoker": "^5.0", + "phpunit/php-text-template": "^4.0", + "phpunit/php-timer": "^7.0", + "sebastian/cli-parser": "^3.0", + "sebastian/code-unit": "^3.0", + "sebastian/comparator": "^6.0", + "sebastian/diff": "^6.0", + "sebastian/environment": "^7.0", + "sebastian/exporter": "^6.0", + "sebastian/global-state": "^7.0", + "sebastian/object-enumerator": "^6.0", + "sebastian/type": "^5.0", + "sebastian/version": "^5.0" }, "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + "ext-soap": "To be able to generate mocks based on WSDL files" }, "bin": [ "phpunit" @@ -1808,7 +1695,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" + "dev-main": "11.1-dev" } }, "autoload": { @@ -1840,7 +1727,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.13" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.1.3" }, "funding": [ { @@ -1856,7 +1743,7 @@ "type": "tidelift" } ], - "time": "2023-09-19T05:39:22+00:00" + "time": "2024-04-24T06:34:25+00:00" }, { "name": "psr/container", @@ -2013,21 +1900,21 @@ }, { "name": "rector/rector", - "version": "0.18.3", + "version": "1.0.4", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "ba7988e3e028e68e07191d75b0d5473ac320c5e7" + "reference": "6e04d0eb087aef707fa0c5686d33d6ff61f4a555" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/ba7988e3e028e68e07191d75b0d5473ac320c5e7", - "reference": "ba7988e3e028e68e07191d75b0d5473ac320c5e7", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/6e04d0eb087aef707fa0c5686d33d6ff61f4a555", + "reference": "6e04d0eb087aef707fa0c5686d33d6ff61f4a555", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.31" + "phpstan/phpstan": "^1.10.57" }, "conflict": { "rector/rector-doctrine": "*", @@ -2035,6 +1922,9 @@ "rector/rector-phpunit": "*", "rector/rector-symfony": "*" }, + "suggest": { + "ext-dom": "To manipulate phpunit.xml via the custom-rule command" + }, "bin": [ "bin/rector" ], @@ -2057,7 +1947,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.18.3" + "source": "https://github.com/rectorphp/rector/tree/1.0.4" }, "funding": [ { @@ -2065,7 +1955,7 @@ "type": "github" } ], - "time": "2023-09-12T20:18:14+00:00" + "time": "2024-04-05T09:01:07+00:00" }, { "name": "sabre/event", @@ -2135,28 +2025,28 @@ }, { "name": "sebastian/cli-parser", - "version": "1.0.1", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "reference": "00a74d5568694711f0222e54fb281e1d15fdf04a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/00a74d5568694711f0222e54fb281e1d15fdf04a", + "reference": "00a74d5568694711f0222e54fb281e1d15fdf04a", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2179,7 +2069,8 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/3.0.1" }, "funding": [ { @@ -2187,32 +2078,32 @@ "type": "github" } ], - "time": "2020-09-28T06:08:49+00:00" + "time": "2024-03-02T07:26:58+00:00" }, { "name": "sebastian/code-unit", - "version": "1.0.8", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + "reference": "6634549cb8d702282a04a774e36a7477d2bd9015" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/6634549cb8d702282a04a774e36a7477d2bd9015", + "reference": "6634549cb8d702282a04a774e36a7477d2bd9015", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2235,7 +2126,8 @@ "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + "security": "https://github.com/sebastianbergmann/code-unit/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.0" }, "funding": [ { @@ -2243,32 +2135,32 @@ "type": "github" } ], - "time": "2020-10-26T13:08:54+00:00" + "time": "2024-02-02T05:50:41+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + "reference": "df80c875d3e459b45c6039e4d9b71d4fbccae25d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/df80c875d3e459b45c6039e4d9b71d4fbccae25d", + "reference": "df80c875d3e459b45c6039e4d9b71d4fbccae25d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -2290,7 +2182,8 @@ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + "security": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/4.0.0" }, "funding": [ { @@ -2298,34 +2191,36 @@ "type": "github" } ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2024-02-02T05:52:17+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "bd0f2fa5b9257c69903537b266ccb80fcf940db8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/bd0f2fa5b9257c69903537b266ccb80fcf940db8", + "reference": "bd0f2fa5b9257c69903537b266ccb80fcf940db8", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.2", + "sebastian/diff": "^6.0", + "sebastian/exporter": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -2364,7 +2259,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/6.0.0" }, "funding": [ { @@ -2372,33 +2268,33 @@ "type": "github" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2024-02-02T05:53:45+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.2", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "reference": "88a434ad86150e11a606ac4866b09130712671f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/88a434ad86150e11a606ac4866b09130712671f0", + "reference": "88a434ad86150e11a606ac4866b09130712671f0", "shasum": "" }, "require": { - "nikic/php-parser": "^4.7", - "php": ">=7.3" + "nikic/php-parser": "^5.0", + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -2421,7 +2317,8 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/4.0.0" }, "funding": [ { @@ -2429,33 +2326,33 @@ "type": "github" } ], - "time": "2020-10-26T15:52:27+00:00" + "time": "2024-02-02T05:55:19+00:00" }, { "name": "sebastian/diff", - "version": "4.0.5", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" + "reference": "ab83243ecc233de5655b76f577711de9f842e712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ab83243ecc233de5655b76f577711de9f842e712", + "reference": "ab83243ecc233de5655b76f577711de9f842e712", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3", + "phpunit/phpunit": "^11.0", "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -2487,7 +2384,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.1" }, "funding": [ { @@ -2495,27 +2393,27 @@ "type": "github" } ], - "time": "2023-05-07T05:35:17+00:00" + "time": "2024-03-02T07:30:33+00:00" }, { "name": "sebastian/environment", - "version": "5.1.5", + "version": "7.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + "reference": "4eb3a442574d0e9d141aab209cd4aaf25701b09a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4eb3a442574d0e9d141aab209cd4aaf25701b09a", + "reference": "4eb3a442574d0e9d141aab209cd4aaf25701b09a", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "suggest": { "ext-posix": "*" @@ -2523,7 +2421,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "7.1-dev" } }, "autoload": { @@ -2542,7 +2440,7 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", @@ -2550,7 +2448,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/7.1.0" }, "funding": [ { @@ -2558,34 +2457,34 @@ "type": "github" } ], - "time": "2023-02-03T06:03:51+00:00" + "time": "2024-03-23T08:56:34+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.5", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "f291e5a317c321c0381fa9ecc796fa2d21b186da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f291e5a317c321c0381fa9ecc796fa2d21b186da", + "reference": "f291e5a317c321c0381fa9ecc796fa2d21b186da", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "ext-mbstring": "*", + "php": ">=8.2", + "sebastian/recursion-context": "^6.0" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -2627,7 +2526,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/6.0.1" }, "funding": [ { @@ -2635,38 +2535,35 @@ "type": "github" } ], - "time": "2022-09-14T06:03:37+00:00" + "time": "2024-03-02T07:28:20+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.6", + "version": "7.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bde739e7565280bda77be70044ac1047bc007e34" + "reference": "c3a307e832f2e69c7ef869e31fc644fde0e7cb3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", - "reference": "bde739e7565280bda77be70044ac1047bc007e34", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c3a307e832f2e69c7ef869e31fc644fde0e7cb3e", + "reference": "c3a307e832f2e69c7ef869e31fc644fde0e7cb3e", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -2685,13 +2582,14 @@ } ], "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/7.0.1" }, "funding": [ { @@ -2699,33 +2597,33 @@ "type": "github" } ], - "time": "2023-08-02T09:26:13+00:00" + "time": "2024-03-02T07:32:10+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.3", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "reference": "376c5b3f6b43c78fdc049740bca76a7c846706c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/376c5b3f6b43c78fdc049740bca76a7c846706c0", + "reference": "376c5b3f6b43c78fdc049740bca76a7c846706c0", "shasum": "" }, "require": { - "nikic/php-parser": "^4.6", - "php": ">=7.3" + "nikic/php-parser": "^5.0", + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2748,7 +2646,8 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/3.0.0" }, "funding": [ { @@ -2756,34 +2655,34 @@ "type": "github" } ], - "time": "2020-11-28T06:42:11+00:00" + "time": "2024-02-02T06:00:36+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.4", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "reference": "f75f6c460da0bbd9668f43a3dde0ec0ba7faa678" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f75f6c460da0bbd9668f43a3dde0ec0ba7faa678", + "reference": "f75f6c460da0bbd9668f43a3dde0ec0ba7faa678", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -2805,7 +2704,8 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/6.0.0" }, "funding": [ { @@ -2813,32 +2713,32 @@ "type": "github" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2024-02-02T06:01:29+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.4", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "reference": "bb2a6255d30853425fd38f032eb64ced9f7f132d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/bb2a6255d30853425fd38f032eb64ced9f7f132d", + "reference": "bb2a6255d30853425fd38f032eb64ced9f7f132d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -2860,7 +2760,8 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/4.0.0" }, "funding": [ { @@ -2868,32 +2769,32 @@ "type": "github" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2024-02-02T06:02:18+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.5", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "reference": "b75224967b5a466925c6d54e68edd0edf8dd4ed4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b75224967b5a466925c6d54e68edd0edf8dd4ed4", + "reference": "b75224967b5a466925c6d54e68edd0edf8dd4ed4", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -2923,7 +2824,8 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/6.0.0" }, "funding": [ { @@ -2931,87 +2833,32 @@ "type": "github" } ], - "time": "2023-02-03T06:07:39+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2024-02-02T06:08:48+00:00" }, { "name": "sebastian/type", - "version": "3.2.1", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + "reference": "b8502785eb3523ca0dd4afe9ca62235590020f3f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8502785eb3523ca0dd4afe9ca62235590020f3f", + "reference": "b8502785eb3523ca0dd4afe9ca62235590020f3f", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -3034,7 +2881,8 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + "security": "https://github.com/sebastianbergmann/type/security/policy", + "source": "https://github.com/sebastianbergmann/type/tree/5.0.0" }, "funding": [ { @@ -3042,29 +2890,29 @@ "type": "github" } ], - "time": "2023-02-03T06:13:03+00:00" + "time": "2024-02-02T06:09:34+00:00" }, { "name": "sebastian/version", - "version": "3.0.2", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "reference": "13999475d2cb1ab33cb73403ba356a814fdbb001" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/13999475d2cb1ab33cb73403ba356a814fdbb001", + "reference": "13999475d2cb1ab33cb73403ba356a814fdbb001", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -3087,7 +2935,8 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "security": "https://github.com/sebastianbergmann/version/security/policy", + "source": "https://github.com/sebastianbergmann/version/tree/5.0.0" }, "funding": [ { @@ -3095,20 +2944,20 @@ "type": "github" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2024-02-02T06:10:47+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.2", + "version": "3.9.2", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/aac1f6f347a5c5ac6bc98ad395007df00990f480", + "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480", "shasum": "" }, "require": { @@ -3118,11 +2967,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -3137,53 +2986,76 @@ "authors": [ { "name": "Greg Sherwood", - "role": "lead" + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ "phpcs", "standards", "static analysis" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, - "time": "2023-02-22T23:07:41+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-04-23T20:25:34+00:00" }, { "name": "symfony/config", - "version": "v6.3.2", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "b47ca238b03e7b0d7880ffd1cf06e8d637ca1467" + "reference": "7fc7e18a73ec8125fd95928c0340470d64760deb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/b47ca238b03e7b0d7880ffd1cf06e8d637ca1467", - "reference": "b47ca238b03e7b0d7880ffd1cf06e8d637ca1467", + "url": "https://api.github.com/repos/symfony/config/zipball/7fc7e18a73ec8125fd95928c0340470d64760deb", + "reference": "7fc7e18a73ec8125fd95928c0340470d64760deb", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/filesystem": "^5.4|^6.0", + "symfony/filesystem": "^6.4|^7.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/finder": "<5.4", + "symfony/finder": "<6.4", "symfony/service-contracts": "<2.5" }, "require-dev": { - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", - "symfony/messenger": "^5.4|^6.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3", - "symfony/yaml": "^5.4|^6.0" + "symfony/yaml": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -3211,7 +3083,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v6.3.2" + "source": "https://github.com/symfony/config/tree/v7.0.6" }, "funding": [ { @@ -3227,47 +3099,50 @@ "type": "tidelift" } ], - "time": "2023-07-19T20:22:16+00:00" + "time": "2024-03-27T19:55:25+00:00" }, { "name": "symfony/console", - "version": "v6.3.4", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "eca495f2ee845130855ddf1cf18460c38966c8b6" + "reference": "fde915cd8e7eb99b3d531d3d5c09531429c3f9e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/eca495f2ee845130855ddf1cf18460c38966c8b6", - "reference": "eca495f2ee845130855ddf1cf18460c38966c8b6", + "url": "https://api.github.com/repos/symfony/console/zipball/fde915cd8e7eb99b3d531d3d5c09531429c3f9e5", + "reference": "fde915cd8e7eb99b3d531d3d5c09531429c3f9e5", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^5.4|^6.0" + "symfony/string": "^6.4|^7.0" }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -3301,7 +3176,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.3.4" + "source": "https://github.com/symfony/console/tree/v7.0.6" }, "funding": [ { @@ -3317,44 +3192,43 @@ "type": "tidelift" } ], - "time": "2023-08-16T10:10:12+00:00" + "time": "2024-04-01T11:04:53+00:00" }, { "name": "symfony/dependency-injection", - "version": "v6.3.4", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "68a5a9570806a087982f383f6109c5e925892a49" + "reference": "ff57b5c7d518c39eeb4e69dc0d1ec70723a117b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/68a5a9570806a087982f383f6109c5e925892a49", - "reference": "68a5a9570806a087982f383f6109c5e925892a49", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/ff57b5c7d518c39eeb4e69dc0d1ec70723a117b9", + "reference": "ff57b5c7d518c39eeb4e69dc0d1ec70723a117b9", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "psr/container": "^1.1|^2.0", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/service-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.2.10" + "symfony/service-contracts": "^3.3", + "symfony/var-exporter": "^6.4|^7.0" }, "conflict": { "ext-psr": "<1.1|>=2", - "symfony/config": "<6.1", - "symfony/finder": "<5.4", - "symfony/proxy-manager-bridge": "<6.3", - "symfony/yaml": "<5.4" + "symfony/config": "<6.4", + "symfony/finder": "<6.4", + "symfony/yaml": "<6.4" }, "provide": { "psr/container-implementation": "1.1|2.0", "symfony/service-implementation": "1.1|2.0|3.0" }, "require-dev": { - "symfony/config": "^6.1", - "symfony/expression-language": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0" + "symfony/config": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/yaml": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -3382,7 +3256,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v6.3.4" + "source": "https://github.com/symfony/dependency-injection/tree/v7.0.6" }, "funding": [ { @@ -3398,11 +3272,11 @@ "type": "tidelift" } ], - "time": "2023-08-16T17:55:17+00:00" + "time": "2024-03-28T09:20:36+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.3.0", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", @@ -3449,7 +3323,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" }, "funding": [ { @@ -3469,24 +3343,24 @@ }, { "name": "symfony/event-dispatcher", - "version": "v6.3.2", + "version": "v7.0.3", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e" + "reference": "834c28d533dd0636f910909d01b9ff45cc094b5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/adb01fe097a4ee930db9258a3cc906b5beb5cf2e", - "reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/834c28d533dd0636f910909d01b9ff45cc094b5e", + "reference": "834c28d533dd0636f910909d01b9ff45cc094b5e", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<5.4", + "symfony/dependency-injection": "<6.4", "symfony/service-contracts": "<2.5" }, "provide": { @@ -3495,13 +3369,13 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/error-handler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3", - "symfony/stopwatch": "^5.4|^6.0" + "symfony/stopwatch": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -3529,7 +3403,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.3.2" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.0.3" }, "funding": [ { @@ -3545,20 +3419,20 @@ "type": "tidelift" } ], - "time": "2023-07-06T06:56:43+00:00" + "time": "2024-01-23T15:02:46+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.3.0", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "a76aed96a42d2b521153fb382d418e30d18b59df" + "reference": "4e64b49bf370ade88e567de29465762e316e4224" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df", - "reference": "a76aed96a42d2b521153fb382d418e30d18b59df", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/4e64b49bf370ade88e567de29465762e316e4224", + "reference": "4e64b49bf370ade88e567de29465762e316e4224", "shasum": "" }, "require": { @@ -3605,7 +3479,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.4.2" }, "funding": [ { @@ -3621,24 +3495,24 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2024-01-23T14:51:35+00:00" }, { "name": "symfony/filesystem", - "version": "v6.3.1", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae" + "reference": "408105dff4c104454100730bdfd1a9cdd993f04d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", - "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/408105dff4c104454100730bdfd1a9cdd993f04d", + "reference": "408105dff4c104454100730bdfd1a9cdd993f04d", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, @@ -3668,7 +3542,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.3.1" + "source": "https://github.com/symfony/filesystem/tree/v7.0.6" }, "funding": [ { @@ -3684,27 +3558,27 @@ "type": "tidelift" } ], - "time": "2023-06-01T08:30:39+00:00" + "time": "2024-03-21T19:37:36+00:00" }, { "name": "symfony/finder", - "version": "v6.3.3", + "version": "v7.0.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "9915db259f67d21eefee768c1abcf1cc61b1fc9e" + "reference": "6e5688d69f7cfc4ed4a511e96007e06c2d34ce56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9915db259f67d21eefee768c1abcf1cc61b1fc9e", - "reference": "9915db259f67d21eefee768c1abcf1cc61b1fc9e", + "url": "https://api.github.com/repos/symfony/finder/zipball/6e5688d69f7cfc4ed4a511e96007e06c2d34ce56", + "reference": "6e5688d69f7cfc4ed4a511e96007e06c2d34ce56", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "symfony/filesystem": "^6.0" + "symfony/filesystem": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -3732,7 +3606,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.3.3" + "source": "https://github.com/symfony/finder/tree/v7.0.0" }, "funding": [ { @@ -3748,24 +3622,24 @@ "type": "tidelift" } ], - "time": "2023-07-31T08:31:44+00:00" + "time": "2023-10-31T17:59:56+00:00" }, { "name": "symfony/options-resolver", - "version": "v6.3.0", + "version": "v7.0.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd" + "reference": "700ff4096e346f54cb628ea650767c8130f1001f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a10f19f5198d589d5c33333cffe98dc9820332dd", - "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/700ff4096e346f54cb628ea650767c8130f1001f", + "reference": "700ff4096e346f54cb628ea650767c8130f1001f", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", @@ -3799,7 +3673,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.3.0" + "source": "https://github.com/symfony/options-resolver/tree/v7.0.0" }, "funding": [ { @@ -3815,20 +3689,20 @@ "type": "tidelift" } ], - "time": "2023-05-12T14:21:09+00:00" + "time": "2023-08-08T10:20:21+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", "shasum": "" }, "require": { @@ -3842,9 +3716,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3881,7 +3752,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" }, "funding": [ { @@ -3897,20 +3768,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "875e90aeea2777b6f135677f618529449334a612" + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", - "reference": "875e90aeea2777b6f135677f618529449334a612", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", "shasum": "" }, "require": { @@ -3921,9 +3792,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3962,7 +3830,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" }, "funding": [ { @@ -3978,20 +3846,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", "shasum": "" }, "require": { @@ -4002,9 +3870,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -4046,7 +3911,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" }, "funding": [ { @@ -4062,20 +3927,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", "shasum": "" }, "require": { @@ -4089,9 +3954,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -4129,7 +3991,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" }, "funding": [ { @@ -4145,20 +4007,20 @@ "type": "tidelift" } ], - "time": "2023-07-28T09:04:16+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", "shasum": "" }, "require": { @@ -4166,9 +4028,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -4212,7 +4071,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" }, "funding": [ { @@ -4228,20 +4087,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" + "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d", + "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d", "shasum": "" }, "require": { @@ -4249,9 +4108,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -4291,7 +4147,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0" }, "funding": [ { @@ -4307,24 +4163,24 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/process", - "version": "v6.3.4", + "version": "v7.0.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54" + "reference": "0e7727191c3b71ebec6d529fa0e50a01ca5679e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/0b5c29118f2e980d455d2e34a5659f4579847c54", - "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54", + "url": "https://api.github.com/repos/symfony/process/zipball/0e7727191c3b71ebec6d529fa0e50a01ca5679e9", + "reference": "0e7727191c3b71ebec6d529fa0e50a01ca5679e9", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "type": "library", "autoload": { @@ -4352,7 +4208,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.3.4" + "source": "https://github.com/symfony/process/tree/v7.0.4" }, "funding": [ { @@ -4368,25 +4224,25 @@ "type": "tidelift" } ], - "time": "2023-08-07T10:39:22+00:00" + "time": "2024-02-22T20:27:20+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.3.0", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4" + "reference": "11bbf19a0fb7b36345861e85c5768844c552906e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", - "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/11bbf19a0fb7b36345861e85c5768844c552906e", + "reference": "11bbf19a0fb7b36345861e85c5768844c552906e", "shasum": "" }, "require": { "php": ">=8.1", - "psr/container": "^2.0" + "psr/container": "^1.1|^2.0" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -4434,7 +4290,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.4.2" }, "funding": [ { @@ -4450,24 +4306,24 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2023-12-19T21:51:00+00:00" }, { "name": "symfony/stopwatch", - "version": "v6.3.0", + "version": "v7.0.3", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2" + "reference": "983900d6fddf2b0cbaacacbbad07610854bd8112" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", - "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/983900d6fddf2b0cbaacacbbad07610854bd8112", + "reference": "983900d6fddf2b0cbaacacbbad07610854bd8112", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/service-contracts": "^2.5|^3" }, "type": "library", @@ -4496,7 +4352,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.3.0" + "source": "https://github.com/symfony/stopwatch/tree/v7.0.3" }, "funding": [ { @@ -4512,24 +4368,24 @@ "type": "tidelift" } ], - "time": "2023-02-16T10:14:28+00:00" + "time": "2024-01-23T15:02:46+00:00" }, { "name": "symfony/string", - "version": "v6.3.2", + "version": "v7.0.4", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "53d1a83225002635bca3482fcbf963001313fb68" + "reference": "f5832521b998b0bec40bee688ad5de98d4cf111b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/53d1a83225002635bca3482fcbf963001313fb68", - "reference": "53d1a83225002635bca3482fcbf963001313fb68", + "url": "https://api.github.com/repos/symfony/string/zipball/f5832521b998b0bec40bee688ad5de98d4cf111b", + "reference": "f5832521b998b0bec40bee688ad5de98d4cf111b", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", @@ -4539,11 +4395,11 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/intl": "^6.2", + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^5.4|^6.0" + "symfony/var-exporter": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -4582,7 +4438,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.3.2" + "source": "https://github.com/symfony/string/tree/v7.0.4" }, "funding": [ { @@ -4598,27 +4454,29 @@ "type": "tidelift" } ], - "time": "2023-07-05T08:41:27+00:00" + "time": "2024-02-01T13:17:36+00:00" }, { "name": "symfony/var-exporter", - "version": "v6.3.4", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "df1f8aac5751871b83d30bf3e2c355770f8f0691" + "reference": "c74c568d2a15a1d407cf40d61ea82bc2d521e27b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/df1f8aac5751871b83d30bf3e2c355770f8f0691", - "reference": "df1f8aac5751871b83d30bf3e2c355770f8f0691", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/c74c568d2a15a1d407cf40d61ea82bc2d521e27b", + "reference": "c74c568d2a15a1d407cf40d61ea82bc2d521e27b", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "symfony/var-dumper": "^5.4|^6.0" + "symfony/property-access": "^6.4|^7.0", + "symfony/serializer": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -4656,7 +4514,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v6.3.4" + "source": "https://github.com/symfony/var-exporter/tree/v7.0.6" }, "funding": [ { @@ -4672,20 +4530,20 @@ "type": "tidelift" } ], - "time": "2023-08-16T18:14:47+00:00" + "time": "2024-03-20T21:25:22+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -4714,7 +4572,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -4722,7 +4580,7 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2024-03-03T12:36:25+00:00" }, { "name": "tysonandre/var_representation_polyfill", diff --git a/preload.php b/preload.php index 9d94e5a8e..310a843d8 100755 --- a/preload.php +++ b/preload.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package Jingga * @copyright Dennis Eichhorn diff --git a/tests/Account/AccountManagerTest.php b/tests/Account/AccountManagerTest.php index 63c6ea074..5abcd260e 100755 --- a/tests/Account/AccountManagerTest.php +++ b/tests/Account/AccountManagerTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,10 @@ use phpOMS\Account\NullAccount; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Account\AccountManager: Account/user manager to handle/access loaded accounts - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Account\AccountManager::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Account\AccountManager: Account/user manager to handle/access loaded accounts')] final class AccountManagerTest extends \PHPUnit\Framework\TestCase { protected $manager = null; @@ -35,17 +35,14 @@ final class AccountManagerTest extends \PHPUnit\Framework\TestCase */ protected function setUp() : void { - $this->manager = new AccountManager($GLOBALS['httpSession']); + $this->manager = new AccountManager($GLOBALS['session']); $this->account = new NullAccount(3); $this->account->generatePassword('abcd'); } - /** - * @testdox The manager has the expected default values after initialization - * @covers phpOMS\Account\AccountManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The manager has the expected default values after initialization')] public function testDefault() : void { self::assertEquals(0, $this->manager->count()); @@ -53,11 +50,8 @@ final class AccountManagerTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\phpOMS\Account\NullAccount', $this->manager->get(-1)); } - /** - * @testdox An account can be added to the manager - * @covers phpOMS\Account\AccountManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An account can be added to the manager')] public function testAddAccount() : void { $added = $this->manager->add($this->account); @@ -65,22 +59,16 @@ final class AccountManagerTest extends \PHPUnit\Framework\TestCase self::assertEquals(1, $this->manager->count()); } - /** - * @testdox An account can be retrieved from the manager - * @covers phpOMS\Account\AccountManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An account can be retrieved from the manager')] public function testRetrieveAccount() : void { $this->manager->add($this->account); self::assertEquals($this->account, $this->manager->get($this->account->id)); } - /** - * @testdox An account can only be added once to the account manager (no duplication) - * @covers phpOMS\Account\AccountManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An account can only be added once to the account manager (no duplication)')] public function testNoAccountDuplication() : void { $this->manager->add($this->account); @@ -92,11 +80,8 @@ final class AccountManagerTest extends \PHPUnit\Framework\TestCase self::assertEquals(0, $this->manager->count()); } - /** - * @testdox An account can be removed from the account manager - * @covers phpOMS\Account\AccountManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An account can be removed from the account manager')] public function testRemoveAccount() : void { $this->manager->add($this->account); @@ -105,11 +90,8 @@ final class AccountManagerTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->manager->remove(-1)); } - /** - * @testdox Only a valid account can be removed from the manager - * @covers phpOMS\Account\AccountManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Only a valid account can be removed from the manager')] public function testRemoveOnlyValidAccount() : void { $this->manager->add($this->account); diff --git a/tests/Account/AccountStatusTest.php b/tests/Account/AccountStatusTest.php index 7f1dea937..6a115f895 100755 --- a/tests/Account/AccountStatusTest.php +++ b/tests/Account/AccountStatusTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,36 +19,32 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Account\AccountStatus; /** - * @testdox phpOMS\tests\Account\AccountStatus: Account status * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Account\AccountStatus: Account status')] final class AccountStatusTest extends \PHPUnit\Framework\TestCase { /** * @testdoxThe account status enum has the correct number of status codes - * @group framework - * @coversNothing */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(4, AccountStatus::getConstants()); } - /** - * @testdox The account status enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The account status enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(AccountStatus::getConstants(), \array_unique(AccountStatus::getConstants())); } - /** - * @testdox The account status enum has the correct values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The account status enum has the correct values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(1, AccountStatus::ACTIVE); diff --git a/tests/Account/AccountTest.php b/tests/Account/AccountTest.php index 99891fb9e..501068ec6 100755 --- a/tests/Account/AccountTest.php +++ b/tests/Account/AccountTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -27,10 +27,10 @@ use phpOMS\Localization\Localization; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Account\Account: Base account/user representation - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Account\Account::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Account\Account: Base account/user representation')] final class AccountTest extends \PHPUnit\Framework\TestCase { protected $l11nManager = null; @@ -44,10 +44,9 @@ final class AccountTest extends \PHPUnit\Framework\TestCase } /** - * @testdox The account has the expected default values after initialization - * @covers phpOMS\Account\Account * @group framework */ + #[\PHPUnit\Framework\Attributes\TestDox('The account has the expected default values after initialization')] public function testDefault() : void { $account = new Account(); @@ -94,10 +93,9 @@ final class AccountTest extends \PHPUnit\Framework\TestCase } /** - * @testdox The account names can be set and retrieved correctly - * @covers phpOMS\Account\Account * @group framework */ + #[\PHPUnit\Framework\Attributes\TestDox('The account names can be set and retrieved correctly')] public function testSetAndGetAccountNames() : void { $account = new Account(); @@ -117,10 +115,9 @@ final class AccountTest extends \PHPUnit\Framework\TestCase } /** - * @testdox Groups can be added to an account - * @covers phpOMS\Account\Account * @group framework */ + #[\PHPUnit\Framework\Attributes\TestDox('Groups can be added to an account')] public function testAddAndGetGroup() : void { $account = new Account(); @@ -132,10 +129,9 @@ final class AccountTest extends \PHPUnit\Framework\TestCase } /** - * @testdox An account can have a valid email address - * @covers phpOMS\Account\Account * @group framework */ + #[\PHPUnit\Framework\Attributes\TestDox('An account can have a valid email address')] public function testSetAndGetAccountEmail() : void { $account = new Account(); @@ -146,10 +142,9 @@ final class AccountTest extends \PHPUnit\Framework\TestCase } /** - * @testdox Account permissions can be added - * @covers phpOMS\Account\Account * @group framework */ + #[\PHPUnit\Framework\Attributes\TestDox('Account permissions can be added')] public function testPermissionAdd() : void { $account = new Account(); @@ -178,10 +173,9 @@ final class AccountTest extends \PHPUnit\Framework\TestCase } /** - * @testdox Account permissions can be checked for existence - * @covers phpOMS\Account\Account * @group framework */ + #[\PHPUnit\Framework\Attributes\TestDox('Account permissions can be checked for existence')] public function testPermissionExists() : void { $account = new Account(); @@ -207,10 +201,9 @@ final class AccountTest extends \PHPUnit\Framework\TestCase } /** - * @testdox Account permissions can be removed - * @covers phpOMS\Account\Account * @group framework */ + #[\PHPUnit\Framework\Attributes\TestDox('Account permissions can be removed')] public function testPermissionRemove() : void { $account = new Account(); @@ -227,10 +220,9 @@ final class AccountTest extends \PHPUnit\Framework\TestCase } /** - * @testdox An account can have it's own localization - * @covers phpOMS\Account\Account * @group framework */ + #[\PHPUnit\Framework\Attributes\TestDox("An account can have it's own localization")] public function testLocalization() : void { $account = new Account(); @@ -241,9 +233,9 @@ final class AccountTest extends \PHPUnit\Framework\TestCase } /** - * @testdox An account 'last activity' timestamp can be updated and retrieved * @group framework */ + #[\PHPUnit\Framework\Attributes\TestDox("An account 'last activity' timestamp can be updated and retrieved")] public function testLastChange() : void { $account = new Account(); @@ -255,9 +247,9 @@ final class AccountTest extends \PHPUnit\Framework\TestCase } /** - * @testdox An account can only have a valid email * @group framework */ + #[\PHPUnit\Framework\Attributes\TestDox('An account can only have a valid email')] public function testEmailException() : void { $this->expectException(\InvalidArgumentException::class); diff --git a/tests/Account/AccountTypeTest.php b/tests/Account/AccountTypeTest.php index a1e4a2b2e..d7467f4c6 100755 --- a/tests/Account/AccountTypeTest.php +++ b/tests/Account/AccountTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,36 +19,30 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Account\AccountType; /** - * @testdox phpOMS\tests\Account\AccountType: Account type * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Account\AccountType: Account type')] final class AccountTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The account type enum has the correct number of type codes - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The account type enum has the correct number of type codes')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(2, AccountType::getConstants()); } - /** - * @testdox The account type enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The account type enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(AccountType::getConstants(), \array_unique(AccountType::getConstants())); } - /** - * @testdox The account type enum has the correct values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The account type enum has the correct values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(0, AccountType::USER); diff --git a/tests/Account/GroupStatusTest.php b/tests/Account/GroupStatusTest.php index fcca5a302..b6bcb43cf 100755 --- a/tests/Account/GroupStatusTest.php +++ b/tests/Account/GroupStatusTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,36 +19,30 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Account\GroupStatus; /** - * @testdox phpOMS\tests\Account\GroupStatus: Group status * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Account\GroupStatus: Group status')] final class GroupStatusTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The group status enum has the correct number of status codes - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The group status enum has the correct number of status codes')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(3, GroupStatus::getConstants()); } - /** - * @testdox The group status enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The group status enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(GroupStatus::getConstants(), \array_unique(GroupStatus::getConstants())); } - /** - * @testdox The group status enum has the correct values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The group status enum has the correct values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(1, GroupStatus::ACTIVE); diff --git a/tests/Account/GroupTest.php b/tests/Account/GroupTest.php index a6d4c36c7..018fb493a 100755 --- a/tests/Account/GroupTest.php +++ b/tests/Account/GroupTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -22,17 +22,16 @@ use phpOMS\Account\PermissionType; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Account\Group: Base group representation - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Account\Group::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Account\Group: Base group representation')] final class GroupTest extends \PHPUnit\Framework\TestCase { /** - * @testdox The group has the expected default values after initialization - * @covers phpOMS\Account\Group * @group framework */ + #[\PHPUnit\Framework\Attributes\TestDox('The group has the expected default values after initialization')] public function testDefault() : void { $group = new Group(); @@ -58,10 +57,9 @@ final class GroupTest extends \PHPUnit\Framework\TestCase } /** - * @testdox The group name and description can be set and retrieved correctly - * @covers phpOMS\Account\Group * @group framework */ + #[\PHPUnit\Framework\Attributes\TestDox('The group name and description can be set and retrieved correctly')] public function testSetAndGetGroupNameDescription() : void { $group = new Group(); @@ -74,10 +72,9 @@ final class GroupTest extends \PHPUnit\Framework\TestCase } /** - * @testdox Group permissions can be added - * @covers phpOMS\Account\Group * @group framework */ + #[\PHPUnit\Framework\Attributes\TestDox('Group permissions can be added')] public function testPermissionAdd() : void { $group = new Group(); @@ -105,10 +102,9 @@ final class GroupTest extends \PHPUnit\Framework\TestCase } /** - * @testdox Group permissions can be checked for existence - * @covers phpOMS\Account\Group * @group framework */ + #[\PHPUnit\Framework\Attributes\TestDox('Group permissions can be checked for existence')] public function testPermissionExists() : void { $group = new Group(); @@ -121,10 +117,9 @@ final class GroupTest extends \PHPUnit\Framework\TestCase } /** - * @testdox Group permissions can be removed - * @covers phpOMS\Account\Group * @group framework */ + #[\PHPUnit\Framework\Attributes\TestDox('Group permissions can be removed')] public function testPermissionRemove() : void { $group = new Group(); diff --git a/tests/Account/NullAccountTest.php b/tests/Account/NullAccountTest.php index e08f6c07e..56b662d36 100755 --- a/tests/Account/NullAccountTest.php +++ b/tests/Account/NullAccountTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,26 +19,21 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Account\NullAccount; /** - * @testdox phpOMS\tests\Account\NullAccount: Null account * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Account\NullAccount::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Account\NullAccount: Null account')] final class NullAccountTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The null account is an instance of the account class - * @covers phpOMS\Account\NullAccount - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The null account is an instance of the account class')] public function testNull() : void { self::assertInstanceOf('\phpOMS\Account\Account', new NullAccount()); } - /** - * @testdox The null account can get initialized with an id - * @covers phpOMS\Account\NullAccount - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The null account can get initialized with an id')] public function testId() : void { $null = new NullAccount(2); diff --git a/tests/Account/NullGroupTest.php b/tests/Account/NullGroupTest.php index 03e4738e3..a3aa0bc7f 100755 --- a/tests/Account/NullGroupTest.php +++ b/tests/Account/NullGroupTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,26 +19,21 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Account\NullGroup; /** - * @testdox phpOMS\tests\Account\NullGroup: Null group * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Account\NullGroup::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Account\NullGroup: Null group')] final class NullGroupTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The null group is an instance of the group class - * @covers phpOMS\Account\NullGroup - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The null group is an instance of the group class')] public function testNull() : void { self::assertInstanceOf('\phpOMS\Account\Group', new NullGroup()); } - /** - * @testdox The null group can get initialized with an id - * @covers phpOMS\Account\NullGroup - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The null group can get initialized with an id')] public function testId() : void { $null = new NullGroup(2); diff --git a/tests/Account/PermissionAbstractTest.php b/tests/Account/PermissionAbstractTest.php index 253560003..b0aa9b01d 100755 --- a/tests/Account/PermissionAbstractTest.php +++ b/tests/Account/PermissionAbstractTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,17 +20,14 @@ use phpOMS\Account\PermissionAbstract; use phpOMS\Account\PermissionType; /** - * @testdox phpOMS\tests\Account\PermissionAbstractTest: Base permission representation - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Account\PermissionAbstract::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Account\PermissionAbstractTest: Base permission representation')] final class PermissionAbstractTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The permission has the expected default values after initialization - * @covers phpOMS\Account\PermissionAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission has the expected default values after initialization')] public function testAbstractDefault() : void { $perm = new class() extends PermissionAbstract {}; @@ -64,11 +61,8 @@ final class PermissionAbstractTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The permission can be set and returned correctly - * @covers phpOMS\Account\PermissionAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission can be set and returned correctly')] public function testPermissionInputOutput() : void { $perm = new class() extends PermissionAbstract {}; @@ -77,11 +71,8 @@ final class PermissionAbstractTest extends \PHPUnit\Framework\TestCase self::assertEquals(PermissionType::READ, $perm->getPermission()); } - /** - * @testdox Two permissions can be checked for equality - * @covers phpOMS\Account\PermissionAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Two permissions can be checked for equality')] public function testEqualPermissions() : void { $perm1 = new class() extends PermissionAbstract {}; @@ -117,11 +108,8 @@ final class PermissionAbstractTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Correct permissions are validated - * @covers phpOMS\Account\PermissionAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Correct permissions are validated')] public function testValidPermission() : void { $perm = new class() extends PermissionAbstract {}; @@ -132,11 +120,8 @@ final class PermissionAbstractTest extends \PHPUnit\Framework\TestCase self::assertTrue($perm->hasPermission(PermissionType::READ)); } - /** - * @testdox Invalid permissions are not validated - * @covers phpOMS\Account\PermissionAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid permissions are not validated')] public function testInvalidPermission() : void { $perm = new class() extends PermissionAbstract {}; @@ -146,11 +131,8 @@ final class PermissionAbstractTest extends \PHPUnit\Framework\TestCase self::assertFalse($perm->hasPermission(PermissionType::MODIFY)); } - /** - * @testdox Correct permission flags are validated - * @covers phpOMS\Account\PermissionAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Correct permission flags are validated')] public function testValidPermissionFlag() : void { $perm = new class() extends PermissionAbstract {}; @@ -161,11 +143,8 @@ final class PermissionAbstractTest extends \PHPUnit\Framework\TestCase self::assertTrue($perm->hasPermissionFlags(PermissionType::READ | PermissionType::CREATE)); } - /** - * @testdox Invalid permission flags are not validated - * @covers phpOMS\Account\PermissionAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid permission flags are not validated')] public function testInvalidPermissionFlag() : void { $perm = new class() extends PermissionAbstract {}; diff --git a/tests/Account/PermissionTypeTest.php b/tests/Account/PermissionTypeTest.php index aac76b01d..7a3db6dea 100755 --- a/tests/Account/PermissionTypeTest.php +++ b/tests/Account/PermissionTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,36 +19,30 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Account\PermissionType; /** - * @testdox phpOMS\tests\Account\PermissionType: Permission type * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Account\PermissionType: Permission type')] final class PermissionTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The permission type enum has the correct number of type codes - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission type enum has the correct number of type codes')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(6, PermissionType::getConstants()); } - /** - * @testdox The permission type enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission type enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(PermissionType::getConstants(), \array_unique(PermissionType::getConstants())); } - /** - * @testdox The permission type enum has the correct values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission type enum has the correct values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(1, PermissionType::NONE); diff --git a/tests/Ai/Ocr/BasicOcrTest.php b/tests/Ai/Ocr/BasicOcrTest.php index f8321b80a..5ff7f429d 100755 --- a/tests/Ai/Ocr/BasicOcrTest.php +++ b/tests/Ai/Ocr/BasicOcrTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Ai\Ocr\BasicOcr; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Ai\Ocr\BasicOcr::class)] final class BasicOcrTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Ai\Ocr\BasicOcr - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testOcr() : void { $ocr = new BasicOcr(); @@ -63,10 +61,7 @@ final class BasicOcrTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\Ai\Ocr\BasicOcr - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidImagePath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -74,10 +69,7 @@ final class BasicOcrTest extends \PHPUnit\Framework\TestCase $ocr->trainWith(__DIR__ . '/invalid', __DIR__ . '/train-labels-idx1-ubyte', 1); } - /** - * @covers phpOMS\Ai\Ocr\BasicOcr - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidLabelPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); diff --git a/tests/Ai/Ocr/Tesseract/TesseractOcrTest.php b/tests/Ai/Ocr/Tesseract/TesseractOcrTest.php index e1c7b364d..d10cfd4ec 100755 --- a/tests/Ai/Ocr/Tesseract/TesseractOcrTest.php +++ b/tests/Ai/Ocr/Tesseract/TesseractOcrTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -23,6 +23,7 @@ use phpOMS\System\File\PathException; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Ai\Ocr\Tesseract\TesseractOcr::class)] final class TesseractOcrTest extends \PHPUnit\Framework\TestCase { /** @@ -49,10 +50,7 @@ final class TesseractOcrTest extends \PHPUnit\Framework\TestCase echo 'Match2: ' . $m2 . " \n"; } - /** - * @covers phpOMS\Ai\Ocr\Tesseract\TesseractOcr - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testOcrBasic() : void { $ocr = new TesseractOcr(); @@ -75,10 +73,7 @@ final class TesseractOcrTest extends \PHPUnit\Framework\TestCase TesseractOcr::setBin('/invalid/path'); } - /** - * @covers phpOMS\Ai\Ocr\Tesseract\TesseractOcr - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testOcrWithThresholding() : void { $ocr = new TesseractOcr(); @@ -99,7 +94,7 @@ final class TesseractOcrTest extends \PHPUnit\Framework\TestCase } /** - * @covers phpOMS\Ai\Ocr\Tesseract\TesseractOcr + * @covers \phpOMS\Ai\Ocr\Tesseract\TesseractOcr * @group framework */ /* @@ -135,7 +130,7 @@ final class TesseractOcrTest extends \PHPUnit\Framework\TestCase */ /** - * @covers phpOMS\Ai\Ocr\Tesseract\TesseractOcr + * @covers \phpOMS\Ai\Ocr\Tesseract\TesseractOcr * @group framework */ /* diff --git a/tests/Ai/Ocr/Tesseract/basic.txt b/tests/Ai/Ocr/Tesseract/basic.txt index 80b44e1e6..de4b2c744 100755 --- a/tests/Ai/Ocr/Tesseract/basic.txt +++ b/tests/Ai/Ocr/Tesseract/basic.txt @@ -1,16 +1,66 @@ -, you Can filter an image to emphasize certain -inted with filtering include smoothing, sharpening, +ee rrr -pixel in the output image is determined by applying -€ corresponding input pixel. A pixel's neighborhood is -eeNeighborhood or Block Processing: An Overview for +nain? -§ filtering in which the value of an output pixel is a linear -od. +AP tne e va eo -alled convolution. Convolution is a neighborhood -boring input pixels. The matrix of weights is called the -‘4 Correlation kernel that has been rotated 12 + + + + + + + +em + +mple, you can filter an image to emphasize certain +mented with filtering include smoothing, sharpening, + + + +ive pixel in the output image is determined by applying +a comesponding input pixel. A pixel’s neighborhood is +. (SeeNeighborhood or Block Processing: An Overview for +tering in which the value of an output pixel is a linear + + E ‘ +} +ane + +- —_ +J + + + + + + + + + +. _ + +Called convolution. Convolution is 2 neighborhood + +Nb: nboring input pixels. The matrix of weights is called th +sa Correlation kernel that has been rotated 120 c + +~~ +rn — +, ~ + +- + +a +“= +4 + +() + +(D + +Sec +— \ No newline at end of file diff --git a/tests/Ai/Ocr/Tesseract/thresholding.txt b/tests/Ai/Ocr/Tesseract/thresholding.txt index b280b646f..7843b9013 100755 --- a/tests/Ai/Ocr/Tesseract/thresholding.txt +++ b/tests/Ai/Ocr/Tesseract/thresholding.txt @@ -1,29 +1,29 @@ -t Is Image Filtering in the Spatial Domain? +What Is Image Filtering in the Spatial Domain? -What Is Ima +a a ee om o-beme- ee -Filtering is a technique for modifying or enhancing an image. For example, you can filter an image to emphasize certain +Filtering Is a technique for modifying or enhancing an image. For example, you can filter an image to emphasize certain features or remove other features. Image processing operations implemented with filtering include smoothing, sharpening, -and edge enhancement. +_ and edge enhancement. + Filtering is a neighborhood operation, in which the value of any given pixel in the output image is determined by applying -some algorithm to the values of the pixels in the neighborhood of the corresponding input pixel. A pixel’s neighborhood is +some algorithm to the values of the pixels in the neighborhood of the corresponding input pixel. A pixel'’s neighborhocd is some set of pixels, defined by their locations relative to that pixel. (SeeNeighborhood or Block Processing: An Overview for -a general discussion of neighborhood Operations.) Linear filtering is filtering in which the value of an output pixel is a linear +a general discussion of neighborhood operations.) Linear filtering is filtering in which the value ofan output pixel is a linear combination of the values of the pixels in the input pixel's neighborhood. Convolution -Linear filtering of an image is accomplished through an operation called convolution. Convolution is a neightornood +Linear filtering of an image is accomplished through an operation called convolution. Convolution is aneightornood -Operation in which each output pixel is the weighted sum of neighboring input pixels. The matrix of weights is called the +operation in which each output pixel is the weighted sum of neighboring input pixels. The matrix of weights is called the +convolution kemel, also known as the filter. A convolution kernel is a correlation kernel that has been rotated 1 20 cearses. For example, suppose the image is -A=[17 24 1 8 15 -2305 7 14 16 -4 6 13 26 22 -1@ 12 19 21 3 - - +A=[17 24 1 8g 45 +23 5 7 14 146 +4 6 13 20 22 +1@ 12 19 23 3 \ No newline at end of file diff --git a/tests/Algorithm/Clustering/KmeansTest.php b/tests/Algorithm/Clustering/KmeansTest.php index 2da821f82..bb11c441d 100755 --- a/tests/Algorithm/Clustering/KmeansTest.php +++ b/tests/Algorithm/Clustering/KmeansTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,17 +20,14 @@ use phpOMS\Algorithm\Clustering\Point; include_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Clustering\KmeansTest: Clustering points/elements with the K-means algorithm - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\Clustering\Kmeans::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Clustering\KmeansTest: Clustering points/elements with the K-means algorithm')] final class KmeansTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The clustering of points and dynamic check of new points works as expected - * @covers phpOMS\Algorithm\Clustering\Kmeans - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The clustering of points and dynamic check of new points works as expected')] public function testKmeans() : void { $seed = \mt_rand(\PHP_INT_MIN, \PHP_INT_MAX); diff --git a/tests/Algorithm/Clustering/PointTest.php b/tests/Algorithm/Clustering/PointTest.php index 35b555ea7..456eb745e 100755 --- a/tests/Algorithm/Clustering/PointTest.php +++ b/tests/Algorithm/Clustering/PointTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Algorithm\Clustering; use phpOMS\Algorithm\Clustering\Point; /** - * @testdox phpOMS\tests\Algorithm\Clustering\PointTest: Default point in a cluster - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\Clustering\Point::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Clustering\PointTest: Default point in a cluster')] final class PointTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The point has the expected default values after initialization - * @covers phpOMS\Algorithm\Clustering\Point - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The point has the expected default values after initialization')] public function testDefault() : void { $point = new Point([3.0, 2.0], 'abc'); @@ -39,11 +36,8 @@ final class PointTest extends \PHPUnit\Framework\TestCase self::assertEquals('abc', $point->name); } - /** - * @testdox Coordinates of a point can be set and returned - * @covers phpOMS\Algorithm\Clustering\Point - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Coordinates of a point can be set and returned')] public function testCoordinateInputOutput() : void { $point = new Point([3.0, 2.0], 'abc'); @@ -56,11 +50,8 @@ final class PointTest extends \PHPUnit\Framework\TestCase self::assertEquals(1.0, $point->getCoordinate(1)); } - /** - * @testdox The group/cluster of a point can be set and returned - * @covers phpOMS\Algorithm\Clustering\Point - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The group/cluster of a point can be set and returned')] public function testGroupInputOutput() : void { $point = new Point([3.0, 2.0], 'abc'); @@ -69,11 +60,8 @@ final class PointTest extends \PHPUnit\Framework\TestCase self::assertEquals(2, $point->group); } - /** - * @testdox The name of a point can be set and returned - * @covers phpOMS\Algorithm\Clustering\Point - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The name of a point can be set and returned')] public function testNameInputOutput() : void { $point = new Point([3.0, 2.0], 'abc'); diff --git a/tests/Algorithm/CoinMatching/MinimumCoinProblemTest.php b/tests/Algorithm/CoinMatching/MinimumCoinProblemTest.php index ea94aa753..a21d418ce 100755 --- a/tests/Algorithm/CoinMatching/MinimumCoinProblemTest.php +++ b/tests/Algorithm/CoinMatching/MinimumCoinProblemTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ use phpOMS\Algorithm\CoinMatching\MinimumCoinProblem; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\CoinMatching\MinimumCoinProblemTest: Match a value by using the minimum quantity of available sub values (Minimum Coin Problem) - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\CoinMatching\MinimumCoinProblem::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\CoinMatching\MinimumCoinProblemTest: Match a value by using the minimum quantity of available sub values (Minimum Coin Problem)')] final class MinimumCoinProblemTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A value is matched with the minimum quantity of available coins. - * @covers phpOMS\Algorithm\CoinMatching\MinimumCoinProblem - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A value is matched with the minimum quantity of available coins.')] public function testMinimumCoins() : void { self::assertEquals( diff --git a/tests/Algorithm/Frequency/AprioriTest.php b/tests/Algorithm/Frequency/AprioriTest.php index fe998058b..e13134624 100644 --- a/tests/Algorithm/Frequency/AprioriTest.php +++ b/tests/Algorithm/Frequency/AprioriTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,9 @@ use phpOMS\Algorithm\Frequency\Apriori; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Frequency\AprioriTest: - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Frequency\AprioriTest:')] final class AprioriTest extends \PHPUnit\Framework\TestCase { public function testApriori() : void diff --git a/tests/Algorithm/Graph/DependencyResolverTest.php b/tests/Algorithm/Graph/DependencyResolverTest.php index eeab355b6..88704f842 100644 --- a/tests/Algorithm/Graph/DependencyResolverTest.php +++ b/tests/Algorithm/Graph/DependencyResolverTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,13 @@ use phpOMS\Algorithm\Graph\DependencyResolver; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Graph\DependencyResolverTest: - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\Graph\DependencyResolver::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Graph\DependencyResolverTest:')] final class DependencyResolverTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Algorithm\Graph\DependencyResolver - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testResolveCircular() : void { self::assertNull( @@ -36,10 +33,7 @@ final class DependencyResolverTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Algorithm\Graph\DependencyResolver - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testResolve() : void { self::assertEquals( diff --git a/tests/Algorithm/Graph/MarkovChainTest.php b/tests/Algorithm/Graph/MarkovChainTest.php index 0521dc2d5..a207a2a9a 100644 --- a/tests/Algorithm/Graph/MarkovChainTest.php +++ b/tests/Algorithm/Graph/MarkovChainTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,13 @@ use phpOMS\Algorithm\Graph\MarkovChain; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Graph\MarkovChainTest: - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\Graph\MarkovChain::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Graph\MarkovChainTest:')] final class MarkovChainTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Algorithm\Graph\MarkovChain - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testGenerate() : void { $markov = new MarkovChain(); @@ -43,10 +40,7 @@ final class MarkovChainTest extends \PHPUnit\Framework\TestCase self::assertEquals(3, \count($markov->generate(3, ['A']))); } - /** - * @covers phpOMS\Algorithm\Graph\MarkovChain - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testTrainingGenerate() : void { $markov = new MarkovChain(); @@ -55,10 +49,7 @@ final class MarkovChainTest extends \PHPUnit\Framework\TestCase self::assertEquals(5, \count($markov->generate(5, ['A']))); } - /** - * @covers phpOMS\Algorithm\Graph\MarkovChain - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStepProbability() : void { $markov = new MarkovChain(2); @@ -79,10 +70,7 @@ final class MarkovChainTest extends \PHPUnit\Framework\TestCase self::assertEquals(0.1, $markov->stepProbability(['D', 'G'], 'D')); } - /** - * @covers phpOMS\Algorithm\Graph\MarkovChain - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPathProbability() : void { $markov = new MarkovChain(2); diff --git a/tests/Algorithm/JobScheduling/JobTest.php b/tests/Algorithm/JobScheduling/JobTest.php index a20d71d92..8c60abc99 100755 --- a/tests/Algorithm/JobScheduling/JobTest.php +++ b/tests/Algorithm/JobScheduling/JobTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Algorithm\JobScheduling; use phpOMS\Algorithm\JobScheduling\Job; /** - * @testdox phpOMS\tests\Algorithm\JobScheduling\JobTest: Default job for the job scheduling - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\JobScheduling\Job::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\JobScheduling\JobTest: Default job for the job scheduling')] final class JobTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The job has the expected values after initialization - * @covers phpOMS\Algorithm\JobScheduling\Job - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The job has the expected values after initialization')] public function testDefault() : void { $item = new Job(3.0, new \DateTime('now'), null, 'abc'); diff --git a/tests/Algorithm/JobScheduling/WeightedTest.php b/tests/Algorithm/JobScheduling/WeightedTest.php index 69ce8908f..adcc24f7c 100755 --- a/tests/Algorithm/JobScheduling/WeightedTest.php +++ b/tests/Algorithm/JobScheduling/WeightedTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,17 +18,14 @@ use phpOMS\Algorithm\JobScheduling\Job; use phpOMS\Algorithm\JobScheduling\Weighted; /** - * @testdox phpOMS\tests\Algorithm\JobScheduling\WeightedTest: Job scheduling based on values/profit - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\JobScheduling\Weighted::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\JobScheduling\WeightedTest: Job scheduling based on values/profit')] final class WeightedTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The optimal job combination is selected to maximize the value/profit without overlapping jobs - * @covers phpOMS\Algorithm\JobScheduling\Weighted - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The optimal job combination is selected to maximize the value/profit without overlapping jobs')] public function testNoOverlappingScheduling() : void { $jobs = [ @@ -58,11 +55,8 @@ final class WeightedTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A job list with only one job simply returns one job - * @covers phpOMS\Algorithm\JobScheduling\Weighted - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A job list with only one job simply returns one job')] public function testSmallList() : void { $jobs = [ diff --git a/tests/Algorithm/Knapsack/BackpackTest.php b/tests/Algorithm/Knapsack/BackpackTest.php index bb47f0ae4..b9785bc73 100755 --- a/tests/Algorithm/Knapsack/BackpackTest.php +++ b/tests/Algorithm/Knapsack/BackpackTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,17 +18,14 @@ use phpOMS\Algorithm\Knapsack\Backpack; use phpOMS\Algorithm\Knapsack\Item; /** - * @testdox phpOMS\tests\Algorithm\Knapsack\BackpackTest: The default backpack or basket which holds all items for the Knapsack algorithm - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\Knapsack\Backpack::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Knapsack\BackpackTest: The default backpack or basket which holds all items for the Knapsack algorithm')] final class BackpackTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The backpack has the expected values after initialization - * @covers phpOMS\Algorithm\Knapsack\Backpack - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The backpack has the expected values after initialization')] public function testDefault() : void { $backpack = new Backpack(3.0); @@ -39,11 +36,8 @@ final class BackpackTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $backpack->getItems()); } - /** - * @testdox Items can be added to the backpack and automatically change the value and cost the backpack contains - * @covers phpOMS\Algorithm\Knapsack\Backpack - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Items can be added to the backpack and automatically change the value and cost the backpack contains')] public function testAddItems() : void { $backpack = new Backpack(3.0); diff --git a/tests/Algorithm/Knapsack/BoundedTest.php b/tests/Algorithm/Knapsack/BoundedTest.php index d9d5de7cd..d17d4ad15 100755 --- a/tests/Algorithm/Knapsack/BoundedTest.php +++ b/tests/Algorithm/Knapsack/BoundedTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ use phpOMS\Algorithm\Knapsack\Bounded; use phpOMS\Algorithm\Knapsack\Item; /** - * @testdox phpOMS\tests\Algorithm\Knapsack\BoundedTest: A Knapsack implementation for discrete quantities, values and costs and bounded item quantities - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\Knapsack\Bounded::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Knapsack\BoundedTest: A Knapsack implementation for discrete quantities, values and costs and bounded item quantities')] final class BoundedTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The optimal item selection in a backpack is calculated in order to optimize the value/profit while considering the available capacity/cost limit - * @covers phpOMS\Algorithm\Knapsack\Bounded - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The optimal item selection in a backpack is calculated in order to optimize the value/profit while considering the available capacity/cost limit')] public function testBackpacking() : void { $items = [ diff --git a/tests/Algorithm/Knapsack/ContinuousTest.php b/tests/Algorithm/Knapsack/ContinuousTest.php index 8c8688588..99f1fd977 100755 --- a/tests/Algorithm/Knapsack/ContinuousTest.php +++ b/tests/Algorithm/Knapsack/ContinuousTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ use phpOMS\Algorithm\Knapsack\Continuous; use phpOMS\Algorithm\Knapsack\Item; /** - * @testdox phpOMS\tests\Algorithm\Knapsack\ContinuousTest: A Knapsack implementation for continuous quantities, values and costs - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\Knapsack\Continuous::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Knapsack\ContinuousTest: A Knapsack implementation for continuous quantities, values and costs')] final class ContinuousTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The optimal item selection in a backpack is calculated in order to optimize the value/profit while considering the available capacity/cost limit [discrete quantities] - * @covers phpOMS\Algorithm\Knapsack\Continuous - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The optimal item selection in a backpack is calculated in order to optimize the value/profit while considering the available capacity/cost limit [discrete quantities]')] public function testBackpacking() : void { $items = [ @@ -67,11 +64,8 @@ final class ContinuousTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The optimal item selection in a backpack is calculated in order to optimize the value/profit while considering the available capacity/cost limit [continuous quantities] - * @covers phpOMS\Algorithm\Knapsack\Continuous - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The optimal item selection in a backpack is calculated in order to optimize the value/profit while considering the available capacity/cost limit [continuous quantities]')] public function testBackpackingAlternative() : void { $items = [ diff --git a/tests/Algorithm/Knapsack/ItemTest.php b/tests/Algorithm/Knapsack/ItemTest.php index c7bb4e340..f2811c61b 100755 --- a/tests/Algorithm/Knapsack/ItemTest.php +++ b/tests/Algorithm/Knapsack/ItemTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Algorithm\Knapsack; use phpOMS\Algorithm\Knapsack\Item; /** - * @testdox phpOMS\tests\Algorithm\Knapsack\ItemTest: The default item to be added to the backpack or basket - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\Knapsack\Item::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Knapsack\ItemTest: The default item to be added to the backpack or basket')] final class ItemTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The item has the expected values after initialization - * @covers phpOMS\Algorithm\Knapsack\Item - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The item has the expected values after initialization')] public function testDefault() : void { $item = new Item(3.0, 2.0, 'abc'); diff --git a/tests/Algorithm/Maze/MazeGeneratorTest.php b/tests/Algorithm/Maze/MazeGeneratorTest.php index 307e82a17..797be448b 100755 --- a/tests/Algorithm/Maze/MazeGeneratorTest.php +++ b/tests/Algorithm/Maze/MazeGeneratorTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ use phpOMS\Algorithm\Maze\MazeGenerator; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Maze\MazeGeneratorTest: Maze generation - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\Maze\MazeGenerator::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Maze\MazeGeneratorTest: Maze generation')] final class MazeGeneratorTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A random maze can be generated - * @covers phpOMS\Algorithm\Maze\MazeGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A random maze can be generated')] public function testMazeGeneration() : void { $maze = MazeGenerator::random(10, 7); @@ -59,11 +56,8 @@ final class MazeGeneratorTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A random maze can be rendered - * @covers phpOMS\Algorithm\Maze\MazeGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A random maze can be rendered')] public function testMazeRender() : void { $ob = MazeGenerator::render(MazeGenerator::random(10, 7)); diff --git a/tests/Algorithm/PathFinding/AStarNodeTest.php b/tests/Algorithm/PathFinding/AStarNodeTest.php index f83e1d3c8..ebfc13f22 100755 --- a/tests/Algorithm/PathFinding/AStarNodeTest.php +++ b/tests/Algorithm/PathFinding/AStarNodeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,10 @@ use phpOMS\Algorithm\PathFinding\AStarNode; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\PathFinding\AStarNode: AStarNode on grid for path finding - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\PathFinding\AStarNode::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\PathFinding\AStarNode: AStarNode on grid for path finding')] final class AStarNodeTest extends \PHPUnit\Framework\TestCase { protected $node; @@ -35,11 +35,8 @@ final class AStarNodeTest extends \PHPUnit\Framework\TestCase $this->node = new AStarNode(1, 2, 3.0, false); } - /** - * @testdox The node has the expected values after initialization - * @covers phpOMS\Algorithm\PathFinding\AStarNode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The node has the expected values after initialization')] public function testDefault() : void { self::assertFalse($this->node->isClosed()); @@ -49,55 +46,40 @@ final class AStarNodeTest extends \PHPUnit\Framework\TestCase self::assertEquals(0.0, $this->node->getF()); } - /** - * @testdox The node can be set closed and checked - * @covers phpOMS\Algorithm\PathFinding\AStarNode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The node can be set closed and checked')] public function testClosedInputOutput() : void { $this->node->setClosed(true); self::assertTrue($this->node->isClosed()); } - /** - * @testdox The node can be set opened and checked - * @covers phpOMS\Algorithm\PathFinding\AStarNode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The node can be set opened and checked')] public function testOpenedInputOutput() : void { $this->node->setOpened(true); self::assertTrue($this->node->isOpened()); } - /** - * @testdox The g value cen be set and returned - * @covers phpOMS\Algorithm\PathFinding\AStarNode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The g value cen be set and returned')] public function testGInputOutput() : void { $this->node->setG(2.0); self::assertEquals(2.0, $this->node->getG()); } - /** - * @testdox The h value cen be set and returned - * @covers phpOMS\Algorithm\PathFinding\AStarNode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The h value cen be set and returned')] public function testHInputOutput() : void { $this->node->setH(2.0); self::assertEquals(2.0, $this->node->getH()); } - /** - * @testdox The f value cen be set and returned - * @covers phpOMS\Algorithm\PathFinding\AStarNode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The f value cen be set and returned')] public function testFInputOutput() : void { $this->node->setF(2.0); diff --git a/tests/Algorithm/PathFinding/AStarTest.php b/tests/Algorithm/PathFinding/AStarTest.php index b5777cd9d..3862028fc 100755 --- a/tests/Algorithm/PathFinding/AStarTest.php +++ b/tests/Algorithm/PathFinding/AStarTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -24,10 +24,10 @@ use phpOMS\Algorithm\PathFinding\Path; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\PathFinding\AStarTest: AStar path finding - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\PathFinding\AStar::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\PathFinding\AStarTest: AStar path finding')] final class AStarTest extends \PHPUnit\Framework\TestCase { private array $gridArray = [ @@ -75,11 +75,8 @@ final class AStarTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox The correct path is found for diagonal movement - * @covers phpOMS\Algorithm\PathFinding\AStar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The correct path is found for diagonal movement')] public function testPathFindingDiagonal() : void { $grid = Grid::createGridFromArray($this->gridArray, AStarNode::class); @@ -138,11 +135,8 @@ final class AStarTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The correct path is found for straight movement - * @covers phpOMS\Algorithm\PathFinding\AStar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The correct path is found for straight movement')] public function testPathFindingStraight() : void { $grid = Grid::createGridFromArray($this->gridArray, AStarNode::class); @@ -201,11 +195,8 @@ final class AStarTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The correct path is found for diagonal movement [one obstacle] - * @covers phpOMS\Algorithm\PathFinding\AStar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The correct path is found for diagonal movement [one obstacle]')] public function testPathFindingDiagonalOneObstacle() : void { $grid = Grid::createGridFromArray($this->gridArray, AStarNode::class); @@ -264,11 +255,8 @@ final class AStarTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The correct path is found for diagonal movement [no obstacle] - * @covers phpOMS\Algorithm\PathFinding\AStar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The correct path is found for diagonal movement [no obstacle]')] public function testPathFindingDiagonalNoObstacle() : void { $grid = Grid::createGridFromArray($this->gridArray, AStarNode::class); @@ -327,11 +315,8 @@ final class AStarTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A invalid start or end node returns the grid - * @covers phpOMS\Algorithm\PathFinding\AStar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid start or end node returns the grid')] public function testInvalidStartEndNode() : void { $grid = Grid::createGridFromArray($this->gridArray, AStarNode::class); diff --git a/tests/Algorithm/PathFinding/GridTest.php b/tests/Algorithm/PathFinding/GridTest.php index 5c2f373d1..054f6a792 100755 --- a/tests/Algorithm/PathFinding/GridTest.php +++ b/tests/Algorithm/PathFinding/GridTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Algorithm\PathFinding\Node; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\PathFinding\GridTest: Grid for path finding - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\PathFinding\Grid::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\PathFinding\GridTest: Grid for path finding')] final class GridTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox By default a grid is empty - * @covers phpOMS\Algorithm\PathFinding\Grid - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('By default a grid is empty')] public function testDefault() : void { $grid = new Grid(); self::assertNull($grid->getNode(0, 0)); } - /** - * @testdox A grid can be created from an array - * @covers phpOMS\Algorithm\PathFinding\Grid - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A grid can be created from an array')] public function testGridFromArray() : void { $grid = Grid::createGridFromArray([ @@ -64,11 +58,8 @@ final class GridTest extends \PHPUnit\Framework\TestCase self::assertTrue($grid->isWalkable(2, 2)); } - /** - * @testdox A node can be set and returned from the grid - * @covers phpOMS\Algorithm\PathFinding\Grid - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A node can be set and returned from the grid')] public function testNodeInputOutput() : void { $grid = Grid::createGridFromArray([ @@ -82,11 +73,8 @@ final class GridTest extends \PHPUnit\Framework\TestCase self::assertFalse($grid->isWalkable(0, 0)); } - /** - * @testdox Out of bounds nodes cannot be returned - * @covers phpOMS\Algorithm\PathFinding\Grid::getNode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Out of bounds nodes cannot be returned')] public function testOutOfBoundsNode() : void { $grid = Grid::createGridFromArray([ @@ -101,11 +89,8 @@ final class GridTest extends \PHPUnit\Framework\TestCase self::assertNull($grid->getNode(0, 3)); } - /** - * @testdox All horizontal neighbors can be found correctly - * @covers phpOMS\Algorithm\PathFinding\Grid::getNeighbors - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All horizontal neighbors can be found correctly')] public function testStraightHorizontalNeighbors() : void { $grid = Grid::createGridFromArray([ @@ -122,11 +107,8 @@ final class GridTest extends \PHPUnit\Framework\TestCase self::assertTrue($grid->getNode(2, 1)->isEqual($neighbors[0])); } - /** - * @testdox All vertical neighbors can be found correctly - * @covers phpOMS\Algorithm\PathFinding\Grid::getNeighbors - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All vertical neighbors can be found correctly')] public function testStraightVerticalNeighbors() : void { $grid = Grid::createGridFromArray([ @@ -143,11 +125,8 @@ final class GridTest extends \PHPUnit\Framework\TestCase self::assertTrue($grid->getNode(1, 2)->isEqual($neighbors[1])); } - /** - * @testdox No straight neighbors are found if no straight neighbors exist - * @covers phpOMS\Algorithm\PathFinding\Grid::getNeighbors - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('No straight neighbors are found if no straight neighbors exist')] public function testStraightNoneNeighbors() : void { $grid = Grid::createGridFromArray([ @@ -162,11 +141,8 @@ final class GridTest extends \PHPUnit\Framework\TestCase self::assertEquals(0, \count($neighbors)); } - /** - * @testdox All straight neighbors can be found correctly - * @covers phpOMS\Algorithm\PathFinding\Grid::getNeighbors - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All straight neighbors can be found correctly')] public function testStraightAllNeighbors() : void { $grid = Grid::createGridFromArray([ @@ -185,11 +161,8 @@ final class GridTest extends \PHPUnit\Framework\TestCase self::assertTrue($grid->getNode(1, 2)->isEqual($neighbors[2])); } - /** - * @testdox All neighbors except blocked diagonal neighbors can be found correctly - * @covers phpOMS\Algorithm\PathFinding\Grid::getNeighbors - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All neighbors except blocked diagonal neighbors can be found correctly')] public function testDiagonalLRNeighbors() : void { $grid = Grid::createGridFromArray([ @@ -210,11 +183,8 @@ final class GridTest extends \PHPUnit\Framework\TestCase self::assertTrue($grid->getNode(2, 2)->isEqual($neighbors[5])); } - /** - * @testdox All neighbors except blocked diagonal neighbors can be found correctly - * @covers phpOMS\Algorithm\PathFinding\Grid::getNeighbors - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All neighbors except blocked diagonal neighbors can be found correctly')] public function testDiagonalURNeighbors() : void { $grid = Grid::createGridFromArray([ @@ -235,11 +205,8 @@ final class GridTest extends \PHPUnit\Framework\TestCase self::assertTrue($grid->getNode(0, 2)->isEqual($neighbors[5])); } - /** - * @testdox No diagonal neighbors are found if no neighbors exist - * @covers phpOMS\Algorithm\PathFinding\Grid::getNeighbors - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('No diagonal neighbors are found if no neighbors exist')] public function testDiagonalNoneNeighbors() : void { $grid = Grid::createGridFromArray([ @@ -254,11 +221,8 @@ final class GridTest extends \PHPUnit\Framework\TestCase self::assertEquals(0, \count($neighbors)); } - /** - * @testdox All diagonal neighbors can be found correctly - * @covers phpOMS\Algorithm\PathFinding\Grid::getNeighbors - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All diagonal neighbors can be found correctly')] public function testDiagonalOnlyNeighbors() : void { $grid = Grid::createGridFromArray([ @@ -277,11 +241,8 @@ final class GridTest extends \PHPUnit\Framework\TestCase self::assertTrue($grid->getNode(2, 2)->isEqual($neighbors[2])); } - /** - * @testdox All neighbors can be found correctly - * @covers phpOMS\Algorithm\PathFinding\Grid::getNeighbors - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All neighbors can be found correctly')] public function testDiagonalAllNeighbors() : void { $grid = Grid::createGridFromArray([ @@ -304,11 +265,8 @@ final class GridTest extends \PHPUnit\Framework\TestCase self::assertTrue($grid->getNode(2, 2)->isEqual($neighbors[6])); } - /** - * @testdox All neighbors can be found correctly even if one obstacle exists - * @covers phpOMS\Algorithm\PathFinding\Grid::getNeighbors - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All neighbors can be found correctly even if one obstacle exists')] public function testDiagonalOneObstacleNoBlockNeighbors() : void { $grid = Grid::createGridFromArray([ @@ -330,11 +288,8 @@ final class GridTest extends \PHPUnit\Framework\TestCase self::assertTrue($grid->getNode(2, 2)->isEqual($neighbors[5])); } - /** - * @testdox No diagonal neighbors are found if they are blocked on two sides - * @covers phpOMS\Algorithm\PathFinding\Grid::getNeighbors - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('No diagonal neighbors are found if they are blocked on two sides')] public function testDiagonalOneObstacleBlockNeighbors() : void { $grid = Grid::createGridFromArray([ @@ -354,11 +309,8 @@ final class GridTest extends \PHPUnit\Framework\TestCase self::assertTrue($grid->getNode(2, 2)->isEqual($neighbors[3])); } - /** - * @testdox All neighbors can be found correctly if no obstacles exists - * @covers phpOMS\Algorithm\PathFinding\Grid::getNeighbors - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All neighbors can be found correctly if no obstacles exists')] public function testDiagonalOneObstacleAllNeighbors() : void { $grid = Grid::createGridFromArray([ @@ -381,11 +333,8 @@ final class GridTest extends \PHPUnit\Framework\TestCase self::assertTrue($grid->getNode(2, 2)->isEqual($neighbors[6])); } - /** - * @testdox No diagonal neighbors are found if one obstacle exists - * @covers phpOMS\Algorithm\PathFinding\Grid::getNeighbors - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('No diagonal neighbors are found if one obstacle exists')] public function testDiagonalNoObstacleBlockNeighbors() : void { $grid = Grid::createGridFromArray([ @@ -405,11 +354,8 @@ final class GridTest extends \PHPUnit\Framework\TestCase self::assertTrue($grid->getNode(2, 2)->isEqual($neighbors[3])); } - /** - * @testdox All neighbors can be found correctly if no obstacles exist - * @covers phpOMS\Algorithm\PathFinding\Grid::getNeighbors - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All neighbors can be found correctly if no obstacles exist')] public function testDiagonalNoObstacleAllNeighbors() : void { $grid = Grid::createGridFromArray([ diff --git a/tests/Algorithm/PathFinding/HeuristicTest.php b/tests/Algorithm/PathFinding/HeuristicTest.php index a1bf26f12..75de9a787 100755 --- a/tests/Algorithm/PathFinding/HeuristicTest.php +++ b/tests/Algorithm/PathFinding/HeuristicTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,17 +20,14 @@ use phpOMS\Algorithm\PathFinding\HeuristicType; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\PathFinding\HeuristicTest: Heuristic for path finding - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\PathFinding\Heuristic::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\PathFinding\HeuristicTest: Heuristic for path finding')] final class HeuristicTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The heuristics return the correct metric results - * @covers phpOMS\Algorithm\PathFinding\Heuristic - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The heuristics return the correct metric results')] public function testHeuristics() : void { self::assertEquals( diff --git a/tests/Algorithm/PathFinding/JumpPointNodeTest.php b/tests/Algorithm/PathFinding/JumpPointNodeTest.php index 82d1e3d79..c963564d5 100755 --- a/tests/Algorithm/PathFinding/JumpPointNodeTest.php +++ b/tests/Algorithm/PathFinding/JumpPointNodeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,10 @@ use phpOMS\Algorithm\PathFinding\JumpPointNode; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\PathFinding\JumpPointNode: JumpPointNode on grid for path finding - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\PathFinding\JumpPointNode::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\PathFinding\JumpPointNode: JumpPointNode on grid for path finding')] final class JumpPointNodeTest extends \PHPUnit\Framework\TestCase { protected $node; @@ -35,11 +35,8 @@ final class JumpPointNodeTest extends \PHPUnit\Framework\TestCase $this->node = new JumpPointNode(1, 2, 3.0, false); } - /** - * @testdox The node has the expected values after initialization - * @covers phpOMS\Algorithm\PathFinding\JumpPointNode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The node has the expected values after initialization')] public function testDefault() : void { self::assertFalse($this->node->isClosed()); @@ -50,66 +47,48 @@ final class JumpPointNodeTest extends \PHPUnit\Framework\TestCase self::assertEquals(0.0, $this->node->getF()); } - /** - * @testdox The node can be set closed and checked - * @covers phpOMS\Algorithm\PathFinding\JumpPointNode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The node can be set closed and checked')] public function testClosedInputOutput() : void { $this->node->setClosed(true); self::assertTrue($this->node->isClosed()); } - /** - * @testdox The node can be set opened and checked - * @covers phpOMS\Algorithm\PathFinding\JumpPointNode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The node can be set opened and checked')] public function testOpenedInputOutput() : void { $this->node->setOpened(true); self::assertTrue($this->node->isOpened()); } - /** - * @testdox The node can be set tested and checked - * @covers phpOMS\Algorithm\PathFinding\JumpPointNode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The node can be set tested and checked')] public function testTestedInputOutput() : void { $this->node->setTested(true); self::assertTrue($this->node->isTested()); } - /** - * @testdox The g value cen be set and returned - * @covers phpOMS\Algorithm\PathFinding\JumpPointNode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The g value cen be set and returned')] public function testGInputOutput() : void { $this->node->setG(2.0); self::assertEquals(2.0, $this->node->getG()); } - /** - * @testdox The h value cen be set and returned - * @covers phpOMS\Algorithm\PathFinding\JumpPointNode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The h value cen be set and returned')] public function testHInputOutput() : void { $this->node->setH(2.0); self::assertEquals(2.0, $this->node->getH()); } - /** - * @testdox The f value cen be set and returned - * @covers phpOMS\Algorithm\PathFinding\JumpPointNode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The f value cen be set and returned')] public function testFInputOutput() : void { $this->node->setF(2.0); diff --git a/tests/Algorithm/PathFinding/JumpPointSearchTest.php b/tests/Algorithm/PathFinding/JumpPointSearchTest.php index f277c0360..305b5e5ef 100755 --- a/tests/Algorithm/PathFinding/JumpPointSearchTest.php +++ b/tests/Algorithm/PathFinding/JumpPointSearchTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -24,10 +24,10 @@ use phpOMS\Algorithm\PathFinding\Path; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\PathFinding\JumpPointSearchTest: JumpPoint path finding - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\PathFinding\JumpPointSearch::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\PathFinding\JumpPointSearchTest: JumpPoint path finding')] final class JumpPointSearchTest extends \PHPUnit\Framework\TestCase { private array $gridArray = [ @@ -75,11 +75,8 @@ final class JumpPointSearchTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox The correct path is found for diagonal movement - * @covers phpOMS\Algorithm\PathFinding\JumpPointSearch - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The correct path is found for diagonal movement')] public function testPathFindingDiagonal() : void { $grid = Grid::createGridFromArray($this->gridArray, JumpPointNode::class); @@ -119,11 +116,8 @@ final class JumpPointSearchTest extends \PHPUnit\Framework\TestCase ], $this->gridArray); } - /** - * @testdox The correct path is found for straight movement - * @covers phpOMS\Algorithm\PathFinding\JumpPointSearch - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The correct path is found for straight movement')] public function testPathFindingStraight() : void { $grid = Grid::createGridFromArray($this->gridArray, JumpPointNode::class); @@ -163,11 +157,8 @@ final class JumpPointSearchTest extends \PHPUnit\Framework\TestCase ], $this->gridArray); } - /** - * @testdox The correct path is found for diagonal movement [one obstacle] - * @covers phpOMS\Algorithm\PathFinding\JumpPointSearch - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The correct path is found for diagonal movement [one obstacle]')] public function testPathFindingDiagonalOneObstacle() : void { $grid = Grid::createGridFromArray($this->gridArray, JumpPointNode::class); @@ -207,11 +198,8 @@ final class JumpPointSearchTest extends \PHPUnit\Framework\TestCase ], $this->gridArray); } - /** - * @testdox The correct path is found for diagonal movement [no obstacle] - * @covers phpOMS\Algorithm\PathFinding\JumpPointSearch - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The correct path is found for diagonal movement [no obstacle]')] public function testPathFindingDiagonalNoObstacle() : void { $grid = Grid::createGridFromArray($this->gridArray, JumpPointNode::class); @@ -251,11 +239,8 @@ final class JumpPointSearchTest extends \PHPUnit\Framework\TestCase ], $this->gridArray); } - /** - * @testdox A invalid start or end node returns the grid - * @covers phpOMS\Algorithm\PathFinding\JumpPointSearch - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid start or end node returns the grid')] public function testInvalidStartEndNode() : void { $grid = Grid::createGridFromArray($this->gridArray, JumpPointNode::class); diff --git a/tests/Algorithm/PathFinding/NodeTest.php b/tests/Algorithm/PathFinding/NodeTest.php index cb1b7cb8b..29d5f9ee2 100755 --- a/tests/Algorithm/PathFinding/NodeTest.php +++ b/tests/Algorithm/PathFinding/NodeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ use phpOMS\Algorithm\PathFinding\Node; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\PathFinding\NodeTest: Node on grid for path finding - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\PathFinding\Node::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\PathFinding\NodeTest: Node on grid for path finding')] final class NodeTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The node has the expected values after initialization - * @covers phpOMS\Algorithm\PathFinding\Node - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The node has the expected values after initialization')] public function testDefault() : void { $node = new Node(1, 2, 3.0, false); @@ -42,11 +39,8 @@ final class NodeTest extends \PHPUnit\Framework\TestCase self::assertFalse($node->isWalkable); } - /** - * @testdox Nodes with equal coordinates are equal - * @covers phpOMS\Algorithm\PathFinding\Node - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Nodes with equal coordinates are equal')] public function testNodesWithEqualCoordinatesAreEqual() : void { $node = new Node(1, 2, 3.0, false); @@ -55,11 +49,8 @@ final class NodeTest extends \PHPUnit\Framework\TestCase self::assertTrue($node->isEqual($node2)); } - /** - * @testdox Nodes with different coordinates are not equal - * @covers phpOMS\Algorithm\PathFinding\Node - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Nodes with different coordinates are not equal')] public function testNodesWithDifferentCoordinatesAreNotEqual() : void { $node = new Node(1, 2, 3.0, false); @@ -68,11 +59,8 @@ final class NodeTest extends \PHPUnit\Framework\TestCase self::assertFalse($node->isEqual($node2)); } - /** - * @testdox A parent node can be set and returned - * @covers phpOMS\Algorithm\PathFinding\Node - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A parent node can be set and returned')] public function testParentInputOutput() : void { $node = new Node(1, 2, 3.0, false); diff --git a/tests/Algorithm/PathFinding/PathTest.php b/tests/Algorithm/PathFinding/PathTest.php index 53ab879fb..d7d6bc8c9 100755 --- a/tests/Algorithm/PathFinding/PathTest.php +++ b/tests/Algorithm/PathFinding/PathTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,17 +21,14 @@ use phpOMS\Algorithm\PathFinding\Path; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\PathFinding\PathTest: Path on grid - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\PathFinding\Path::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\PathFinding\PathTest: Path on grid')] final class PathTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The path has the expected values after initialization - * @covers phpOMS\Algorithm\PathFinding\Path - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The path has the expected values after initialization')] public function testDefault() : void { $path = new Path(new Grid()); @@ -40,11 +37,8 @@ final class PathTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $path->expandPath()); } - /** - * @testdox The diagonal euclidean path length is calculated correctly - * @covers phpOMS\Algorithm\PathFinding\Path - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The diagonal euclidean path length is calculated correctly')] public function testDiagonalPathLength() : void { $grid = Grid::createGridFromArray([ @@ -64,11 +58,8 @@ final class PathTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(4.2426, $path->getLength(), 0.001); } - /** - * @testdox The straight euclidean path length is calculated correctly - * @covers phpOMS\Algorithm\PathFinding\Path - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The straight euclidean path length is calculated correctly')] public function testStraightPathLength() : void { $grid = Grid::createGridFromArray([ @@ -88,11 +79,8 @@ final class PathTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(4.0, $path->getLength(), 0.001); } - /** - * @testdox The path is correctly expanded in case only jump points are defined - * @covers phpOMS\Algorithm\PathFinding\Path - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The path is correctly expanded in case only jump points are defined')] public function testPathExpansion() : void { $grid = Grid::createGridFromArray([ diff --git a/tests/Algorithm/Rating/EloTest.php b/tests/Algorithm/Rating/EloTest.php index 49a2994be..ee75c498b 100644 --- a/tests/Algorithm/Rating/EloTest.php +++ b/tests/Algorithm/Rating/EloTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ use phpOMS\Algorithm\Rating\Elo; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Rating\EloTest: Rating generation - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\Rating\Elo::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Rating\EloTest: Rating generation')] final class EloTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox 1v1 rating test - * @covers phpOMS\Algorithm\Rating\Elo - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('1v1 rating test')] public function testSoloRating() : void { $rating = new Elo(); @@ -79,11 +76,8 @@ final class EloTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox group rating test - * @covers phpOMS\Algorithm\Rating\Elo - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('group rating test')] public function testGroupRating() : void { $rating = new Elo(); diff --git a/tests/Algorithm/Rating/Glicko1Test.php b/tests/Algorithm/Rating/Glicko1Test.php index ec3c3199d..1e2b8bcda 100644 --- a/tests/Algorithm/Rating/Glicko1Test.php +++ b/tests/Algorithm/Rating/Glicko1Test.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ use phpOMS\Algorithm\Rating\Glicko1; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Rating\Glicko1Test: Rating generation - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\Rating\Glicko1::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Rating\Glicko1Test: Rating generation')] final class Glicko1Test extends \PHPUnit\Framework\TestCase { - /** - * @testdox 1v1 rating test - * @covers phpOMS\Algorithm\Rating\Glicko1 - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('1v1 rating test')] public function testSoloRating() : void { $rating = new Glicko1(); @@ -120,11 +117,8 @@ final class Glicko1Test extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox group rating test - * @covers phpOMS\Algorithm\Rating\Glicko1 - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('group rating test')] public function testGroupRating() : void { $rating = new Glicko1(); diff --git a/tests/Algorithm/Rating/Glicko2Test.php b/tests/Algorithm/Rating/Glicko2Test.php index 28b0cf8e0..faf11697c 100644 --- a/tests/Algorithm/Rating/Glicko2Test.php +++ b/tests/Algorithm/Rating/Glicko2Test.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ use phpOMS\Algorithm\Rating\Glicko2; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Rating\Glicko2Test: Rating generation - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Algorithm\Rating\Glicko2::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Rating\Glicko2Test: Rating generation')] final class Glicko2Test extends \PHPUnit\Framework\TestCase { - /** - * @testdox 1v1 rating test - * @covers phpOMS\Algorithm\Rating\Glicko2 - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('1v1 rating test')] public function testSoloRating() : void { $rating = new Glicko2(); @@ -140,11 +137,8 @@ final class Glicko2Test extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox group rating test - * @covers phpOMS\Algorithm\Rating\Glicko2 - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('group rating test')] public function testGroupRating() : void { $rating = new Glicko2(); diff --git a/tests/Algorithm/Sort/BitonicSortTest.php b/tests/Algorithm/Sort/BitonicSortTest.php index eca26689c..03b827d22 100755 --- a/tests/Algorithm/Sort/BitonicSortTest.php +++ b/tests/Algorithm/Sort/BitonicSortTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Algorithm\Sort\SortOrder; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Sort\BitonicSortTest: Bitonic sort - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Sort\BitonicSortTest: Bitonic sort')] final class BitonicSortTest extends \PHPUnit\Framework\TestCase { protected $list = []; @@ -41,10 +40,8 @@ final class BitonicSortTest extends \PHPUnit\Framework\TestCase ]; } - /** - * @testdox A list with one element returns the list with the element itself - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list with one element returns the list with the element itself')] public function testSmallList() : void { $smallList = [new NumericElement(3)]; @@ -53,10 +50,8 @@ final class BitonicSortTest extends \PHPUnit\Framework\TestCase self::assertEquals($smallList, $newList); } - /** - * @testdox A list ot elements can be sorted in ASC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in ASC order')] public function testSortASC() : void { $newList = BitonicSort::sort($this->list); @@ -69,10 +64,8 @@ final class BitonicSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A list ot elements can be sorted in DESC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in DESC order')] public function testSortDESC() : void { $newList = BitonicSort::sort($this->list, SortOrder::DESC); diff --git a/tests/Algorithm/Sort/BubbleSortTest.php b/tests/Algorithm/Sort/BubbleSortTest.php index 395893e05..b00fad3db 100755 --- a/tests/Algorithm/Sort/BubbleSortTest.php +++ b/tests/Algorithm/Sort/BubbleSortTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Algorithm\Sort\SortOrder; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Sort\BubbleSortTest: Bubble sort - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Sort\BubbleSortTest: Bubble sort')] final class BubbleSortTest extends \PHPUnit\Framework\TestCase { protected $list = []; @@ -42,10 +41,8 @@ final class BubbleSortTest extends \PHPUnit\Framework\TestCase ]; } - /** - * @testdox A list with one element returns the list with the element itself - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list with one element returns the list with the element itself')] public function testSmallList() : void { $smallList = [new NumericElement(3)]; @@ -54,10 +51,8 @@ final class BubbleSortTest extends \PHPUnit\Framework\TestCase self::assertEquals($smallList, $newList); } - /** - * @testdox A list ot elements can be sorted in ASC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in ASC order')] public function testSortASC() : void { $newList = BubbleSort::sort($this->list); @@ -70,10 +65,8 @@ final class BubbleSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A list ot elements can be sorted in DESC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in DESC order')] public function testSortDESC() : void { $newList = BubbleSort::sort($this->list, SortOrder::DESC); diff --git a/tests/Algorithm/Sort/BucketSortTest.php b/tests/Algorithm/Sort/BucketSortTest.php index b87038fdb..934b29f68 100755 --- a/tests/Algorithm/Sort/BucketSortTest.php +++ b/tests/Algorithm/Sort/BucketSortTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Algorithm\Sort\SortOrder; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Sort\BucketSortTest: Bucket sort - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Sort\BucketSortTest: Bucket sort')] final class BucketSortTest extends \PHPUnit\Framework\TestCase { protected $list = []; @@ -42,10 +41,8 @@ final class BucketSortTest extends \PHPUnit\Framework\TestCase ]; } - /** - * @testdox A list with one element returns the list with the element itself - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list with one element returns the list with the element itself')] public function testSmallList() : void { $smallList = [new NumericElement(3)]; @@ -54,10 +51,8 @@ final class BucketSortTest extends \PHPUnit\Framework\TestCase self::assertEquals($smallList, $newList); } - /** - * @testdox A list ot elements can be sorted in ASC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in ASC order')] public function testSortASC() : void { $newList = BucketSort::sort($this->list, 2, \phpOMS\Algorithm\Sort\SelectionSort::class); @@ -70,10 +65,8 @@ final class BucketSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A list ot elements can be sorted in DESC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in DESC order')] public function testSortDESC() : void { $newList = BucketSort::sort($this->list, 2, \phpOMS\Algorithm\Sort\SelectionSort::class, SortOrder::DESC); @@ -86,10 +79,8 @@ final class BucketSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox If no buckets are specified the elements cannot be sorted and an empty result is returned - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('If no buckets are specified the elements cannot be sorted and an empty result is returned')] public function testNoBuckets() : void { $newList = BucketSort::sort($this->list, 0, \phpOMS\Algorithm\Sort\SelectionSort::class); diff --git a/tests/Algorithm/Sort/CocktailShakerSortTest.php b/tests/Algorithm/Sort/CocktailShakerSortTest.php index 50036d39b..5857f27ea 100755 --- a/tests/Algorithm/Sort/CocktailShakerSortTest.php +++ b/tests/Algorithm/Sort/CocktailShakerSortTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Algorithm\Sort\SortOrder; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Sort\CocktailShakerSortTest: CocktailShaker sort - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Sort\CocktailShakerSortTest: CocktailShaker sort')] final class CocktailShakerSortTest extends \PHPUnit\Framework\TestCase { protected $list = []; @@ -42,10 +41,8 @@ final class CocktailShakerSortTest extends \PHPUnit\Framework\TestCase ]; } - /** - * @testdox A list with one element returns the list with the element itself - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list with one element returns the list with the element itself')] public function testSmallList() : void { $smallList = [new NumericElement(3)]; @@ -54,10 +51,8 @@ final class CocktailShakerSortTest extends \PHPUnit\Framework\TestCase self::assertEquals($smallList, $newList); } - /** - * @testdox A list ot elements can be sorted in ASC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in ASC order')] public function testSortASC() : void { $newList = CocktailShakerSort::sort($this->list); @@ -70,10 +65,8 @@ final class CocktailShakerSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A list ot elements can be sorted in DESC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in DESC order')] public function testSortDESC() : void { $newList = CocktailShakerSort::sort($this->list, SortOrder::DESC); diff --git a/tests/Algorithm/Sort/CombSortTest.php b/tests/Algorithm/Sort/CombSortTest.php index 77ad98c38..47e30d998 100755 --- a/tests/Algorithm/Sort/CombSortTest.php +++ b/tests/Algorithm/Sort/CombSortTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Algorithm\Sort\SortOrder; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Sort\CombSortTest: Comb sort - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Sort\CombSortTest: Comb sort')] final class CombSortTest extends \PHPUnit\Framework\TestCase { protected $list = []; @@ -42,10 +41,8 @@ final class CombSortTest extends \PHPUnit\Framework\TestCase ]; } - /** - * @testdox A list with one element returns the list with the element itself - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list with one element returns the list with the element itself')] public function testSmallList() : void { $smallList = [new NumericElement(3)]; @@ -54,10 +51,8 @@ final class CombSortTest extends \PHPUnit\Framework\TestCase self::assertEquals($smallList, $newList); } - /** - * @testdox A list ot elements can be sorted in ASC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in ASC order')] public function testSortASC() : void { $newList = CombSort::sort($this->list); @@ -70,10 +65,8 @@ final class CombSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A list ot elements can be sorted in DESC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in DESC order')] public function testSortDESC() : void { $newList = CombSort::sort($this->list, SortOrder::DESC); diff --git a/tests/Algorithm/Sort/CycleSortTest.php b/tests/Algorithm/Sort/CycleSortTest.php index 9f2210372..f8edf7f68 100755 --- a/tests/Algorithm/Sort/CycleSortTest.php +++ b/tests/Algorithm/Sort/CycleSortTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Algorithm\Sort\SortOrder; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Sort\CycleSortTest: Cycle sort - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Sort\CycleSortTest: Cycle sort')] final class CycleSortTest extends \PHPUnit\Framework\TestCase { protected $list = []; @@ -43,10 +42,8 @@ final class CycleSortTest extends \PHPUnit\Framework\TestCase ]; } - /** - * @testdox A list with one element returns the list with the element itself - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list with one element returns the list with the element itself')] public function testSmallList() : void { $smallList = [new NumericElement(3)]; @@ -55,10 +52,8 @@ final class CycleSortTest extends \PHPUnit\Framework\TestCase self::assertEquals($smallList, $newList); } - /** - * @testdox A list ot elements can be sorted in ASC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in ASC order')] public function testSortASC() : void { $newList = CycleSort::sort($this->list); @@ -71,10 +66,8 @@ final class CycleSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A list ot elements can be sorted in DESC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in DESC order')] public function testSortDESC() : void { $newList = CycleSort::sort($this->list, SortOrder::DESC); diff --git a/tests/Algorithm/Sort/GnomeSortTest.php b/tests/Algorithm/Sort/GnomeSortTest.php index fd2787841..ad93c304a 100755 --- a/tests/Algorithm/Sort/GnomeSortTest.php +++ b/tests/Algorithm/Sort/GnomeSortTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Algorithm\Sort\SortOrder; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Sort\GnomeSortTest: Gnome sort - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Sort\GnomeSortTest: Gnome sort')] final class GnomeSortTest extends \PHPUnit\Framework\TestCase { protected $list = []; @@ -42,10 +41,8 @@ final class GnomeSortTest extends \PHPUnit\Framework\TestCase ]; } - /** - * @testdox A list with one element returns the list with the element itself - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list with one element returns the list with the element itself')] public function testSmallList() : void { $smallList = [new NumericElement(3)]; @@ -54,10 +51,8 @@ final class GnomeSortTest extends \PHPUnit\Framework\TestCase self::assertEquals($smallList, $newList); } - /** - * @testdox A list ot elements can be sorted in ASC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in ASC order')] public function testSortASC() : void { $newList = GnomeSort::sort($this->list); @@ -70,10 +65,8 @@ final class GnomeSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A list ot elements can be sorted in DESC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in DESC order')] public function testSortDESC() : void { $newList = GnomeSort::sort($this->list, SortOrder::DESC); diff --git a/tests/Algorithm/Sort/HeapSortTest.php b/tests/Algorithm/Sort/HeapSortTest.php index 24ce3b1ba..24864ac17 100755 --- a/tests/Algorithm/Sort/HeapSortTest.php +++ b/tests/Algorithm/Sort/HeapSortTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Algorithm\Sort\SortOrder; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Sort\HeapSortTest: Heap sort - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Sort\HeapSortTest: Heap sort')] final class HeapSortTest extends \PHPUnit\Framework\TestCase { protected $list = []; @@ -42,10 +41,8 @@ final class HeapSortTest extends \PHPUnit\Framework\TestCase ]; } - /** - * @testdox A list with one element returns the list with the element itself - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list with one element returns the list with the element itself')] public function testSmallList() : void { $smallList = [new NumericElement(3)]; @@ -54,10 +51,8 @@ final class HeapSortTest extends \PHPUnit\Framework\TestCase self::assertEquals($smallList, $newList); } - /** - * @testdox A list ot elements can be sorted in ASC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in ASC order')] public function testSortASC() : void { $newList = HeapSort::sort($this->list); @@ -70,10 +65,8 @@ final class HeapSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A list ot elements can be sorted in DESC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in DESC order')] public function testSortDESC() : void { $newList = HeapSort::sort($this->list, SortOrder::DESC); diff --git a/tests/Algorithm/Sort/InsertionSortTest.php b/tests/Algorithm/Sort/InsertionSortTest.php index cf2a36c21..db5e78c4f 100755 --- a/tests/Algorithm/Sort/InsertionSortTest.php +++ b/tests/Algorithm/Sort/InsertionSortTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Algorithm\Sort\SortOrder; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Sort\InsertionSortTest: Insertion sort - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Sort\InsertionSortTest: Insertion sort')] final class InsertionSortTest extends \PHPUnit\Framework\TestCase { protected $list = []; @@ -42,10 +41,8 @@ final class InsertionSortTest extends \PHPUnit\Framework\TestCase ]; } - /** - * @testdox A list with one element returns the list with the element itself - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list with one element returns the list with the element itself')] public function testSmallList() : void { $smallList = [new NumericElement(3)]; @@ -54,10 +51,8 @@ final class InsertionSortTest extends \PHPUnit\Framework\TestCase self::assertEquals($smallList, $newList); } - /** - * @testdox A list ot elements can be sorted in ASC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in ASC order')] public function testSortASC() : void { $newList = InsertionSort::sort($this->list); @@ -70,10 +65,8 @@ final class InsertionSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A list ot elements can be sorted in DESC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in DESC order')] public function testSortDESC() : void { $newList = InsertionSort::sort($this->list, SortOrder::DESC); diff --git a/tests/Algorithm/Sort/IntroSortTest.php b/tests/Algorithm/Sort/IntroSortTest.php index 8837319c2..3af1549e4 100755 --- a/tests/Algorithm/Sort/IntroSortTest.php +++ b/tests/Algorithm/Sort/IntroSortTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Algorithm\Sort\SortOrder; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Sort\IntroSortTest: Intro sort - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Sort\IntroSortTest: Intro sort')] final class IntroSortTest extends \PHPUnit\Framework\TestCase { protected $list = []; @@ -42,10 +41,8 @@ final class IntroSortTest extends \PHPUnit\Framework\TestCase ]; } - /** - * @testdox A list with one element returns the list with the element itself - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list with one element returns the list with the element itself')] public function testSmallList() : void { $smallList = [new NumericElement(3)]; @@ -54,10 +51,8 @@ final class IntroSortTest extends \PHPUnit\Framework\TestCase self::assertEquals($smallList, $newList); } - /** - * @testdox A list ot elements can be sorted in ASC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in ASC order')] public function testSortASC() : void { $newList = IntroSort::sort($this->list); @@ -99,10 +94,8 @@ final class IntroSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A list ot elements can be sorted in DESC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in DESC order')] public function testSortDESC() : void { $newList = IntroSort::sort($this->list, SortOrder::DESC); diff --git a/tests/Algorithm/Sort/MergeSortTest.php b/tests/Algorithm/Sort/MergeSortTest.php index 34e347ef1..7689c39de 100755 --- a/tests/Algorithm/Sort/MergeSortTest.php +++ b/tests/Algorithm/Sort/MergeSortTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Algorithm\Sort\SortOrder; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Sort\MergeSortTest: Merge sort - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Sort\MergeSortTest: Merge sort')] final class MergeSortTest extends \PHPUnit\Framework\TestCase { protected $list = []; @@ -42,10 +41,8 @@ final class MergeSortTest extends \PHPUnit\Framework\TestCase ]; } - /** - * @testdox A list with one element returns the list with the element itself - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list with one element returns the list with the element itself')] public function testSmallList() : void { $smallList = [new NumericElement(3)]; @@ -54,10 +51,8 @@ final class MergeSortTest extends \PHPUnit\Framework\TestCase self::assertEquals($smallList, $newList); } - /** - * @testdox A list ot elements can be sorted in ASC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in ASC order')] public function testSortASC() : void { $newList = MergeSort::sort($this->list); @@ -70,10 +65,8 @@ final class MergeSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A list ot elements can be sorted in DESC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in DESC order')] public function testSortDESC() : void { $newList = MergeSort::sort($this->list, SortOrder::DESC); diff --git a/tests/Algorithm/Sort/NumericElement.php b/tests/Algorithm/Sort/NumericElement.php index c0d4cd6a8..926894dce 100755 --- a/tests/Algorithm/Sort/NumericElement.php +++ b/tests/Algorithm/Sort/NumericElement.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Algorithm/Sort/OddEvenSortTest.php b/tests/Algorithm/Sort/OddEvenSortTest.php index 318d7c324..d40aef6e2 100755 --- a/tests/Algorithm/Sort/OddEvenSortTest.php +++ b/tests/Algorithm/Sort/OddEvenSortTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Algorithm\Sort\SortOrder; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Sort\OddEvenSortTest: OddEven sort - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Sort\OddEvenSortTest: OddEven sort')] final class OddEvenSortTest extends \PHPUnit\Framework\TestCase { protected $list = []; @@ -42,10 +41,8 @@ final class OddEvenSortTest extends \PHPUnit\Framework\TestCase ]; } - /** - * @testdox A list with one element returns the list with the element itself - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list with one element returns the list with the element itself')] public function testSmallList() : void { $smallList = [new NumericElement(3)]; @@ -54,10 +51,8 @@ final class OddEvenSortTest extends \PHPUnit\Framework\TestCase self::assertEquals($smallList, $newList); } - /** - * @testdox A list ot elements can be sorted in ASC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in ASC order')] public function testSortASC() : void { $newList = OddEvenSort::sort($this->list); @@ -70,10 +65,8 @@ final class OddEvenSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A list ot elements can be sorted in DESC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in DESC order')] public function testSortDESC() : void { $newList = OddEvenSort::sort($this->list, SortOrder::DESC); diff --git a/tests/Algorithm/Sort/PancakeSortTest.php b/tests/Algorithm/Sort/PancakeSortTest.php index ce9d49be2..ea5ee36f5 100755 --- a/tests/Algorithm/Sort/PancakeSortTest.php +++ b/tests/Algorithm/Sort/PancakeSortTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Algorithm\Sort\SortOrder; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Sort\PancakeSortTest: Pancake sort - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Sort\PancakeSortTest: Pancake sort')] final class PancakeSortTest extends \PHPUnit\Framework\TestCase { protected $list = []; @@ -42,10 +41,8 @@ final class PancakeSortTest extends \PHPUnit\Framework\TestCase ]; } - /** - * @testdox A list with one element returns the list with the element itself - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list with one element returns the list with the element itself')] public function testSmallList() : void { $smallList = [new NumericElement(3)]; @@ -54,10 +51,8 @@ final class PancakeSortTest extends \PHPUnit\Framework\TestCase self::assertEquals($smallList, $newList); } - /** - * @testdox A list ot elements can be sorted in ASC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in ASC order')] public function testSortASC() : void { $newList = PancakeSort::sort($this->list); @@ -70,10 +65,8 @@ final class PancakeSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A list ot elements can be sorted in DESC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in DESC order')] public function testSortDESC() : void { $newList = PancakeSort::sort($this->list, SortOrder::DESC); diff --git a/tests/Algorithm/Sort/QuickSortTest.php b/tests/Algorithm/Sort/QuickSortTest.php index 1edc95236..f328be7d6 100755 --- a/tests/Algorithm/Sort/QuickSortTest.php +++ b/tests/Algorithm/Sort/QuickSortTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Algorithm\Sort\SortOrder; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Sort\QuickSortTest: Quick sort - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Sort\QuickSortTest: Quick sort')] final class QuickSortTest extends \PHPUnit\Framework\TestCase { protected $list = []; @@ -42,10 +41,8 @@ final class QuickSortTest extends \PHPUnit\Framework\TestCase ]; } - /** - * @testdox A list with one element returns the list with the element itself - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list with one element returns the list with the element itself')] public function testSmallList() : void { $smallList = [new NumericElement(3)]; @@ -54,10 +51,8 @@ final class QuickSortTest extends \PHPUnit\Framework\TestCase self::assertEquals($smallList, $newList); } - /** - * @testdox A list ot elements can be sorted in ASC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in ASC order')] public function testSortASC() : void { $newList = QuickSort::sort($this->list); @@ -70,10 +65,8 @@ final class QuickSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A list ot elements can be sorted in DESC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in DESC order')] public function testSortDESC() : void { $newList = QuickSort::sort($this->list, SortOrder::DESC); diff --git a/tests/Algorithm/Sort/SelectionSortTest.php b/tests/Algorithm/Sort/SelectionSortTest.php index 9883509ca..04961a766 100755 --- a/tests/Algorithm/Sort/SelectionSortTest.php +++ b/tests/Algorithm/Sort/SelectionSortTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Algorithm\Sort\SortOrder; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Sort\SelectionSortTest: Selection sort - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Sort\SelectionSortTest: Selection sort')] final class SelectionSortTest extends \PHPUnit\Framework\TestCase { protected $list = []; @@ -42,10 +41,8 @@ final class SelectionSortTest extends \PHPUnit\Framework\TestCase ]; } - /** - * @testdox A list with one element returns the list with the element itself - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list with one element returns the list with the element itself')] public function testSmallList() : void { $smallList = [new NumericElement(3)]; @@ -54,10 +51,8 @@ final class SelectionSortTest extends \PHPUnit\Framework\TestCase self::assertEquals($smallList, $newList); } - /** - * @testdox A list ot elements can be sorted in ASC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in ASC order')] public function testSortASC() : void { $newList = SelectionSort::sort($this->list); @@ -70,10 +65,8 @@ final class SelectionSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A list ot elements can be sorted in DESC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in DESC order')] public function testSortDESC() : void { $newList = SelectionSort::sort($this->list, SortOrder::DESC); diff --git a/tests/Algorithm/Sort/ShellSortTest.php b/tests/Algorithm/Sort/ShellSortTest.php index 6ddb3788e..8bc8b113b 100755 --- a/tests/Algorithm/Sort/ShellSortTest.php +++ b/tests/Algorithm/Sort/ShellSortTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Algorithm\Sort\SortOrder; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Sort\ShellSortTest: Shell sort - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Sort\ShellSortTest: Shell sort')] final class ShellSortTest extends \PHPUnit\Framework\TestCase { protected $list = []; @@ -42,10 +41,8 @@ final class ShellSortTest extends \PHPUnit\Framework\TestCase ]; } - /** - * @testdox A list with one element returns the list with the element itself - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list with one element returns the list with the element itself')] public function testSmallList() : void { $smallList = [new NumericElement(3)]; @@ -54,10 +51,8 @@ final class ShellSortTest extends \PHPUnit\Framework\TestCase self::assertEquals($smallList, $newList); } - /** - * @testdox A list ot elements can be sorted in ASC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in ASC order')] public function testSortASC() : void { $newList = ShellSort::sort($this->list); @@ -70,10 +65,8 @@ final class ShellSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A list ot elements can be sorted in DESC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in DESC order')] public function testSortDESC() : void { $newList = ShellSort::sort($this->list, SortOrder::DESC); diff --git a/tests/Algorithm/Sort/StoogeSortTest.php b/tests/Algorithm/Sort/StoogeSortTest.php index e8664b30c..017e60e5d 100755 --- a/tests/Algorithm/Sort/StoogeSortTest.php +++ b/tests/Algorithm/Sort/StoogeSortTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Algorithm\Sort\StoogeSort; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Sort\StoogeSortTest: Stooge sort - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Sort\StoogeSortTest: Stooge sort')] final class StoogeSortTest extends \PHPUnit\Framework\TestCase { protected $list = []; @@ -43,10 +42,8 @@ final class StoogeSortTest extends \PHPUnit\Framework\TestCase ]; } - /** - * @testdox A list with one element returns the list with the element itself - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list with one element returns the list with the element itself')] public function testSmallList() : void { $smallList = [new NumericElement(3)]; @@ -55,10 +52,8 @@ final class StoogeSortTest extends \PHPUnit\Framework\TestCase self::assertEquals($smallList, $newList); } - /** - * @testdox A list ot elements can be sorted in ASC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in ASC order')] public function testSortASC() : void { $newList = StoogeSort::sort($this->list); @@ -71,10 +66,8 @@ final class StoogeSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A list ot elements can be sorted in DESC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in DESC order')] public function testSortDESC() : void { $newList = StoogeSort::sort($this->list, SortOrder::DESC); diff --git a/tests/Algorithm/Sort/TimSortTest.php b/tests/Algorithm/Sort/TimSortTest.php index 11968280a..2e35932a2 100755 --- a/tests/Algorithm/Sort/TimSortTest.php +++ b/tests/Algorithm/Sort/TimSortTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Algorithm\Sort\TimSort; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Algorithm\Sort\TimSortTest: Tim sort - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Algorithm\Sort\TimSortTest: Tim sort')] final class TimSortTest extends \PHPUnit\Framework\TestCase { protected $list = []; @@ -42,10 +41,8 @@ final class TimSortTest extends \PHPUnit\Framework\TestCase ]; } - /** - * @testdox A list with one element returns the list with the element itself - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list with one element returns the list with the element itself')] public function testSmallList() : void { $smallList = [new NumericElement(3)]; @@ -54,10 +51,8 @@ final class TimSortTest extends \PHPUnit\Framework\TestCase self::assertEquals($smallList, $newList); } - /** - * @testdox A list ot elements can be sorted in ASC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in ASC order')] public function testSortASC() : void { $newList = TimSort::sort($this->list); @@ -99,10 +94,8 @@ final class TimSortTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A list ot elements can be sorted in DESC order - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list ot elements can be sorted in DESC order')] public function testSortDESC() : void { $newList = TimSort::sort($this->list, SortOrder::DESC); diff --git a/tests/Api/EUVAT/EUVATBffOnlineTest.php b/tests/Api/EUVAT/EUVATBffOnlineTest.php index 153efe594..e5cd26e1f 100755 --- a/tests/Api/EUVAT/EUVATBffOnlineTest.php +++ b/tests/Api/EUVAT/EUVATBffOnlineTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Api\EUVAT; use phpOMS\Api\EUVAT\EUVATBffOnline; /** - * @testdox phpOMS\tests\Api\EUVAT\EUVATBffOnlineTest: EU VAT German BFF Online validation - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Api\EUVAT\EUVATBffOnline::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Api\EUVAT\EUVATBffOnlineTest: EU VAT German BFF Online validation')] final class EUVATBffOnlineTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The BFF Online service can validate a valid VAT ID - * @covers phpOMS\Api\EUVAT\EUVATBffOnline - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The BFF Online service can validate a valid VAT ID')] public function testValidateInvalidId() : void { $status = EUVATBffOnline::validate('DE123456789', 'DE123456789'); diff --git a/tests/Api/EUVAT/EUVATViesTest.php b/tests/Api/EUVAT/EUVATViesTest.php index 87760ad76..9fac55978 100755 --- a/tests/Api/EUVAT/EUVATViesTest.php +++ b/tests/Api/EUVAT/EUVATViesTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Api\EUVAT; use phpOMS\Api\EUVAT\EUVATVies; /** - * @testdox phpOMS\tests\Api\EUVAT\EUVATViesTest: EU VAT Vies validation - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Api\EUVAT\EUVATVies::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Api\EUVAT\EUVATViesTest: EU VAT Vies validation')] final class EUVATViesTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The VIES service can validate a valid VAT ID - * @covers phpOMS\Api\EUVAT\EUVATVies - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The VIES service can validate a valid VAT ID')] public function testValidateInvalidId() : void { $status = EUVATVies::validate('DE123456789'); diff --git a/tests/Api/Geocoding/NominatimTest.php b/tests/Api/Geocoding/NominatimTest.php index 2d12e42fc..3922a4bcc 100644 --- a/tests/Api/Geocoding/NominatimTest.php +++ b/tests/Api/Geocoding/NominatimTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,9 @@ namespace phpOMS\tests\Api\Geocoding; use phpOMS\Api\Geocoding\Nominatim; /** - * @testdox phpOMS\tests\Api\Geocoding\NominatimTest: EU VAT Vies validation - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Api\Geocoding\NominatimTest: EU VAT Vies validation')] final class NominatimTest extends \PHPUnit\Framework\TestCase { public function testGeocoding() : void diff --git a/tests/Application/ApplicationAbstractTest.php b/tests/Application/ApplicationAbstractTest.php index db2284312..7b45a6b43 100755 --- a/tests/Application/ApplicationAbstractTest.php +++ b/tests/Application/ApplicationAbstractTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Application; use phpOMS\Application\ApplicationAbstract; /** - * @testdox phpOMS\tests\Application\ApplicationAbstractTest: Application abstraction - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Application\ApplicationAbstract::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Application\ApplicationAbstractTest: Application abstraction')] final class ApplicationAbstractTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Application values can be set and returned - * @covers phpOMS\Application\ApplicationAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Application values can be set and returned')] public function testInputOutput() : void { $obj = new class() extends ApplicationAbstract {}; @@ -36,11 +33,8 @@ final class ApplicationAbstractTest extends \PHPUnit\Framework\TestCase self::assertEquals('Test', $obj->appName); } - /** - * @testdox Application values cannot be overwritten - * @covers phpOMS\Application\ApplicationAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Application values cannot be overwritten')] public function testInvalidInputOutput() : void { $obj = new class() extends ApplicationAbstract {}; diff --git a/tests/Application/ApplicationInfoTest.php b/tests/Application/ApplicationInfoTest.php index 6af83db67..f82fdc042 100755 --- a/tests/Application/ApplicationInfoTest.php +++ b/tests/Application/ApplicationInfoTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Application\ApplicationInfo; /** - * @testdox phpOMS\tests\Application\ApplicationInfoTest: Module info file manager - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Application\ApplicationInfo::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Application\ApplicationInfoTest: Module info file manager')] final class ApplicationInfoTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox An application info file can be correctly loaded - * @covers phpOMS\Application\ApplicationInfo - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An application info file can be correctly loaded')] public function testLoad() : void { $info = new ApplicationInfo(__DIR__ . '/info-test.json'); @@ -49,11 +46,8 @@ final class ApplicationInfoTest extends \PHPUnit\Framework\TestCase self::assertEquals(__DIR__ . '/info-test.json', $info->getPath()); } - /** - * @testdox A info file can be modified - * @covers phpOMS\Application\ApplicationInfo - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A info file can be modified')] public function testChange() : void { $jarray = \json_decode(\file_get_contents(__DIR__ . '/info-test.json'), true); @@ -73,11 +67,8 @@ final class ApplicationInfoTest extends \PHPUnit\Framework\TestCase $info->update(); } - /** - * @testdox A invalid info file path load throws a PathException - * @covers phpOMS\Application\ApplicationInfo - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid info file path load throws a PathException')] public function testInvalidPathLoad() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -86,11 +77,8 @@ final class ApplicationInfoTest extends \PHPUnit\Framework\TestCase $info->load(); } - /** - * @testdox A invalid info file path update throws a PathException - * @covers phpOMS\Application\ApplicationInfo - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid info file path update throws a PathException')] public function testInvalidPathUpdate() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -99,11 +87,8 @@ final class ApplicationInfoTest extends \PHPUnit\Framework\TestCase $info->update(); } - /** - * @testdox A invalid change data throws a InvalidArgumentException - * @covers phpOMS\Application\ApplicationInfo - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid change data throws a InvalidArgumentException')] public function testInvalidDataSet() : void { $this->expectException(\InvalidArgumentException::class); diff --git a/tests/Application/ApplicationManagerTest.php b/tests/Application/ApplicationManagerTest.php index aac7e3318..4c5f7dde3 100755 --- a/tests/Application/ApplicationManagerTest.php +++ b/tests/Application/ApplicationManagerTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -27,10 +27,13 @@ use phpOMS\Router\WebRouter; use phpOMS\System\File\Local\Directory; /** - * @testdox phpOMS\tests\Application\ApplicationManagerTest: Application manager - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Application\ApplicationManager::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Application\InstallerAbstract::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Application\StatusAbstract::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Application\UninstallerAbstract::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Application\ApplicationManagerTest: Application manager')] final class ApplicationManagerTest extends \PHPUnit\Framework\TestCase { protected ApplicationManager $appManager; @@ -84,14 +87,8 @@ final class ApplicationManagerTest extends \PHPUnit\Framework\TestCase $this->appManager = new ApplicationManager($app); } - /** - * @testdox An application can be installed and uninstalled - * @covers phpOMS\Application\ApplicationManager - * @covers phpOMS\Application\InstallerAbstract - * @covers phpOMS\Application\StatusAbstract - * @covers phpOMS\Application\UninstallerAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An application can be installed and uninstalled')] public function testInstallUninstall() : void { self::assertTrue($this->appManager->install(__DIR__ . '/Testapp', __DIR__ . '/Apps/Testapp')); @@ -110,14 +107,8 @@ final class ApplicationManagerTest extends \PHPUnit\Framework\TestCase self::assertFalse(\is_dir(__DIR__ . '/Apps/Testapp')); } - /** - * @testdox An application can be re-initialized - * @testdox A module can be re-initialized - * @covers phpOMS\Application\ApplicationManager - * @covers phpOMS\Application\InstallerAbstract - * @covers phpOMS\Application\StatusAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An application can be re-initialized')] public function testReInit() : void { Directory::delete(__DIR__ . '/Apps/Testapp'); @@ -140,53 +131,38 @@ final class ApplicationManagerTest extends \PHPUnit\Framework\TestCase Directory::delete(__DIR__ . '/Apps/Testapp'); } - /** - * @testdox A invalid application path results in no installation - * @covers phpOMS\Application\ApplicationManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid application path results in no installation')] public function testInvalidSourceDestinationInstallPath() : void { self::assertFalse($this->appManager->install(__DIR__ . '/invalid', __DIR__)); self::assertFalse($this->appManager->install(__DIR__, __DIR__)); } - /** - * @testdox A missing installation file results in no installation - * @covers phpOMS\Application\ApplicationManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing installation file results in no installation')] public function testMissingInstallerPath() : void { self::assertFalse($this->appManager->install(__DIR__ . '/MissingInstaller', __DIR__ . '/Apps/MissingInstaller')); } - /** - * @testdox A missing info file results in no installation - * @covers phpOMS\Application\ApplicationManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing info file results in no installation')] public function testMissingApplicationInfoFile() : void { self::assertFalse($this->appManager->install(__DIR__ . '/MissingInfo', __DIR__ . '/Apps/MissingInfo')); } - /** - * @testdox A invalid application path results in no uninstall - * @covers phpOMS\Application\ApplicationManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid application path results in no uninstall')] public function testInvalidSourceUninstallPath() : void { self::assertFalse($this->appManager->uninstall(__DIR__ . '/invalid')); self::assertFalse($this->appManager->uninstall(__DIR__)); } - /** - * @testdox A missing uninstall file results in no uninstall - * @covers phpOMS\Application\ApplicationManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing uninstall file results in no uninstall')] public function testMissingUninstallerPath() : void { self::assertFalse($this->appManager->uninstall(__DIR__ . '/Apps/MissingInstaller')); diff --git a/tests/Application/InstallerAbstractTest.php b/tests/Application/InstallerAbstractTest.php index 0cdba868d..005eb44fe 100755 --- a/tests/Application/InstallerAbstractTest.php +++ b/tests/Application/InstallerAbstractTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,10 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Application\InstallerAbstract; /** - * @testdox phpOMS\tests\Application\InstallerAbstractTest: Abstract application installer - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Application\InstallerAbstract::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Application\InstallerAbstractTest: Abstract application installer')] final class InstallerAbstractTest extends \PHPUnit\Framework\TestCase { protected InstallerAbstract $installer; @@ -37,11 +37,8 @@ final class InstallerAbstractTest extends \PHPUnit\Framework\TestCase }; } - /** - * @testdox An invalid theme cannot be installed - * @covers phpOMS\Application\InstallerAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An invalid theme cannot be installed')] public function testInvalidTheme() : void { $this->installer::installTheme(__DIR__, 'Invalid'); diff --git a/tests/Application/StatusAbstractTest.php b/tests/Application/StatusAbstractTest.php index 806bf5e06..4629bf423 100755 --- a/tests/Application/StatusAbstractTest.php +++ b/tests/Application/StatusAbstractTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,10 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Application\StatusAbstract; /** - * @testdox phpOMS\tests\Application\StatusAbstractTest: Abstract application status - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Application\StatusAbstract::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Application\StatusAbstractTest: Abstract application status')] final class StatusAbstractTest extends \PHPUnit\Framework\TestCase { protected StatusAbstract $status; @@ -38,11 +38,8 @@ final class StatusAbstractTest extends \PHPUnit\Framework\TestCase }; } - /** - * @testdox A invalid application path cannot be activated - * @covers phpOMS\Application\StatusAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid application path cannot be activated')] public function testInvalidAppPathActivation() : void { $this->status::activateRoutes(); diff --git a/tests/Application/Testapp/Admin/Install/Application/Hooks.php b/tests/Application/Testapp/Admin/Install/Application/Hooks.php index 8aaef854a..1d9e61973 100755 --- a/tests/Application/Testapp/Admin/Install/Application/Hooks.php +++ b/tests/Application/Testapp/Admin/Install/Application/Hooks.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package \phpOMS\tess\Application\Apps\Testapp * @copyright Dennis Eichhorn diff --git a/tests/Application/Testapp/Admin/Install/Application/Routes.php b/tests/Application/Testapp/Admin/Install/Application/Routes.php index 8ca42bfe7..cacc83c0d 100755 --- a/tests/Application/Testapp/Admin/Install/Application/Routes.php +++ b/tests/Application/Testapp/Admin/Install/Application/Routes.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package Modules * @copyright Dennis Eichhorn @@ -19,6 +19,7 @@ return [ [ 'dest' => '\phpOMS\tess\Application\Apps\Testapp\Controller\Controller:testEndpoint', 'verb' => RouteVerb::GET, + 'active' => true, 'permission' => [ 'type' => 1, 'state' => 2, diff --git a/tests/Application/Testapp/Admin/Installer.php b/tests/Application/Testapp/Admin/Installer.php index c477f5599..33d588e82 100755 --- a/tests/Application/Testapp/Admin/Installer.php +++ b/tests/Application/Testapp/Admin/Installer.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\tests\Application\Apps\{APPNAME}\Admin * @copyright Dennis Eichhorn diff --git a/tests/Application/Testapp/Admin/Status.php b/tests/Application/Testapp/Admin/Status.php index fd1aae4a3..11010ce43 100755 --- a/tests/Application/Testapp/Admin/Status.php +++ b/tests/Application/Testapp/Admin/Status.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\tests\Application\Apps\{APPNAME}\Admin * @copyright Dennis Eichhorn diff --git a/tests/Application/Testapp/Admin/Uninstaller.php b/tests/Application/Testapp/Admin/Uninstaller.php index d2b118f73..44b529c05 100755 --- a/tests/Application/Testapp/Admin/Uninstaller.php +++ b/tests/Application/Testapp/Admin/Uninstaller.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\tests\Application\Apps\{APPNAME}\Admin * @copyright Dennis Eichhorn diff --git a/tests/Application/Testapp/Controller/Controller.php b/tests/Application/Testapp/Controller/Controller.php index 0fbdf0d9b..f51865f01 100755 --- a/tests/Application/Testapp/Controller/Controller.php +++ b/tests/Application/Testapp/Controller/Controller.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package Web\Backend * @copyright Dennis Eichhorn diff --git a/tests/Application/UninstallerAbstractTest.php b/tests/Application/UninstallerAbstractTest.php index 7f4e4b1b0..ca6af09c0 100755 --- a/tests/Application/UninstallerAbstractTest.php +++ b/tests/Application/UninstallerAbstractTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,10 +21,10 @@ use phpOMS\Application\UninstallerAbstract; use phpOMS\DataStorage\Database\DatabasePool; /** - * @testdox phpOMS\tests\Application\UninstallerAbstractTest: Abstract application uninstaller - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Application\UninstallerAbstract::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Application\UninstallerAbstractTest: Abstract application uninstaller')] final class UninstallerAbstractTest extends \PHPUnit\Framework\TestCase { protected UninstallerAbstract $uninstaller; @@ -40,11 +40,8 @@ final class UninstallerAbstractTest extends \PHPUnit\Framework\TestCase }; } - /** - * @testdox A missing database schema will not perform any database operations - * @covers phpOMS\Application\UninstallerAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database schema will not perform any database operations')] public function testMissingDbFileUninstall() : void { $this->uninstaller::dropTables( diff --git a/tests/Asset/AssetManagerTest.php b/tests/Asset/AssetManagerTest.php index f5e79a653..2877771e4 100755 --- a/tests/Asset/AssetManagerTest.php +++ b/tests/Asset/AssetManagerTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,9 @@ use phpOMS\Asset\AssetManager; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Asset\AssetManagerTest: Asset manager to handle/access assets - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Asset\AssetManagerTest: Asset manager to handle/access assets')] final class AssetManagerTest extends \PHPUnit\Framework\TestCase { protected $manager = null; @@ -35,20 +34,16 @@ final class AssetManagerTest extends \PHPUnit\Framework\TestCase $this->manager = new AssetManager(); } - /** - * @testdox The manager has the expected default values after initialization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The manager has the expected default values after initialization')] public function testDefault() : void { self::assertNull($this->manager->get('myAsset')); self::assertEquals(0, $this->manager->count()); } - /** - * @testdox An asset can be added to the manager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An asset can be added to the manager')] public function testAddAsset() : void { $this->manager->set('first', 'FirstUri'); @@ -58,20 +53,16 @@ final class AssetManagerTest extends \PHPUnit\Framework\TestCase self::assertEquals(2, $this->manager->count()); } - /** - * @testdox An asset can be retrieved from the manager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An asset can be retrieved from the manager')] public function testRetrieveAsset() : void { $this->manager->set('myAsset', 'AssetUri'); self::assertEquals('AssetUri', $this->manager->get('myAsset')); } - /** - * @testdox An asset can only be added once to the manager (no duplication unless overwritten) - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An asset can only be added once to the manager (no duplication unless overwritten)')] public function testInvalidAssetReplacement() : void { $this->manager->set('myAsset', 'AssetUri'); @@ -82,10 +73,8 @@ final class AssetManagerTest extends \PHPUnit\Framework\TestCase self::assertEquals(1, $this->manager->count()); } - /** - * @testdox An asset can be replaced upon request - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An asset can be replaced upon request')] public function testAssetReplacement() : void { $this->manager->set('myAsset', 'AssetUri'); @@ -101,10 +90,8 @@ final class AssetManagerTest extends \PHPUnit\Framework\TestCase self::assertEquals(1, $this->manager->count()); } - /** - * @testdox An asset can be removed from the manager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An asset can be removed from the manager')] public function testAssetRemove() : void { $this->manager->set('myAsset', 'AssetUri'); diff --git a/tests/Asset/AssetTypeTest.php b/tests/Asset/AssetTypeTest.php index 9623e632e..06a29a588 100755 --- a/tests/Asset/AssetTypeTest.php +++ b/tests/Asset/AssetTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,36 +19,30 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Asset\AssetType; /** - * @testdox phpOMS\tests\Asset\AssetType: Asset type * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Asset\AssetType: Asset type')] final class AssetTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The asset type enum has the correct number of status codes - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The asset type enum has the correct number of status codes')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(3, AssetType::getConstants()); } - /** - * @testdox The asset type enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The asset type enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(AssetType::getConstants(), \array_unique(AssetType::getConstants())); } - /** - * @testdox The asset type enum has the correct values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The asset type enum has the correct values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(0, AssetType::CSS); diff --git a/tests/Auth/AuthTest.php b/tests/Auth/AuthTest.php index 869da49c2..4d6b8881b 100755 --- a/tests/Auth/AuthTest.php +++ b/tests/Auth/AuthTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,21 +19,18 @@ use phpOMS\Auth\Auth; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Auth\AuthTest: Account and session authentication - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Auth\AuthTest: Account and session authentication')] final class AuthTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The default http session doesn't authenticate an account - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("The default http session doesn't authenticate an account")] public function testAuthWithEmptyHttpSession() : void { - self::assertEquals(0, Auth::authenticate($GLOBALS['httpSession'])); + self::assertEquals(0, Auth::authenticate($GLOBALS['session'])); - Auth::logout($GLOBALS['httpSession']); - self::assertEquals(0, Auth::authenticate($GLOBALS['httpSession'])); + Auth::logout($GLOBALS['session']); + self::assertEquals(0, Auth::authenticate($GLOBALS['session'])); } } diff --git a/tests/Auth/LoginReturnTypeTest.php b/tests/Auth/LoginReturnTypeTest.php index b3f7a8f22..a83910355 100755 --- a/tests/Auth/LoginReturnTypeTest.php +++ b/tests/Auth/LoginReturnTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,36 +19,30 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Auth\LoginReturnType; /** - * @testdox phpOMS\tests\Auth\LoginReturnType: Login return type * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Auth\LoginReturnType: Login return type')] final class LoginReturnTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The login return type enum has the correct number of type codes - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The login return type enum has the correct number of type codes')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(11, LoginReturnType::getConstants()); } - /** - * @testdox The login return type enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The login return type enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(LoginReturnType::getConstants(), \array_unique(LoginReturnType::getConstants())); } - /** - * @testdox The login return type enum has the correct values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The login return type enum has the correct values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(0, LoginReturnType::OK); diff --git a/tests/AutoloadExceptionTest.php b/tests/AutoloadExceptionTest.php index c7bf3c440..3dc744e13 100755 --- a/tests/AutoloadExceptionTest.php +++ b/tests/AutoloadExceptionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\AutoloadException; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\AutoloadException::class)] final class AutoloadExceptionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\AutoloadException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testException() : void { self::assertInstanceOf(\RuntimeException::class, new AutoloadException('')); diff --git a/tests/Autoloader.php b/tests/Autoloader.php index 89487804b..5314f980f 100755 --- a/tests/Autoloader.php +++ b/tests/Autoloader.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/AutoloaderTest.php b/tests/AutoloaderTest.php index 60517d9c9..9cc62191d 100755 --- a/tests/AutoloaderTest.php +++ b/tests/AutoloaderTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,27 +17,21 @@ namespace phpOMS\tests; use phpOMS\Autoloader; /** - * @testdox phpOMS\tests\AutoloaderTest: Class autoloader - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Autoloader::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\AutoloaderTest: Class autoloader')] final class AutoloaderTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Classes can be checked for existence - * @covers phpOMS\Autoloader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Classes can be checked for existence')] public function testAutoloader() : void { self::assertTrue(Autoloader::exists('\phpOMS\Autoloader')); self::assertFalse(Autoloader::exists('\Does\Not\Exist')); } - /** - * @covers phpOMS\Autoloader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testLoading() : void { Autoloader::defaultAutoloader('\phpOMS\tests\TestLoad'); @@ -46,10 +40,7 @@ final class AutoloaderTest extends \PHPUnit\Framework\TestCase self::assertTrue(\in_array(\realpath(__DIR__ . '/TestLoad.php'), $includes)); } - /** - * @covers phpOMS\Autoloader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testManualPathLoading() : void { Autoloader::addPath(__DIR__ . '/../'); @@ -65,10 +56,7 @@ final class AutoloaderTest extends \PHPUnit\Framework\TestCase self::assertCount(1, Autoloader::findPaths('\phpOMS\Autoloader')); } - /** - * @covers phpOMS\Autoloader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testOpcodeCacheInvalidation() : void { if (!\extension_loaded('zend opcache') @@ -88,10 +76,7 @@ final class AutoloaderTest extends \PHPUnit\Framework\TestCase self::assertTrue(\opcache_is_script_cached(__DIR__ . '/TestLoad3.php')); } - /** - * @covers phpOMS\Autoloader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testUncachedInvalidation() : void { self::assertFalse(\opcache_is_script_cached(__DIR__ . '/TestLoad4.php')); diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index 44c8a78a9..1775553e0 100755 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package phpOMS\tests * @copyright Dennis Eichhorn @@ -421,6 +421,8 @@ if (\extension_loaded('pdo_sqlsrv')) { } } +$GLOBALS['CONFIG'] = $CONFIG; + $httpSession = new HttpSession(); $GLOBALS['session'] = $httpSession; diff --git a/tests/Business/Finance/DepreciationTest.php b/tests/Business/Finance/DepreciationTest.php index 3ec202c80..56bd2ff09 100755 --- a/tests/Business/Finance/DepreciationTest.php +++ b/tests/Business/Finance/DepreciationTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,16 +17,13 @@ namespace phpOMS\tests\Business\Finance; use phpOMS\Business\Finance\Depreciation; /** - * @testdox phpOMS\tests\Business\Finance\DepreciationTest: Depreciation calculations - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Business\Finance\DepreciationTest: Depreciation calculations')] final class DepreciationTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The straight line depreciation and reverse value calculations are correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The straight line depreciation and reverse value calculations are correct')] public function testStraightLine() : void { $start = 23280; @@ -37,10 +34,8 @@ final class DepreciationTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(23280 - 3880 * $t, Depreciation::getStraightLineResidualInT($start, $duration, $t), 5); } - /** - * @testdox The arithmetic degressive depreciation and reverse value calculations are correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The arithmetic degressive depreciation and reverse value calculations are correct')] public function testArithmeticDegressiveDepreciation() : void { $start = 150000; @@ -53,10 +48,8 @@ final class DepreciationTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(70800, Depreciation::getArithmeticDegressiveDepreciationResidualInT($start, $residual, $duration, $t), 5); } - /** - * @testdox The arithmetic progressive depreciation and reverse value calculations are correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The arithmetic progressive depreciation and reverse value calculations are correct')] public function testArithmeticProgressiveDepreciation() : void { $start = 40000; @@ -69,10 +62,8 @@ final class DepreciationTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(29410, Depreciation::getArithmeticProgressiveDepreciationResidualInT($start, $residual, $duration, $t), 5); } - /** - * @testdox The geometric progressive depreciation and reverse value calculations are correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The geometric progressive depreciation and reverse value calculations are correct')] public function testGeometricProgressiveDepreciation() : void { $start = 150000; @@ -85,10 +76,8 @@ final class DepreciationTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(125965, Depreciation::getGeometicProgressiveDepreciationResidualInT($start, $residual, $duration, $t), 5); } - /** - * @testdox The geometric degressive depreciation and reverse value calculations are correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The geometric degressive depreciation and reverse value calculations are correct')] public function testGeometricDegressiveDepreciation() : void { $start = 150000; diff --git a/tests/Business/Finance/FinanceFormulasTest.php b/tests/Business/Finance/FinanceFormulasTest.php index dcf12e886..c6ba29845 100755 --- a/tests/Business/Finance/FinanceFormulasTest.php +++ b/tests/Business/Finance/FinanceFormulasTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Business\Finance; use phpOMS\Business\Finance\FinanceFormulas; /** - * @testdox phpOMS\tests\Business\Finance\FinanceFormulasTest: Finance formulas - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Business\Finance\FinanceFormulas::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Business\Finance\FinanceFormulasTest: Finance formulas')] final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The annual percentage yield (APY) and reverse value calculations are correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The annual percentage yield (APY) and reverse value calculations are correct')] public function testAnnualPercentageYield() : void { $expected = 0.06168; @@ -40,11 +37,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(\round($r, 2), FinanceFormulas::getStateAnnualInterestRateOfAPY($apy, $n), 0.01); } - /** - * @testdox The future value of annuity (FVA) and reverse value calculations are correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The future value of annuity (FVA) and reverse value calculations are correct')] public function testFutureValueOfAnnuity() : void { $expected = 5204.04; @@ -59,11 +53,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(\round($P, 2), \round(FinanceFormulas::getPeriodicPaymentOfFVA($fva, $r, $n), 2), 0.01); } - /** - * @testdox The future value of annuity continuous compounding (FVACC) and reverse value calculations are correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The future value of annuity continuous compounding (FVACC) and reverse value calculations are correct')] public function testFutureValueOfAnnuityContinuousCompounding() : void { $expected = 12336.42; @@ -78,11 +69,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta($t, FinanceFormulas::getTimeOfFVACC($fvacc, $cf, $r), 0.01); } - /** - * @testdox The annuity payment from the present value (PV) and reverse value calculations are correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The annuity payment from the present value (PV) and reverse value calculations are correct')] public function testAnnuityPaymentPV() : void { $expected = 212.16; @@ -97,11 +85,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(\round($pv, 2), \round(FinanceFormulas::getPresentValueOfAPPV($p, $r, $n), 2), 0.01); } - /** - * @testdox The annuity payment from the future value (FV) and reverse value calculations are correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The annuity payment from the future value (FV) and reverse value calculations are correct')] public function testAnnuityPaymentFV() : void { $expected = 192.16; @@ -116,11 +101,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(\round($fv, 2), \round(FinanceFormulas::getFutureValueOfAPFV($p, $r, $n), 2), 0.01); } - /** - * @testdox The annuity payment from the present value (PV) and reverse value calculations are correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The annuity payment from the present value (PV) and reverse value calculations are correct')] public function testAnnuityPaymentFactorPV() : void { $expected = 0.21216; @@ -133,11 +115,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta($n, FinanceFormulas::getNumberOfAPFPV($p, $r), 0.01); } - /** - * @testdox The present value of the annuity is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The present value of the annuity is correct')] public function testPresentValueOfAnnuity() : void { $expected = 4713.46; @@ -152,11 +131,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(\round($P, 2), \round(FinanceFormulas::getPeriodicPaymentOfPVA($pva, $r, $n), 2), 0.01); } - /** - * @testdox The present value annuity factor of the annuity is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The present value annuity factor of the annuity is correct')] public function testPresentValueAnnuityFactor() : void { $expected = 4.7135; @@ -169,11 +145,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta($n, FinanceFormulas::getPeriodsOfPVAF($p, $r), 0.01); } - /** - * @testdox The due present value the annuity is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The due present value the annuity is correct')] public function testPresentValueOfAnnuityDue() : void { $expected = 454.60; @@ -189,11 +162,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta($n, FinanceFormulas::getPeriodsOfPVAD($PV, $P, $r), 0.01); } - /** - * @testdox The due future value the annuity is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The due future value the annuity is correct')] public function testFutureValueOfAnnuityDue() : void { $expected = 580.19; @@ -209,33 +179,24 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta($n, FinanceFormulas::getPeriodsOfFVAD($FV, $P, $r), 0.01); } - /** - * @testdox The relative market share calculations by shares and ales are correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The relative market share calculations by shares and ales are correct')] public function testRelativeMarketShare() : void { self::assertEqualsWithDelta(300 / 400, FinanceFormulas::getRelativeMarketShareByShare(300, 400), 0.01); self::assertEqualsWithDelta(300 / 400, FinanceFormulas::getRelativeMarketShareBySales(300, 400), 0.01); } - /** - * @testdox The asset ratio calculations are correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The asset ratio calculations are correct')] public function testAssetRatios() : void { self::assertEqualsWithDelta(3 / 2, FinanceFormulas::getAssetToSalesRatio(3, 2), 0.01); self::assertEqualsWithDelta(2 / 3, FinanceFormulas::getAssetTurnoverRatio(3, 2), 0.01); } - /** - * @testdox Balance ratio calculations for DII, Receivables/Turnover, and more are correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Balance ratio calculations for DII, Receivables/Turnover, and more are correct')] public function testBalanceRatios() : void { self::assertEqualsWithDelta(365 / 1000, FinanceFormulas::getDaysInInventory(1000), 0.01); @@ -244,11 +205,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(500 / 1000, FinanceFormulas::getCurrentRatio(500, 1000), 0.01); } - /** - * @testdox Dept ratios for dept coverage, dept to equity and dept to income are correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Dept ratios for dept coverage, dept to equity and dept to income are correct')] public function testDeptRatios() : void { self::assertEqualsWithDelta(500 / 1000, FinanceFormulas::getDebtCoverageRatio(500, 1000), 0.01); @@ -257,11 +215,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(500 / 1000, FinanceFormulas::getDebtToIncomeRatio(500, 1000), 0.01); } - /** - * @testdox Return on balance statement positions are correct (e.g. return on assets, on equity) - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Return on balance statement positions are correct (e.g. return on assets, on equity)')] public function testReturnOnBalancePositions() : void { self::assertEqualsWithDelta(500 / 1000, FinanceFormulas::getReturnOnAssets(500, 1000), 0.01); @@ -269,11 +224,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(500 / 1000 - 1, FinanceFormulas::getReturnOnInvestment(500, 1000), 0.01); } - /** - * @testdox Balance / P&L ratios are correct (e.g. inventory turnover, net profit margin) - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Balance / P&L ratios are correct (e.g. inventory turnover, net profit margin)')] public function testBalancePLRatios() : void { self::assertEqualsWithDelta(500 / 1000, FinanceFormulas::getInventoryTurnoverRatio(500, 1000), 0.01); @@ -281,11 +233,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(500 / 1000, FinanceFormulas::getReceivablesTurnoverRatio(500, 1000), 0.01); } - /** - * @testdox Various ratios are correct (e.g. interest coverage, quick ratio, rate of inflation) - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Various ratios are correct (e.g. interest coverage, quick ratio, rate of inflation)')] public function testRatios() : void { self::assertEqualsWithDelta(500 / 1000, FinanceFormulas::getInterestCoverageRatio(500, 1000), 0.01); @@ -298,11 +247,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(100 / 0.15, FinanceFormulas::getPresentValueOfPerpetuity(100, 0.15), 0.01); } - /** - * @testdox Compound calculations for interest, principal and periods are correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Compound calculations for interest, principal and periods are correct')] public function testCompound() : void { $expected = 15.76; @@ -318,11 +264,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta($t, (int) \round(FinanceFormulas::getPeriodsOfCompoundInterest($P, $C, $r), 0), 0.01); } - /** - * @testdox Continuous compound calculations for interest, principal and periods are correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Continuous compound calculations for interest, principal and periods are correct')] public function testContinuousCompounding() : void { $expected = 116.18; @@ -339,11 +282,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta($r, FinanceFormulas::getRateOfContinuousCompounding($P, $C, $t), 0.01); } - /** - * @testdox Calculations for interest, principal and periods are correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Calculations for interest, principal and periods are correct')] public function testSimpleInterest() : void { $P = 100.00; @@ -358,11 +298,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta($t, FinanceFormulas::getSimpleInterestTime($I, $P, $r), 0.01); } - /** - * @testdox The discounted payback period is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The discounted payback period is correct')] public function testDiscountedPaybackPeriod() : void { $O1 = 5000; @@ -372,11 +309,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(5.896, FinanceFormulas::getDiscountedPaybackPeriod($CF, $O1, $r), 0.01); } - /** - * @testdox Test the correct calculation of the growth rate in order to double and vice versa - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Test the correct calculation of the growth rate in order to double and vice versa')] public function testDoublingTime() : void { $r = 0.05; @@ -385,11 +319,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta($r, FinanceFormulas::getDoublingRate(14.207), 0.01); } - /** - * @testdox Test the correct calculation of the growth rate in order to double and vice versa with continuous compounding - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Test the correct calculation of the growth rate in order to double and vice versa with continuous compounding')] public function testDoublingTimeContinuousCompounding() : void { $r = 0.05; @@ -398,11 +329,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta($r, FinanceFormulas::getDoublingContinuousCompoundingRate(13.863), 0.01); } - /** - * @testdox Calculations for equivalent annual annuity are correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Calculations for equivalent annual annuity are correct')] public function testEquivalentAnnualAnnuity() : void { $npv = 1000; @@ -414,11 +342,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta($npv, FinanceFormulas::getNetPresentValueOfEAA(240.36, $r, $n), 0.01); } - /** - * @testdox The free cash flow to equity calculation is correct (how much cash is available after expenses and dept payments) - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The free cash flow to equity calculation is correct (how much cash is available after expenses and dept payments)')] public function testFreeCashFlowToEquity() : void { $income = 1000; @@ -430,11 +355,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(1200, FinanceFormulas::getFreeCashFlowToEquity($income, $depamo, $capital, $wc, $borrowing), 0.01); } - /** - * @testdox The free cash flow to firm calculation is correct (how much cash is available after expenses) - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The free cash flow to firm calculation is correct (how much cash is available after expenses)')] public function testFreeCashFlowToFirm() : void { $ebit = 1000; @@ -446,11 +368,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(550, FinanceFormulas::getFreeCashFlowToFirm($ebit, $t, $depamo, $capital, $wc), 0.01); } - /** - * @testdox The future value calculation is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The future value calculation is correct')] public function testFutureValue() : void { $c = 1000; @@ -460,11 +379,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(2660.02, FinanceFormulas::getFutureValue($c, $r, $n), 0.01); } - /** - * @testdox The future value calculation including continuous compounding is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The future value calculation including continuous compounding is correct')] public function testFutureValueContinuousCompounding() : void { $pv = 1000; @@ -474,11 +390,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(2857.65, FinanceFormulas::getFutureValueContinuousCompounding($pv, $r, $t), 0.01); } - /** - * @testdox The future value factor calculation is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The future value factor calculation is correct')] public function testValueFactor() : void { $r = 0.15; @@ -488,11 +401,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.37594, FinanceFormulas::getPresentValueFactor($r, $n), 0.01); } - /** - * @testdox The calculation of the geometric mean of multiple return rates is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of the geometric mean of multiple return rates is correct')] public function testGeometricMeanReturn() : void { $r = [0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07]; @@ -500,11 +410,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.04123, FinanceFormulas::getGeometricMeanReturn($r), 0.01); } - /** - * @testdox The calculation of the future value of the growing annuity is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of the future value of the growing annuity is correct')] public function testGrowingAnnuityFV() : void { $p = 1000; @@ -515,11 +422,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(14226.06, FinanceFormulas::getGrowingAnnuityFV($p, $r, $g, $n), 0.01); } - /** - * @testdox The calculation of the payment based on the present value of the growing annuity is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of the payment based on the present value of the growing annuity is correct')] public function testGrowingAnnuityPaymentPV() : void { $p = 1000; @@ -530,11 +434,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(186.98, FinanceFormulas::getGrowingAnnuityPaymentPV($p, $r, $g, $n), 0.01); } - /** - * @testdox The calculation of the payment based on the future value of the growing annuity is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of the payment based on the future value of the growing annuity is correct')] public function testGrowingAnnuityPaymentFV() : void { $fv = 1000; @@ -545,11 +446,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(70.29, FinanceFormulas::getGrowingAnnuityPaymentFV($fv, $r, $g, $n), 0.01); } - /** - * @testdox The calculation of the present value of the growing annuity is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of the present value of the growing annuity is correct')] public function testGrowingAnnuityPV() : void { $p = 1000; @@ -560,11 +458,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(5348.1, FinanceFormulas::getGrowingAnnuityPV($p, $r, $g, $n), 0.01); } - /** - * @testdox The calculation of the present value of the growing perpetuity is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of the present value of the growing perpetuity is correct')] public function testGrowingPerpetuityPV() : void { $d = 1000; @@ -574,11 +469,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(20000, FinanceFormulas::getGrowingPerpetuityPV($d, $r, $g), 0.01); } - /** - * @testdox The calculation of the net present value is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of the net present value is correct')] public function testNetPresentValue() : void { $c = [1000, 100, 200, 300, 400, 500, 600]; @@ -587,21 +479,15 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(172.13, FinanceFormulas::getNetPresentValue($c, $r), 0.01); } - /** - * @testdox No cash flows in the net present value calculation result in 0 - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('No cash flows in the net present value calculation result in 0')] public function testEmptyNetPresentValue() : void { self::assertEqualsWithDelta(0.0, FinanceFormulas::getNetPresentValue([], 0.1), 0.01); } - /** - * @testdox The calculation of the real rate of return is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of the real rate of return is correct')] public function testRealRateOfReturn() : void { $nominal = 0.15; @@ -610,21 +496,15 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.09524, FinanceFormulas::getRealRateOfReturn($nominal, $inflation), 0.01); } - /** - * @testdox The calculation of the net working capital is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of the net working capital is correct')] public function testNetWorkingCapital() : void { self::assertEqualsWithDelta(1000 - 600, FinanceFormulas::getNetWorkingCapital(1000, 600), 0.01); } - /** - * @testdox The periods to reach a future value based on the present value is calculated correctly - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The periods to reach a future value based on the present value is calculated correctly')] public function testNumberOfPeriodsPVFV() : void { $fv = 1200; @@ -634,11 +514,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(6.1681, FinanceFormulas::getNumberOfPeriodsPVFV($fv, $pv, $r), 0.01); } - /** - * @testdox The calculation of the present value is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of the present value is correct')] public function testPresentValue() : void { $c = 1000; @@ -648,11 +525,8 @@ final class FinanceFormulasTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(375.94, FinanceFormulas::getPresentValue($c, $r, $n), 0.01); } - /** - * @testdox The calculation of the present value using continuous compounding is correct - * @covers phpOMS\Business\Finance\FinanceFormulas - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of the present value using continuous compounding is correct')] public function testPresentValueContinuousCompounding() : void { $c = 1000; diff --git a/tests/Business/Finance/ForensicsTest.php b/tests/Business/Finance/ForensicsTest.php index b5dec33b4..4cf5b5aa7 100644 --- a/tests/Business/Finance/ForensicsTest.php +++ b/tests/Business/Finance/ForensicsTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,9 @@ namespace phpOMS\tests\Business\Finance; use phpOMS\Business\Finance\Forensics; /** - * @testdox phpOMS\tests\Business\Finance\ForensicsTest: Forensics formulas - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Business\Finance\ForensicsTest: Forensics formulas')] final class ForensicsTest extends \PHPUnit\Framework\TestCase { public function testBenfordAnalysis() : void diff --git a/tests/Business/Finance/LoanTest.php b/tests/Business/Finance/LoanTest.php index be9442ea9..dd4c97974 100755 --- a/tests/Business/Finance/LoanTest.php +++ b/tests/Business/Finance/LoanTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,34 +17,27 @@ namespace phpOMS\tests\Business\Finance; use phpOMS\Business\Finance\Loan; /** - * @testdox phpOMS\tests\Business\Finance\LoanTest: Loan formulas - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Business\Finance\LoanTest: Loan formulas')] final class LoanTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The loan to deposit ratio is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The loan to deposit ratio is correct')] public function testLoanToDepositRatio() : void { self::assertEquals(100 / 50, Loan::getLoanToDepositRatio(100, 50)); } - /** - * @testdox The loan to value ratio is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The loan to value ratio is correct')] public function testLoanToValueRatio() : void { self::assertEquals(100 / 50, Loan::getLoanToValueRatio(100, 50)); } - /** - * @testdox The balloon loan payments are correct for a given balloon - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The balloon loan payments are correct for a given balloon')] public function testPaymentsOnBalloonLoan() : void { $pv = 1000; @@ -55,10 +48,8 @@ final class LoanTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(213.25, Loan::getPaymentsOnBalloonLoan($pv, $r, $n, $balloon), 0.01); } - /** - * @testdox The balloon loan residual value (balloon) is correct for given payments - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The balloon loan residual value (balloon) is correct for given payments')] public function testBalloonBalanceOfLoan() : void { $pv = 1000; @@ -69,10 +60,8 @@ final class LoanTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(-660.02, Loan::getBalloonBalanceOfLoan($pv, $p, $r, $n), 0.01); } - /** - * @testdox The loan payments are correct for a given interest rate and period [continuous compounding] - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The loan payments are correct for a given interest rate and period [continuous compounding]')] public function testLoanPayment() : void { $pv = 1000; @@ -82,10 +71,8 @@ final class LoanTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(240.36, Loan::getLoanPayment($pv, $r, $n), 0.01); } - /** - * @testdox The residual value is correct for a given payment amount, interest rate and period [continuous compounding] - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The residual value is correct for a given payment amount, interest rate and period [continuous compounding]')] public function testRemainingBalanceLoan() : void { $pv = 1000; diff --git a/tests/Business/Finance/LorenzkurveTest.php b/tests/Business/Finance/LorenzkurveTest.php index 6a1e3e571..f7d0e637f 100755 --- a/tests/Business/Finance/LorenzkurveTest.php +++ b/tests/Business/Finance/LorenzkurveTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,16 +17,13 @@ namespace phpOMS\tests\Business\Finance; use phpOMS\Business\Finance\Lorenzkurve; /** - * @testdox phpOMS\tests\Business\Finance\LorenzkurveTest: Lorenz kurve - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Business\Finance\LorenzkurveTest: Lorenz kurve')] final class LorenzkurveTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The gini coefficient calculation is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The gini coefficient calculation is correct')] public function testGiniCoefficient() : void { $arr = [1, 1, 1, 1, 1, 1, 1, 10, 33, 50]; diff --git a/tests/Business/Finance/StockBondsTest.php b/tests/Business/Finance/StockBondsTest.php index 1adab719d..73a7dd0d4 100755 --- a/tests/Business/Finance/StockBondsTest.php +++ b/tests/Business/Finance/StockBondsTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,16 +17,13 @@ namespace phpOMS\tests\Business\Finance; use phpOMS\Business\Finance\StockBonds; /** - * @testdox phpOMS\tests\Business\Finance\StockBondsTest: Stock & bond related formulas - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Business\Finance\StockBondsTest: Stock & bond related formulas')] final class StockBondsTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The calculation of various stock/bond related ratios/yields is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of various stock/bond related ratios/yields is correct')] public function testRatios() : void { self::assertEquals(100 / 50, StockBonds::getBookValuePerShare(100, 50)); @@ -41,46 +38,36 @@ final class StockBondsTest extends \PHPUnit\Framework\TestCase self::assertEquals(100 / 50, StockBonds::getPriceToSalesRatio(100, 50)); } - /** - * @testdox The calculation of the bond yield based on face value and price is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of the bond yield based on face value and price is correct')] public function testBondEquivalentYield() : void { self::assertEqualsWithDelta(0.40556, StockBonds::getBondEquivalentYield(100, 90, 100), 0.01); } - /** - * @testdox The calculation of the return of the capital asset pricing model is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of the return of the capital asset pricing model is correct')] public function testExpectedReturnCAPM() : void { self::assertEqualsWithDelta(7, StockBonds::getExpectedReturnCAPM(3, 2, 5), 0.01); } - /** - * @testdox The capital gains yield calculation is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The capital gains yield calculation is correct')] public function testCapitalGainsYield() : void { self::assertEqualsWithDelta(0.1, StockBonds::getCapitalGainsYield(100, 110), 0.01); } - /** - * @testdox The diluted earnings per share calculation is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The diluted earnings per share calculation is correct')] public function testDilutedEarningsPerShare() : void { self::assertEqualsWithDelta(9.09, StockBonds::getDilutedEarningsPerShare(1000, 100, 10), 0.1); } - /** - * @testdox The calculation of the absolute return for multiple holding periods is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of the absolute return for multiple holding periods is correct')] public function testHoldingPeriodReturn() : void { $r = [0.01, 0.02, 0.03, 0.04]; @@ -88,10 +75,8 @@ final class StockBondsTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.10355, StockBonds::getHoldingPeriodReturn($r), 0.01); } - /** - * @testdox The tax equivalent yield is calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The tax equivalent yield is calculated correctly')] public function testTaxEquivalentYield() : void { $free = 0.15; @@ -100,10 +85,8 @@ final class StockBondsTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.15789, StockBonds::getTaxEquivalentYield($free, $rate), 0.01); } - /** - * @testdox The net asset value is calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The net asset value is calculated correctly')] public function testNetAssetValue() : void { $assets = 1000; @@ -113,10 +96,8 @@ final class StockBondsTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(1.75, StockBonds::getNetAssetValue($assets, $liabilities, $shares), 0.01); } - /** - * @testdox The calculation of the present value of a stock with constant growth rate is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of the present value of a stock with constant growth rate is correct')] public function testPresentValueOfStockConstantGrowth() : void { $div = 500; @@ -126,10 +107,8 @@ final class StockBondsTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(5000, StockBonds::getPresentValueOfStockConstantGrowth($div, $r, $g), 0.01); } - /** - * @testdox The total stock return including dividends and sales price is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The total stock return including dividends and sales price is correct')] public function testTotalStockReturn() : void { $p0 = 1000; @@ -139,10 +118,8 @@ final class StockBondsTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.3, StockBonds::getTotalStockReturn($p0, $p1, $d), 0.01); } - /** - * @testdox The calculation of the yield of a bond is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of the yield of a bond is correct')] public function testYieldToMaturity() : void { $c = 100; @@ -153,10 +130,8 @@ final class StockBondsTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.1138, StockBonds::getYieldToMaturity($c, $f, $p, $n), 0.01); } - /** - * @testdox The calculation of value of the zero coupon bond is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of value of the zero coupon bond is correct')] public function testZeroCouponBondValue() : void { $f = 100; @@ -166,10 +141,8 @@ final class StockBondsTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(74.73, StockBonds::getZeroCouponBondValue($f, $r, $t), 0.01); } - /** - * @testdox The calculation of the yield of a zero coupon bond is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The calculation of the yield of a zero coupon bond is correct')] public function testZeroCouponBondEffectiveYield() : void { $f = 100; diff --git a/tests/Business/Marketing/CustomerValueTest.php b/tests/Business/Marketing/CustomerValueTest.php index 7ea3a8fc5..aec0912b8 100755 --- a/tests/Business/Marketing/CustomerValueTest.php +++ b/tests/Business/Marketing/CustomerValueTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,16 +17,13 @@ namespace phpOMS\tests\Business\Marketing; use phpOMS\Business\Marketing\CustomerValue; /** - * @testdox phpOMS\tests\Business\Marketing\CustomerValueTest: Customer value - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Business\Marketing\CustomerValueTest: Customer value')] final class CustomerValueTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The simple customer life time value is correctly calculated - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The simple customer life time value is correctly calculated')] public function testSimpleCLV() : void { $margin = 3000; @@ -35,10 +32,8 @@ final class CustomerValueTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(30000, CustomerValue::getSimpleCLV($margin, $retention, 0.0), 0.1); } - /** - * @testdox The monthly recurring revenue (MRR) is correctly calculated - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The monthly recurring revenue (MRR) is correctly calculated')] public function testMRR() : void { $revenues = [ diff --git a/tests/Business/Marketing/MetricsTest.php b/tests/Business/Marketing/MetricsTest.php index 461ba6092..16e405df4 100755 --- a/tests/Business/Marketing/MetricsTest.php +++ b/tests/Business/Marketing/MetricsTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,25 +17,20 @@ namespace phpOMS\tests\Business\Marketing; use phpOMS\Business\Marketing\Metrics; /** - * @testdox phpOMS\tests\Business\Marketing\MetricsTest: General marketing metrics - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Business\Marketing\MetricsTest: General marketing metrics')] final class MetricsTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Test the correctness of the customer retention calculation - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Test the correctness of the customer retention calculation')] public function testCustomerRetention() : void { self::assertEqualsWithDelta(0.85, Metrics::getCustomerRetention(105, 20, 100), 0.01); } - /** - * @testdox The profit according to Berry can be correctly calculated - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The profit according to Berry can be correctly calculated')] public function testBerrysCustomerProfits() : void { $acquisitionCost = 30.0; @@ -52,10 +47,8 @@ final class MetricsTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The purchase probability of customers can be calculated based on historic information using the migration model - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The purchase probability of customers can be calculated based on historic information using the migration model')] public function testMigrationModelPurchaseMatrix() : void { // Basis: @@ -82,10 +75,8 @@ final class MetricsTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The CLTV can be calculated using the migration model - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The CLTV can be calculated using the migration model')] public function testMigrationModel() : void { // The first element in the migration model result is the CLTV @@ -100,10 +91,8 @@ final class MetricsTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The migration model can be used in order to determin which buying/none-buying customer group should receive a mailing - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The migration model can be used in order to determin which buying/none-buying customer group should receive a mailing')] public function testMailingSuccessEstimation() : void { self::assertEqualsWithDelta( @@ -117,10 +106,8 @@ final class MetricsTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The probability of a customer buying can be calculated based on his previous purchase behavior - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The probability of a customer buying can be calculated based on his previous purchase behavior')] public function testCustomerActiveProbability() : void { $purchases = 10; diff --git a/tests/Business/Marketing/NetPromoterScoreTest.php b/tests/Business/Marketing/NetPromoterScoreTest.php index f64547a43..86417ebf1 100755 --- a/tests/Business/Marketing/NetPromoterScoreTest.php +++ b/tests/Business/Marketing/NetPromoterScoreTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,16 +17,13 @@ namespace phpOMS\tests\Business\Marketing; use phpOMS\Business\Marketing\NetPromoterScore; /** - * @testdox phpOMS\tests\Business\Marketing\NetPromoterScoreTest: Net promoter - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Business\Marketing\NetPromoterScoreTest: Net promoter')] final class NetPromoterScoreTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The net promoter has the expected default values after initialization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The net promoter has the expected default values after initialization')] public function testDefault() : void { $nps = new NetPromoterScore(); @@ -34,10 +31,8 @@ final class NetPromoterScoreTest extends \PHPUnit\Framework\TestCase self::assertEquals(0, $nps->getScore()); } - /** - * @testdox The net promoter score, detractors, passives and promoters are correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The net promoter score, detractors, passives and promoters are correct')] public function testScoreDetractorPassivePromotor() : void { $nps = new NetPromoterScore(); diff --git a/tests/Business/Marketing/PageRankTest.php b/tests/Business/Marketing/PageRankTest.php index bf1d3e944..bb7d8f39c 100755 --- a/tests/Business/Marketing/PageRankTest.php +++ b/tests/Business/Marketing/PageRankTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,16 +17,13 @@ namespace phpOMS\tests\Business\Marketing; use phpOMS\Business\Marketing\PageRank; /** - * @testdox phpOMS\tests\Business\Marketing\PageRankTest: Page rank algorithm - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Business\Marketing\PageRankTest: Page rank algorithm')] final class PageRankTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Test the correctness of the page rank algorithm - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Test the correctness of the page rank algorithm')] public function testPageRank() : void { $relations = [ @@ -50,10 +47,8 @@ final class PageRankTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Test the correctness of the page rank algorithm with custom damping and starting values - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Test the correctness of the page rank algorithm with custom damping and starting values')] public function testPageRankCustomDampingAndStart() : void { $relations = [ diff --git a/tests/Business/Programming/MetricsTest.php b/tests/Business/Programming/MetricsTest.php index 37597da08..f58de83cc 100755 --- a/tests/Business/Programming/MetricsTest.php +++ b/tests/Business/Programming/MetricsTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,25 +17,20 @@ namespace phpOMS\tests\Business\Programming; use phpOMS\Business\Programming\Metrics; /** - * @testdox phpOMS\tests\Business\Programming\MetricsTest: General programming metrics - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Business\Programming\MetricsTest: General programming metrics')] final class MetricsTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Test correctness of the ABC calculation - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Test correctness of the ABC calculation')] public function testABCMetric() : void { self::assertEquals((int) \sqrt(5 * 5 + 11 * 11 + 9 * 9), Metrics::abcScore(5, 11, 9)); } - /** - * @testdox Test correctness of CRAP score - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Test correctness of CRAP score')] public function testCRAPMetric() : void { self::assertEquals(1, Metrics::CRAP(1, 1.0)); diff --git a/tests/Business/Recommendation/ArticleCorrelationAffinityTest.php b/tests/Business/Recommendation/ArticleCorrelationAffinityTest.php index 6892c2ef0..8de377c01 100644 --- a/tests/Business/Recommendation/ArticleCorrelationAffinityTest.php +++ b/tests/Business/Recommendation/ArticleCorrelationAffinityTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,16 +17,13 @@ namespace phpOMS\tests\Business\Recommendation; use phpOMS\Business\Recommendation\ArticleCorrelationAffinity; /** - * @testdox phpOMS\tests\Business\Recommendation\ArticleCorrelationAffinityTest: Article affinity/correlation - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Business\Recommendation\ArticleCorrelationAffinityTest: Article affinity/correlation')] final class ArticleCorrelationAffinityTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The highest affinities between articles purchased are calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The highest affinities between articles purchased are calculated correctly')] public function testAffinity() : void { $orders = [ @@ -69,10 +66,8 @@ final class ArticleCorrelationAffinityTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The affinity of a new article is empty - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The affinity of a new article is empty')] public function testInvalidItemAffinity() : void { $orders = [ diff --git a/tests/Business/Recommendation/BayesianPersonalizedRankingTest.php b/tests/Business/Recommendation/BayesianPersonalizedRankingTest.php deleted file mode 100644 index f8ed76a2e..000000000 --- a/tests/Business/Recommendation/BayesianPersonalizedRankingTest.php +++ /dev/null @@ -1,24 +0,0 @@ - [1.0, 2.0], @@ -34,7 +33,22 @@ final class MemoryCFTest extends \PHPUnit\Framework\TestCase self::assertEquals( ['B', 'C'], - $memory->bestMatch([2.2, 4.1], 2) + $memory->bestMatchUser([2.2, 4.1], 2) + ); + } + + public function testBestMatchItem() : void + { + $memory = new MemoryCF([ + 'A' => [1.0, 2.0], + 'B' => [2.0, 4.0], + 'C' => [2.5, 4.0], + 'D' => [4.5, 5.0], + ]); + + self::assertEquals( + [1 => 0.0], + $memory->bestMatchItem([2.2], 2) ); } } diff --git a/tests/Business/Recommendation/ModelCFTest.php b/tests/Business/Recommendation/ModelCFTest.php index 4e10ac810..2d38d4fc1 100644 --- a/tests/Business/Recommendation/ModelCFTest.php +++ b/tests/Business/Recommendation/ModelCFTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,9 @@ namespace phpOMS\tests\Business\Recommendation; use phpOMS\Business\Recommendation\ModelCF; /** - * @testdox phpOMS\tests\Business\Recommendation\ModelCFTest: Article affinity/correlation - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Business\Recommendation\ModelCFTest: Article affinity/correlation')] final class ModelCFTest extends \PHPUnit\Framework\TestCase { public function testScore() : void diff --git a/tests/Business/Sales/MarketShareEstimationTest.php b/tests/Business/Sales/MarketShareEstimationTest.php index 170604244..a0c03d583 100755 --- a/tests/Business/Sales/MarketShareEstimationTest.php +++ b/tests/Business/Sales/MarketShareEstimationTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,16 +17,13 @@ namespace phpOMS\tests\Business\Sales; use phpOMS\Business\Sales\MarketShareEstimation; /** - * @testdox phpOMS\tests\Business\Sales\MarketShareEstimationTest: Market share calculations - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Business\Sales\MarketShareEstimationTest: Market share calculations')] final class MarketShareEstimationTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The rank calculated with Zipf is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The rank calculated with Zipf is correct')] public function testZipfRank() : void { self::assertEquals(13, MarketShareEstimation::getRankFromMarketShare(1000, 0.01)); @@ -34,10 +31,8 @@ final class MarketShareEstimationTest extends \PHPUnit\Framework\TestCase self::assertEquals(8, MarketShareEstimation::getRankFromMarketShare(100000, 0.01)); } - /** - * @testdox The market share by rank calculated with Zipf is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The market share by rank calculated with Zipf is correct')] public function testZipfShare() : void { self::assertTrue(\abs(0.01 - MarketShareEstimation::getMarketShareFromRank(1000, 13)) < 0.01); diff --git a/tests/Config/OptionsTraitTest.php b/tests/Config/OptionsTraitTest.php index a3fdd80b4..88ace7297 100755 --- a/tests/Config/OptionsTraitTest.php +++ b/tests/Config/OptionsTraitTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,13 @@ use phpOMS\Config\OptionsTrait; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Config\OptionsTrait: Helper for managing options - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Config\OptionsTrait: Helper for managing options')] final class OptionsTraitTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The option helper has the expected default values after initialization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The option helper has the expected default values after initialization')] public function testDefault() : void { $class = new class() { @@ -39,10 +36,8 @@ final class OptionsTraitTest extends \PHPUnit\Framework\TestCase self::assertNull($class->getOption('someKey')); } - /** - * @testdox Options can be added to the helper - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Options can be added to the helper')] public function testAdd() : void { $class = new class() { @@ -54,10 +49,8 @@ final class OptionsTraitTest extends \PHPUnit\Framework\TestCase self::assertEquals('value1', $class->getOption('a')); } - /** - * @testdox Options can be overwritten/changed - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Options can be overwritten/changed')] public function testOverwrite() : void { $class = new class() { @@ -81,10 +74,8 @@ final class OptionsTraitTest extends \PHPUnit\Framework\TestCase self::assertEquals('value3', $class->getOption('a')); } - /** - * @testdox Multiple options can be added to the helper in one go - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Multiple options can be added to the helper in one go')] public function testAddMultiple() : void { $class = new class() { @@ -106,10 +97,8 @@ final class OptionsTraitTest extends \PHPUnit\Framework\TestCase self::assertEquals(3, $class->getOption('c')); } - /** - * @testdox Multiple options can be retrieved - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Multiple options can be retrieved')] public function testGetMultiple() : void { $class = new class() { diff --git a/tests/DataStorage/Cache/CachePoolTest.php b/tests/DataStorage/Cache/CachePoolTest.php index 720ad49d7..0fea66bc9 100755 --- a/tests/DataStorage/Cache/CachePoolTest.php +++ b/tests/DataStorage/Cache/CachePoolTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,16 +18,13 @@ use phpOMS\DataStorage\Cache\CachePool; use phpOMS\DataStorage\Cache\Connection\FileCache; /** - * @testdox phpOMS\tests\DataStorage\Cache\CachePoolTest: Pool for caches - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Cache\CachePoolTest: Pool for caches')] final class CachePoolTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The pool has the expected default values after initialization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The pool has the expected default values after initialization')] public function testDefault() : void { $pool = new CachePool(); @@ -36,10 +33,8 @@ final class CachePoolTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\phpOMS\DataStorage\Cache\Connection\NullCache', $pool->get()); } - /** - * @testdox New cache connections can be added to the pool - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('New cache connections can be added to the pool')] public function testAdd() : void { $pool = new CachePool(); @@ -47,10 +42,8 @@ final class CachePoolTest extends \PHPUnit\Framework\TestCase self::assertTrue($pool->add('test', new FileCache(__DIR__))); } - /** - * @testdox Cache connections cannot be overwritten with a different cache connection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cache connections cannot be overwritten with a different cache connection')] public function testOverwrite() : void { $pool = new CachePool(); @@ -59,10 +52,8 @@ final class CachePoolTest extends \PHPUnit\Framework\TestCase self::assertFalse($pool->add('test', new FileCache(__DIR__))); } - /** - * @testdox Cache connections can be accessed with an identifier - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cache connections can be accessed with an identifier')] public function testGet() : void { $pool = new CachePool(); @@ -72,10 +63,8 @@ final class CachePoolTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\phpOMS\DataStorage\Cache\Connection\ConnectionInterface', $pool->get()); } - /** - * @testdox By default a null cache is returned if no cache connection exists for the identifier - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('By default a null cache is returned if no cache connection exists for the identifier')] public function testGetDefault() : void { $pool = new CachePool(); @@ -83,10 +72,8 @@ final class CachePoolTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\phpOMS\DataStorage\Cache\Connection\NullCache', $pool->get('abc')); } - /** - * @testdox Cache connections can created by the pool and automatically get added but not overwritten - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cache connections can created by the pool and automatically get added but not overwritten')] public function testCreate() : void { $pool = new CachePool(); @@ -96,10 +83,8 @@ final class CachePoolTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\phpOMS\DataStorage\Cache\Connection\ConnectionInterface', $pool->get('abc')); } - /** - * @testdox Cache connections can be removed from the pool - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cache connections can be removed from the pool')] public function testRemove() : void { $pool = new CachePool(); @@ -111,10 +96,8 @@ final class CachePoolTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\phpOMS\DataStorage\Cache\Connection\ConnectionInterface', $pool->get('test')); } - /** - * @testdox Removing a cache with an invalid identifier will result in no actions - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Removing a cache with an invalid identifier will result in no actions')] public function testRemoveInvalid() : void { $pool = new CachePool(); diff --git a/tests/DataStorage/Cache/CacheStatusTest.php b/tests/DataStorage/Cache/CacheStatusTest.php index 627f21f46..49bcbd818 100755 --- a/tests/DataStorage/Cache/CacheStatusTest.php +++ b/tests/DataStorage/Cache/CacheStatusTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\DataStorage\Cache\CacheStatus; */ final class CacheStatusTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(4, CacheStatus::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(CacheStatus::getConstants(), \array_unique(CacheStatus::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(0, CacheStatus::OK); diff --git a/tests/DataStorage/Cache/CacheTypeTest.php b/tests/DataStorage/Cache/CacheTypeTest.php index 08cf64341..f42d5361c 100755 --- a/tests/DataStorage/Cache/CacheTypeTest.php +++ b/tests/DataStorage/Cache/CacheTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\DataStorage\Cache\CacheType; */ final class CacheTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(4, CacheType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(CacheType::getConstants(), \array_unique(CacheType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('file', CacheType::FILE); diff --git a/tests/DataStorage/Cache/Connection/CacheValueTypeTest.php b/tests/DataStorage/Cache/Connection/CacheValueTypeTest.php index d214a0125..a28ea7f6c 100755 --- a/tests/DataStorage/Cache/Connection/CacheValueTypeTest.php +++ b/tests/DataStorage/Cache/Connection/CacheValueTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\DataStorage\Cache\Connection\CacheValueType; */ final class CacheValueTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(8, CacheValueType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(CacheValueType::getConstants(), \array_unique(CacheValueType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(0, CacheValueType::_INT); diff --git a/tests/DataStorage/Cache/Connection/ConnectionFactoryTest.php b/tests/DataStorage/Cache/Connection/ConnectionFactoryTest.php index 7545a5c4d..19541e74f 100755 --- a/tests/DataStorage/Cache/Connection/ConnectionFactoryTest.php +++ b/tests/DataStorage/Cache/Connection/ConnectionFactoryTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,16 +18,13 @@ use phpOMS\DataStorage\Cache\CacheType; use phpOMS\DataStorage\Cache\Connection\ConnectionFactory; /** - * @testdox phpOMS\tests\DataStorage\Cache\Connection\ConnectionFactoryTest: Factory for generating cache connections - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Cache\Connection\ConnectionFactoryTest: Factory for generating cache connections')] final class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The file cache can be created - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The file cache can be created')] public function testCreateFileCache() : void { self::assertInstanceOf( @@ -36,10 +33,8 @@ final class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The memcached cache can be created - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The memcached cache can be created')] public function testCreateMemCached() : void { if (!\extension_loaded('memcached')) { @@ -54,10 +49,8 @@ final class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The redis cache can be created - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The redis cache can be created')] public function testCreateRedisCache() : void { if (!\extension_loaded('redis')) { @@ -72,10 +65,8 @@ final class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A invalid cache type results in an exception - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid cache type results in an exception')] public function testInvalidCacheType() : void { $this->expectException(\InvalidArgumentException::class); diff --git a/tests/DataStorage/Cache/Connection/FileCacheJsonSerializable.php b/tests/DataStorage/Cache/Connection/FileCacheJsonSerializable.php index 31a4c3de7..32b29a988 100755 --- a/tests/DataStorage/Cache/Connection/FileCacheJsonSerializable.php +++ b/tests/DataStorage/Cache/Connection/FileCacheJsonSerializable.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Cache/Connection/FileCacheSerializable.php b/tests/DataStorage/Cache/Connection/FileCacheSerializable.php index d87f1affd..8e06e373c 100755 --- a/tests/DataStorage/Cache/Connection/FileCacheSerializable.php +++ b/tests/DataStorage/Cache/Connection/FileCacheSerializable.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Cache/Connection/FileCacheTest.php b/tests/DataStorage/Cache/Connection/FileCacheTest.php index b2cf55ac3..cec5d13d4 100755 --- a/tests/DataStorage/Cache/Connection/FileCacheTest.php +++ b/tests/DataStorage/Cache/Connection/FileCacheTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,10 @@ use phpOMS\DataStorage\Cache\Connection\FileCache; use phpOMS\Utils\TestUtils; /** - * @testdox phpOMS\tests\DataStorage\Cache\Connection\FileCacheTest: File cache connection - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Cache\Connection\FileCache::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Cache\Connection\FileCacheTest: File cache connection')] final class FileCacheTest extends \PHPUnit\Framework\TestCase { protected FileCache $cache; @@ -49,11 +49,8 @@ final class FileCacheTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox The file cache connection has the expected default values after initialization - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The file cache connection has the expected default values after initialization')] public function testDefault() : void { self::assertEquals(CacheType::FILE, $this->cache->getType()); @@ -74,21 +71,15 @@ final class FileCacheTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The connection to a dedicated cache directory can be established (none-existing directories get created) - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The connection to a dedicated cache directory can be established (none-existing directories get created)')] public function testConnect() : void { self::assertEquals(CacheStatus::OK, $this->cache->getStatus()); } - /** - * @testdox Different cache data (types) can be set and returned - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different cache data (types) can be set and returned')] public function testSetInputOutput() : void { $this->cache->set('key1', 'testVal'); @@ -116,11 +107,8 @@ final class FileCacheTest extends \PHPUnit\Framework\TestCase self::assertEquals('asdf', $this->cache->get('key8')->val); } - /** - * @testdox Cache data can bet added and returned - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cache data can bet added and returned')] public function testAddInputOutput() : void { self::assertTrue($this->cache->add('addKey', 'testValAdd')); @@ -269,11 +257,8 @@ final class FileCacheTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->cache->updateExpire('invalid', 2)); } - /** - * @testdox Cache data cannot be added if it already exists - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cache data cannot be added if it already exists')] public function testInvalidOverwrite() : void { self::assertTrue($this->cache->add('addKey', 'testValAdd')); @@ -281,11 +266,8 @@ final class FileCacheTest extends \PHPUnit\Framework\TestCase self::assertEquals('testValAdd', $this->cache->get('addKey')); } - /** - * @testdox Existing cache data can be replaced - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Existing cache data can be replaced')] public function testReplace() : void { $this->cache->set('key4', 4); @@ -295,21 +277,15 @@ final class FileCacheTest extends \PHPUnit\Framework\TestCase self::assertEquals(5, $this->cache->get('key4')); } - /** - * @testdox None-existing cache data cannot be replaced - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('None-existing cache data cannot be replaced')] public function testInvalidReplace() : void { self::assertFalse($this->cache->replace('keyInvalid', 5)); } - /** - * @testdox Existing cache data can be deleted - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Existing cache data can be deleted')] public function testDelete() : void { $this->cache->set('key4', 4); @@ -324,11 +300,8 @@ final class FileCacheTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->cache->delete('invalid')); } - /** - * @testdox The cache correctly handles general cache information - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The cache correctly handles general cache information')] public function testStats() : void { $this->cache->set('key1', 'testVal'); @@ -347,11 +320,8 @@ final class FileCacheTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The cache can be flushed - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The cache can be flushed')] public function testFlush() : void { $this->cache->set('key1', 'testVal'); @@ -373,22 +343,16 @@ final class FileCacheTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Cache data can be set and returned with expiration limits - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cache data can be set and returned with expiration limits')] public function testUnexpiredInputOutput() : void { $this->cache->set('key1', 'testVal', 1); self::assertEquals('testVal', $this->cache->get('key1')); } - /** - * @testdox Expired cache data cannot be returned - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Expired cache data cannot be returned')] public function testExpiredInputOutput() : void { $this->cache->set('key2', 'testVal2', 1); @@ -398,11 +362,8 @@ final class FileCacheTest extends \PHPUnit\Framework\TestCase self::assertNull($this->cache->get('key2')); // this causes a side effect of deleting the outdated cache element!!! } - /** - * @testdox Expired cache data can be forced to return - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Expired cache data can be forced to return')] public function testForceExpiredInputOutput() : void { $this->cache->set('key2', 'testVal2', 1); @@ -410,22 +371,16 @@ final class FileCacheTest extends \PHPUnit\Framework\TestCase self::assertEquals('testVal2', $this->cache->get('key2', 10)); } - /** - * @testdox Unexpired cache data cannot be delete if lower expiration is defined - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Unexpired cache data cannot be delete if lower expiration is defined')] public function testInvalidDeleteUnexpired() : void { $this->cache->set('key4', 'testVal4', 60); self::assertFalse($this->cache->delete('key4', 0)); } - /** - * @testdox Expired cache data can be deleted if equal expiration is defined - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Expired cache data can be deleted if equal expiration is defined')] public function testDeleteExpired() : void { $this->cache->set('key4', 'testVal4', 1); @@ -433,11 +388,8 @@ final class FileCacheTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->cache->delete('key4', 1)); } - /** - * @testdox Unexpired data can be force deleted with lower expiration date - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Unexpired data can be force deleted with lower expiration date')] public function testForceDeleteUnexpired() : void { $this->cache->set('key5', 'testVal5', 10000); @@ -446,11 +398,8 @@ final class FileCacheTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->cache->delete('key5', 1)); } - /** - * @testdox Cache data can be flushed by expiration date - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cache data can be flushed by expiration date')] public function testFlushExpired() : void { $this->cache->set('key6', 'testVal6', 1); @@ -460,11 +409,8 @@ final class FileCacheTest extends \PHPUnit\Framework\TestCase self::assertNull($this->cache->get('key6', 0)); } - /** - * @testdox A bad cache status will prevent all cache actions - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A bad cache status will prevent all cache actions')] public function testBadCacheStatus() : void { TestUtils::setMember($this->cache, 'status', CacheStatus::FAILURE); @@ -479,11 +425,8 @@ final class FileCacheTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $this->cache->stats()); } - /** - * @testdox A invalid cache connection will throw an InvalidConnectionConfigException - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid cache connection will throw an InvalidConnectionConfigException')] public function testInvalidCachePath() : void { $this->expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class); @@ -491,11 +434,8 @@ final class FileCacheTest extends \PHPUnit\Framework\TestCase $this->cache = new FileCache("/root/etc/invalidPathOrPermission^$:?><"); } - /** - * @testdox Adding a invalid data type will throw an InvalidArgumentException - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Adding a invalid data type will throw an InvalidArgumentException')] public function testInvalidDataTypeAdd() : void { $this->expectException(\InvalidArgumentException::class); @@ -503,11 +443,8 @@ final class FileCacheTest extends \PHPUnit\Framework\TestCase $this->cache->add('invalid', $this->cache); } - /** - * @testdox Setting a invalid data type will throw an InvalidArgumentException - * @covers phpOMS\DataStorage\Cache\Connection\FileCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Setting a invalid data type will throw an InvalidArgumentException')] public function testInvalidDataTypeSet() : void { $this->expectException(\InvalidArgumentException::class); diff --git a/tests/DataStorage/Cache/Connection/MemCachedTest.php b/tests/DataStorage/Cache/Connection/MemCachedTest.php index db3ff6c14..0b9d943d7 100755 --- a/tests/DataStorage/Cache/Connection/MemCachedTest.php +++ b/tests/DataStorage/Cache/Connection/MemCachedTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,10 @@ use phpOMS\DataStorage\Cache\Connection\MemCached; use phpOMS\Utils\TestUtils; /** - * @testdox phpOMS\tests\DataStorage\Cache\Connection\MemCachedTest: Memcache connection - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Cache\Connection\MemCached::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Cache\Connection\MemCachedTest: Memcache connection')] final class MemCachedTest extends \PHPUnit\Framework\TestCase { protected MemCached $cache; @@ -44,14 +44,15 @@ final class MemCachedTest extends \PHPUnit\Framework\TestCase protected function tearDown() : void { + if (!isset($this->cache)) { + return; + } + $this->cache->flushAll(); } - /** - * @testdox The memcached connection has the expected default values after initialization - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The memcached connection has the expected default values after initialization')] public function testDefault() : void { self::assertEquals(CacheType::MEMCACHED, $this->cache->getType()); @@ -71,11 +72,8 @@ final class MemCachedTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The connection to a cache can be established (none-existing directories get created) - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The connection to a cache can be established (none-existing directories get created)')] public function testConnect() : void { $cache = new MemCached($GLOBALS['CONFIG']['cache']['memcached']); @@ -85,11 +83,8 @@ final class MemCachedTest extends \PHPUnit\Framework\TestCase self::assertEquals((int) $GLOBALS['CONFIG']['cache']['memcached']['port'], $cache->getPort()); } - /** - * @testdox Different cache data (types) can be set and returned - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different cache data (types) can be set and returned')] public function testSetInputOutput() : void { $this->cache->set('key1', 'testVal'); @@ -120,11 +115,8 @@ final class MemCachedTest extends \PHPUnit\Framework\TestCase */ } - /** - * @testdox Cache data can bet added and returned - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cache data can bet added and returned')] public function testAddInputOutput() : void { self::assertTrue($this->cache->add('addKey', 'testValAdd')); @@ -217,11 +209,8 @@ final class MemCachedTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->cache->updateExpire('invalid', 2)); } - /** - * @testdox Cache data cannot be added if it already exists - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cache data cannot be added if it already exists')] public function testInvalidOverwrite() : void { self::assertTrue($this->cache->add('addKey', 'testValAdd')); @@ -229,11 +218,8 @@ final class MemCachedTest extends \PHPUnit\Framework\TestCase self::assertEquals('testValAdd', $this->cache->get('addKey')); } - /** - * @testdox Existing cache data can be replaced - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Existing cache data can be replaced')] public function testReplace() : void { $this->cache->set('key4', 4); @@ -243,21 +229,15 @@ final class MemCachedTest extends \PHPUnit\Framework\TestCase self::assertEquals(5, $this->cache->get('key4')); } - /** - * @testdox None-existing cache data cannot be replaced - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('None-existing cache data cannot be replaced')] public function testInvalidReplace() : void { self::assertFalse($this->cache->replace('keyInvalid', 5)); } - /** - * @testdox Existing cache data can be deleted - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Existing cache data can be deleted')] public function testDelete() : void { $this->cache->set('key4', 4); @@ -278,11 +258,8 @@ final class MemCachedTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->cache->delete('invalid')); } - /** - * @testdox The cache correctly handles general cache information - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The cache correctly handles general cache information')] public function testStats() : void { $this->cache->set('key1', 'testVal'); @@ -305,11 +282,8 @@ final class MemCachedTest extends \PHPUnit\Framework\TestCase */ } - /** - * @testdox The cache can be flushed - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The cache can be flushed')] public function testFlush() : void { $this->cache->set('key1', 'testVal'); @@ -326,22 +300,16 @@ final class MemCachedTest extends \PHPUnit\Framework\TestCase self::assertGreaterThanOrEqual(0, $this->cache->stats()['size']); } - /** - * @testdox Cache data can be set and returned with expiration limits - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cache data can be set and returned with expiration limits')] public function testUnexpiredInputOutput() : void { $this->cache->set('key1', 'testVal', 1); self::assertEquals('testVal', $this->cache->get('key1')); } - /** - * @testdox Expired cache data cannot be returned - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Expired cache data cannot be returned')] public function testExpiredInputOutput() : void { $this->cache->set('key2', 'testVal2', 1); @@ -350,11 +318,8 @@ final class MemCachedTest extends \PHPUnit\Framework\TestCase self::assertNull($this->cache->get('key2', 1)); } - /** - * @testdox Cache data can be flushed by expiration date - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cache data can be flushed by expiration date')] public function testFlushExpired() : void { $this->cache->set('key6', 'testVal6', 1); @@ -364,11 +329,8 @@ final class MemCachedTest extends \PHPUnit\Framework\TestCase self::assertNull($this->cache->get('key6', 0)); } - /** - * @testdox A bad cache status will prevent all cache actions - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A bad cache status will prevent all cache actions')] public function testBadCacheStatus() : void { TestUtils::setMember($this->cache, 'status', CacheStatus::FAILURE); @@ -383,11 +345,8 @@ final class MemCachedTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $this->cache->stats()); } - /** - * @testdox Adding a invalid data type will throw an InvalidArgumentException - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Adding a invalid data type will throw an InvalidArgumentException')] public function testInvalidDataTypeAdd() : void { $this->expectException(\InvalidArgumentException::class); @@ -395,11 +354,8 @@ final class MemCachedTest extends \PHPUnit\Framework\TestCase $this->cache->add('invalid', $this->cache); } - /** - * @testdox Setting a invalid data type will throw an InvalidArgumentException - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Setting a invalid data type will throw an InvalidArgumentException')] public function testInvalidDataTypeSet() : void { $this->expectException(\InvalidArgumentException::class); @@ -407,11 +363,8 @@ final class MemCachedTest extends \PHPUnit\Framework\TestCase $this->cache->set('invalid', $this->cache); } - /** - * @testdox A invalid host throws a InvalidConnectionConfigException - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid host throws a InvalidConnectionConfigException')] public function testInvalidCacheHost() : void { $this->expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class); @@ -422,11 +375,8 @@ final class MemCachedTest extends \PHPUnit\Framework\TestCase $cache = new MemCached($db); } - /** - * @testdox A invalid port throws a InvalidConnectionConfigException - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid port throws a InvalidConnectionConfigException')] public function testInvalidCachePort() : void { $this->expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class); diff --git a/tests/DataStorage/Cache/Connection/NullCacheTest.php b/tests/DataStorage/Cache/Connection/NullCacheTest.php index daefe8759..1ed2d6132 100755 --- a/tests/DataStorage/Cache/Connection/NullCacheTest.php +++ b/tests/DataStorage/Cache/Connection/NullCacheTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,10 @@ use phpOMS\DataStorage\Cache\CacheType; use phpOMS\DataStorage\Cache\Connection\NullCache; /** - * @testdox phpOMS\tests\DataStorage\Cache\Connection\NullCacheTest: Null cache connection if no cache is available - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Cache\Connection\NullCache::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Cache\Connection\NullCacheTest: Null cache connection if no cache is available')] final class NullCacheTest extends \PHPUnit\Framework\TestCase { protected NullCache $cache; @@ -35,11 +35,8 @@ final class NullCacheTest extends \PHPUnit\Framework\TestCase $this->cache = new NullCache([]); } - /** - * @testdox The default cache has the expected default values after initialization - * @covers phpOMS\DataStorage\Cache\Connection\NullCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The default cache has the expected default values after initialization')] public function testDefault() : void { self::assertEquals(CacheType::UNDEFINED, $this->cache->getType()); diff --git a/tests/DataStorage/Cache/Connection/RedisCacheTest.php b/tests/DataStorage/Cache/Connection/RedisCacheTest.php index f09949b0e..3a91050be 100755 --- a/tests/DataStorage/Cache/Connection/RedisCacheTest.php +++ b/tests/DataStorage/Cache/Connection/RedisCacheTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,11 @@ use phpOMS\DataStorage\Cache\Connection\RedisCache; use phpOMS\Utils\TestUtils; /** - * @testdox phpOMS\tests\DataStorage\Cache\Connection\RedisCache: Redis cache connection - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Cache\Connection\RedisCache::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Cache\Connection\MemCached::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Cache\Connection\RedisCache: Redis cache connection')] final class RedisCacheTest extends \PHPUnit\Framework\TestCase { protected RedisCache $cache; @@ -44,14 +45,15 @@ final class RedisCacheTest extends \PHPUnit\Framework\TestCase protected function tearDown() : void { + if (!isset($this->cache)) { + return; + } + $this->cache->flushAll(); } - /** - * @testdox The redis cache connection has the expected default values after initialization - * @covers phpOMS\DataStorage\Cache\Connection\RedisCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The redis cache connection has the expected default values after initialization')] public function testDefault() : void { self::assertEquals(CacheType::REDIS, $this->cache->getType()); @@ -66,11 +68,8 @@ final class RedisCacheTest extends \PHPUnit\Framework\TestCase self::assertEquals(6379, $this->cache->getPort()); } - /** - * @testdox The connection to a cache can be established (none-existing directories get created) - * @covers phpOMS\DataStorage\Cache\Connection\RedisCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The connection to a cache can be established (none-existing directories get created)')] public function testConnect() : void { $cache = new RedisCache($GLOBALS['CONFIG']['cache']['redis']); @@ -81,11 +80,8 @@ final class RedisCacheTest extends \PHPUnit\Framework\TestCase self::assertEquals((int) $GLOBALS['CONFIG']['cache']['redis']['port'], $cache->getPort()); } - /** - * @testdox Different cache data (types) can be set and returned - * @covers phpOMS\DataStorage\Cache\Connection\RedisCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different cache data (types) can be set and returned')] public function testSetInputOutput() : void { $this->cache->set('key1', 'testVal'); @@ -113,11 +109,8 @@ final class RedisCacheTest extends \PHPUnit\Framework\TestCase self::assertEquals('asdf', $this->cache->get('key8')->val); } - /** - * @testdox Cache data can bet added and returned - * @covers phpOMS\DataStorage\Cache\Connection\RedisCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cache data can bet added and returned')] public function testAddInputOutput() : void { self::assertTrue($this->cache->add('addKey', 'testValAdd')); @@ -252,11 +245,8 @@ final class RedisCacheTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->cache->updateExpire('invalid', 2)); } - /** - * @testdox Cache data cannot be added if it already exists - * @covers phpOMS\DataStorage\Cache\Connection\RedisCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cache data cannot be added if it already exists')] public function testInvalidOverwrite() : void { self::assertTrue($this->cache->add('addKey', 'testValAdd')); @@ -264,11 +254,8 @@ final class RedisCacheTest extends \PHPUnit\Framework\TestCase self::assertEquals('testValAdd', $this->cache->get('addKey')); } - /** - * @testdox Existing cache data can be replaced - * @covers phpOMS\DataStorage\Cache\Connection\RedisCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Existing cache data can be replaced')] public function testReplace() : void { $this->cache->set('key4', 4); @@ -278,21 +265,15 @@ final class RedisCacheTest extends \PHPUnit\Framework\TestCase self::assertEquals(5, $this->cache->get('key4')); } - /** - * @testdox None-existing cache data cannot be replaced - * @covers phpOMS\DataStorage\Cache\Connection\RedisCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('None-existing cache data cannot be replaced')] public function testInvalidReplace() : void { self::assertFalse($this->cache->replace('keyInvalid', 5)); } - /** - * @testdox Existing cache data can be deleted - * @covers phpOMS\DataStorage\Cache\Connection\RedisCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Existing cache data can be deleted')] public function testDelete() : void { $this->cache->set('key4', 4); @@ -313,11 +294,8 @@ final class RedisCacheTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->cache->delete('invalid')); } - /** - * @testdox The cache correctly handles general cache information - * @covers phpOMS\DataStorage\Cache\Connection\RedisCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The cache correctly handles general cache information')] public function testStats() : void { $this->cache->set('key1', 'testVal'); @@ -330,11 +308,8 @@ final class RedisCacheTest extends \PHPUnit\Framework\TestCase self::assertGreaterThan(0, $this->cache->stats()['size']); } - /** - * @testdox The cache can be flushed - * @covers phpOMS\DataStorage\Cache\Connection\RedisCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The cache can be flushed')] public function testFlush() : void { $this->cache->set('key1', 'testVal'); @@ -351,22 +326,16 @@ final class RedisCacheTest extends \PHPUnit\Framework\TestCase self::assertGreaterThanOrEqual(0, $this->cache->stats()['size']); } - /** - * @testdox Cache data can be set and returned with expiration limits - * @covers phpOMS\DataStorage\Cache\Connection\RedisCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cache data can be set and returned with expiration limits')] public function testUnexpiredInputOutput() : void { $this->cache->set('key1', 'testVal', 1); self::assertEquals('testVal', $this->cache->get('key1')); } - /** - * @testdox Expired cache data cannot be returned - * @covers phpOMS\DataStorage\Cache\Connection\RedisCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Expired cache data cannot be returned')] public function testExpiredInputOutput() : void { $this->cache->set('key2', 'testVal2', 1); @@ -375,11 +344,8 @@ final class RedisCacheTest extends \PHPUnit\Framework\TestCase self::assertNull($this->cache->get('key2', 1)); } - /** - * @testdox A bad cache status will prevent all cache actions - * @covers phpOMS\DataStorage\Cache\Connection\RedisCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A bad cache status will prevent all cache actions')] public function testBadCacheStatus() : void { TestUtils::setMember($this->cache, 'status', CacheStatus::FAILURE); @@ -394,11 +360,8 @@ final class RedisCacheTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $this->cache->stats()); } - /** - * @testdox Adding a invalid data type will throw an InvalidArgumentException - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Adding a invalid data type will throw an InvalidArgumentException')] public function testInvalidDataTypeAdd() : void { $this->expectException(\InvalidArgumentException::class); @@ -406,11 +369,8 @@ final class RedisCacheTest extends \PHPUnit\Framework\TestCase $this->cache->add('invalid', $this->cache); } - /** - * @testdox Setting a invalid data type will throw an InvalidArgumentException - * @covers phpOMS\DataStorage\Cache\Connection\MemCached - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Setting a invalid data type will throw an InvalidArgumentException')] public function testInvalidDataTypeSet() : void { $this->expectException(\InvalidArgumentException::class); @@ -418,11 +378,8 @@ final class RedisCacheTest extends \PHPUnit\Framework\TestCase $this->cache->set('invalid', $this->cache); } - /** - * @testdox A invalid host throws a InvalidConnectionConfigException - * @covers phpOMS\DataStorage\Cache\Connection\RedisCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid host throws a InvalidConnectionConfigException')] public function testInvalidCacheHost() : void { $this->expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class); @@ -433,11 +390,8 @@ final class RedisCacheTest extends \PHPUnit\Framework\TestCase $cache = new RedisCache($db); } - /** - * @testdox A invalid port throws a InvalidConnectionConfigException - * @covers phpOMS\DataStorage\Cache\Connection\RedisCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid port throws a InvalidConnectionConfigException')] public function testInvalidCachePort() : void { $this->expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class); @@ -448,11 +402,8 @@ final class RedisCacheTest extends \PHPUnit\Framework\TestCase $cache = new RedisCache($db); } - /** - * @testdox A invalid database throws a InvalidConnectionConfigException - * @covers phpOMS\DataStorage\Cache\Connection\RedisCache - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid database throws a InvalidConnectionConfigException')] public function testInvalidCacheDatabase() : void { $this->expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class); diff --git a/tests/DataStorage/Cache/Exception/InvalidConnectionConfigExceptionTest.php b/tests/DataStorage/Cache/Exception/InvalidConnectionConfigExceptionTest.php index 1dcf9c514..ad09830b4 100755 --- a/tests/DataStorage/Cache/Exception/InvalidConnectionConfigExceptionTest.php +++ b/tests/DataStorage/Cache/Exception/InvalidConnectionConfigExceptionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class)] final class InvalidConnectionConfigExceptionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testException() : void { self::assertInstanceOf(\InvalidArgumentException::class, new InvalidConnectionConfigException('')); diff --git a/tests/DataStorage/Cookie/CookieJarTest.php b/tests/DataStorage/Cookie/CookieJarTest.php index 1f2678ede..e2cdc5562 100755 --- a/tests/DataStorage/Cookie/CookieJarTest.php +++ b/tests/DataStorage/Cookie/CookieJarTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,9 @@ namespace phpOMS\tests\DataStorage\Cookie; use phpOMS\DataStorage\Cookie\CookieJar; /** - * @testdox phpOMS\tests\DataStorage\Cookie\CookieJar: CookieJar to handle http cookies - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Cookie\CookieJar: CookieJar to handle http cookies')] final class CookieJarTest extends \PHPUnit\Framework\TestCase { protected CookieJar $jar; @@ -33,10 +32,8 @@ final class CookieJarTest extends \PHPUnit\Framework\TestCase $this->jar = new CookieJar(); } - /** - * @testdox The cookie jar has the expected default values and functionality after initialization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The cookie jar has the expected default values and functionality after initialization')] public function testDefault() : void { self::assertFalse(CookieJar::isLocked()); @@ -44,10 +41,8 @@ final class CookieJarTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->jar->delete('abc')); } - /** - * @testdox Cookie values can be set and returned - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cookie values can be set and returned')] public function testCookieInputOutput() : void { self::assertTrue($this->jar->set('test', 'value')); @@ -57,40 +52,32 @@ final class CookieJarTest extends \PHPUnit\Framework\TestCase self::assertEquals('value2', $this->jar->get('test2')['value']); } - /** - * @testdox Cookie values cannot be overwritten - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cookie values cannot be overwritten')] public function testInvalidOverwrite() : void { self::assertTrue($this->jar->set('test', 'value')); self::assertFalse($this->jar->set('test', 'value', 86400, '/', null, false, true, false)); } - /** - * @testdox Cookie values can be forced to overwrite - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cookie values can be forced to overwrite')] public function testOverwrite() : void { self::assertTrue($this->jar->set('test', 'value')); self::assertTrue($this->jar->set('test', 'value2', 86400, '/', null, false, true, true)); } - /** - * @testdox Cookie values can be removed - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Cookie values can be removed')] public function testRemove() : void { self::assertTrue($this->jar->set('test', 'value')); self::assertTrue($this->jar->remove('test')); } - /** - * @testdox None-existing cookie values cannot be removed - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('None-existing cookie values cannot be removed')] public function testInvalidRemove() : void { self::assertTrue($this->jar->set('test', 'value')); @@ -98,10 +85,8 @@ final class CookieJarTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->jar->remove('test')); } - /** - * @testdox Values cannot be removed from a locked cookie and throws a LockException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Values cannot be removed from a locked cookie and throws a LockException')] public function testDeleteLocked() : void { $this->expectException(\phpOMS\DataStorage\LockException::class); @@ -112,10 +97,8 @@ final class CookieJarTest extends \PHPUnit\Framework\TestCase $this->jar->delete('test'); } - /** - * @testdox A locked cookie cannot be saved and throws a LockException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A locked cookie cannot be saved and throws a LockException')] public function testSaveLocked() : void { $this->expectException(\phpOMS\DataStorage\LockException::class); diff --git a/tests/DataStorage/Database/Connection/ConnectionFactoryTest.php b/tests/DataStorage/Database/Connection/ConnectionFactoryTest.php index 2fb76a8b4..c700d80e2 100755 --- a/tests/DataStorage/Database/Connection/ConnectionFactoryTest.php +++ b/tests/DataStorage/Database/Connection/ConnectionFactoryTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,17 +21,14 @@ use phpOMS\DataStorage\Database\Connection\SQLiteConnection; use phpOMS\DataStorage\Database\Connection\SqlServerConnection; /** - * @testdox phpOMS\tests\DataStorage\Database\Connection\ConnectionFactory: Database connection factory - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Connection\ConnectionFactory::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Database\Connection\ConnectionFactory: Database connection factory')] final class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The mysql connection can be successfully created - * @covers phpOMS\DataStorage\Database\Connection\ConnectionFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The mysql connection can be successfully created')] public function testCreateMysql() : void { if (!\extension_loaded('pdo_mysql')) { @@ -48,11 +45,8 @@ final class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The postgresql connection can be successfully created - * @covers phpOMS\DataStorage\Database\Connection\ConnectionFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The postgresql connection can be successfully created')] public function testCreatePostgres() : void { if (!\extension_loaded('pdo_pgsql')) { @@ -69,11 +63,8 @@ final class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The sqlserver connection can be successfully created - * @covers phpOMS\DataStorage\Database\Connection\ConnectionFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The sqlserver connection can be successfully created')] public function testCreateSqlsrv() : void { if (!\extension_loaded('pdo_sqlsrv')) { @@ -90,11 +81,8 @@ final class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The sqlite connection can be successfully created - * @covers phpOMS\DataStorage\Database\Connection\ConnectionFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The sqlite connection can be successfully created')] public function testCreateSqlite() : void { if (!\extension_loaded('pdo_sqlite')) { @@ -111,11 +99,8 @@ final class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A invalid database type throws a InvalidArgumentException - * @covers phpOMS\DataStorage\Database\Connection\ConnectionFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid database type throws a InvalidArgumentException')] public function testInvalidDatabaseType() : void { $this->expectException(\InvalidArgumentException::class); diff --git a/tests/DataStorage/Database/Connection/MysqlConnectionTest.php b/tests/DataStorage/Database/Connection/MysqlConnectionTest.php index db2b820fe..17eee5832 100755 --- a/tests/DataStorage/Database/Connection/MysqlConnectionTest.php +++ b/tests/DataStorage/Database/Connection/MysqlConnectionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,11 @@ use phpOMS\DataStorage\Database\DatabaseStatus; use phpOMS\DataStorage\Database\DatabaseType; /** - * @testdox phpOMS\tests\DataStorage\Database\Connection\MysqlConnectionTest: Mysql connection - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Connection\MysqlConnection::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Connection\MysqlConnection::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Database\Connection\MysqlConnectionTest: Mysql connection')] final class MysqlConnectionTest extends \PHPUnit\Framework\TestCase { protected function setUp() : void @@ -34,11 +35,8 @@ final class MysqlConnectionTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox Valid mysql connection data result in a valid database connection - * @covers phpOMS\DataStorage\Database\Connection\MysqlConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Valid mysql connection data result in a valid database connection')] public function testConnect() : void { $mysql = new MysqlConnection($GLOBALS['CONFIG']['db']['core']['masters']['admin']); @@ -53,11 +51,8 @@ final class MysqlConnectionTest extends \PHPUnit\Framework\TestCase $mysql->close(); } - /** - * @testdox A missing database type returns a failure - * @covers phpOMS\DataStorage\Database\Connection\MysqlConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database type returns a failure')] public function testInvalidDatabaseType() : void { $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; @@ -69,11 +64,8 @@ final class MysqlConnectionTest extends \PHPUnit\Framework\TestCase $mysql->close(); } - /** - * @testdox A missing database host returns a failure - * @covers phpOMS\DataStorage\Database\Connection\MysqlConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database host returns a failure')] public function testInvalidHost() : void { $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; @@ -85,11 +77,8 @@ final class MysqlConnectionTest extends \PHPUnit\Framework\TestCase $mysql->close(); } - /** - * @testdox A missing database port returns a failure - * @covers phpOMS\DataStorage\Database\Connection\MysqlConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database port returns a failure')] public function testInvalidPort() : void { $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; @@ -101,11 +90,8 @@ final class MysqlConnectionTest extends \PHPUnit\Framework\TestCase $mysql->close(); } - /** - * @testdox A missing database returns a failure - * @covers phpOMS\DataStorage\Database\Connection\MysqlConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database returns a failure')] public function testInvalidDatabase() : void { $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; @@ -117,11 +103,8 @@ final class MysqlConnectionTest extends \PHPUnit\Framework\TestCase $mysql->close(); } - /** - * @testdox A missing database login returns a failure - * @covers phpOMS\DataStorage\Database\Connection\MysqlConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database login returns a failure')] public function testInvalidLogin() : void { $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; @@ -133,11 +116,8 @@ final class MysqlConnectionTest extends \PHPUnit\Framework\TestCase $mysql->close(); } - /** - * @testdox A missing database password returns a failure - * @covers phpOMS\DataStorage\Database\Connection\MysqlConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database password returns a failure')] public function testInvalidPassword() : void { $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; @@ -149,11 +129,8 @@ final class MysqlConnectionTest extends \PHPUnit\Framework\TestCase $mysql->close(); } - /** - * @testdox A invalid database type returns a failure - * @covers phpOMS\DataStorage\Database\Connection\MysqlConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid database type returns a failure')] public function testInvalidDatabaseTypeName() : void { $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; @@ -165,11 +142,8 @@ final class MysqlConnectionTest extends \PHPUnit\Framework\TestCase $mysql->close(); } - /** - * @testdox A invalid database returns a failure - * @covers phpOMS\DataStorage\Database\Connection\MysqlConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid database returns a failure')] public function testInvalidDatabaseName() : void { $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; diff --git a/tests/DataStorage/Database/Connection/NullConnectionTest.php b/tests/DataStorage/Database/Connection/NullConnectionTest.php index 587efc6d8..af50e5ec9 100755 --- a/tests/DataStorage/Database/Connection/NullConnectionTest.php +++ b/tests/DataStorage/Database/Connection/NullConnectionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,17 +18,14 @@ use phpOMS\DataStorage\Database\Connection\NullConnection; use phpOMS\DataStorage\Database\DatabaseType; /** - * @testdox phpOMS\tests\DataStorage\Database\Connection\NullConnectionTest: Null connection - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Connection\NullConnection::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Database\Connection\NullConnectionTest: Null connection')] final class NullConnectionTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A null connection can be created as placeholder - * @covers phpOMS\DataStorage\Database\Connection\NullConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A null connection can be created as placeholder')] public function testConnect() : void { $null = new NullConnection([]); diff --git a/tests/DataStorage/Database/Connection/PostgresConnectionTest.php b/tests/DataStorage/Database/Connection/PostgresConnectionTest.php index 8cda49ec6..4a2600369 100755 --- a/tests/DataStorage/Database/Connection/PostgresConnectionTest.php +++ b/tests/DataStorage/Database/Connection/PostgresConnectionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,11 @@ use phpOMS\DataStorage\Database\DatabaseStatus; use phpOMS\DataStorage\Database\DatabaseType; /** - * @testdox phpOMS\tests\DataStorage\Database\Connection\PostgresConnectionTest: Postgresql connection - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Connection\PostgresConnection::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Connection\PostgresConnection::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Database\Connection\PostgresConnectionTest: Postgresql connection')] final class PostgresConnectionTest extends \PHPUnit\Framework\TestCase { protected function setUp() : void @@ -34,11 +35,8 @@ final class PostgresConnectionTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox Valid postgresql connection data result in a valid database connection - * @covers phpOMS\DataStorage\Database\Connection\PostgresConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Valid postgresql connection data result in a valid database connection')] public function testConnect() : void { $psql = new PostgresConnection($GLOBALS['CONFIG']['db']['core']['postgresql']['admin']); @@ -53,11 +51,8 @@ final class PostgresConnectionTest extends \PHPUnit\Framework\TestCase $psql->close(); } - /** - * @testdox A missing database type returns a failure - * @covers phpOMS\DataStorage\Database\Connection\PostgresConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database type returns a failure')] public function testInvalidDatabaseType() : void { $db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin']; @@ -68,11 +63,8 @@ final class PostgresConnectionTest extends \PHPUnit\Framework\TestCase $psql->close(); } - /** - * @testdox A missing database host returns a failure - * @covers phpOMS\DataStorage\Database\Connection\PostgresConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database host returns a failure')] public function testInvalidHost() : void { $db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin']; @@ -83,11 +75,8 @@ final class PostgresConnectionTest extends \PHPUnit\Framework\TestCase $psql->close(); } - /** - * @testdox A missing database port returns a failure - * @covers phpOMS\DataStorage\Database\Connection\PostgresConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database port returns a failure')] public function testInvalidPort() : void { $db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin']; @@ -98,11 +87,8 @@ final class PostgresConnectionTest extends \PHPUnit\Framework\TestCase $psql->close(); } - /** - * @testdox A missing database returns a failure - * @covers phpOMS\DataStorage\Database\Connection\PostgresConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database returns a failure')] public function testInvalidDatabase() : void { $db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin']; @@ -113,11 +99,8 @@ final class PostgresConnectionTest extends \PHPUnit\Framework\TestCase $psql->close(); } - /** - * @testdox A missing database login returns a failure - * @covers phpOMS\DataStorage\Database\Connection\PostgresConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database login returns a failure')] public function testInvalidLogin() : void { $db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin']; @@ -128,11 +111,8 @@ final class PostgresConnectionTest extends \PHPUnit\Framework\TestCase $psql->close(); } - /** - * @testdox A missing database password returns a failure - * @covers phpOMS\DataStorage\Database\Connection\PostgresConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database password returns a failure')] public function testInvalidPassword() : void { $db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin']; @@ -143,11 +123,8 @@ final class PostgresConnectionTest extends \PHPUnit\Framework\TestCase $psql->close(); } - /** - * @testdox A invalid database returns a failure - * @covers phpOMS\DataStorage\Database\Connection\PostgresConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid database returns a failure')] public function testInvalidDatabaseTypeName() : void { $db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin']; @@ -158,11 +135,8 @@ final class PostgresConnectionTest extends \PHPUnit\Framework\TestCase $psql->close(); } - /** - * @testdox A invalid database returns a failure - * @covers phpOMS\DataStorage\Database\Connection\PostgresConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid database returns a failure')] public function testInvalidDatabaseName() : void { $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; diff --git a/tests/DataStorage/Database/Connection/SQLiteConnectionTest.php b/tests/DataStorage/Database/Connection/SQLiteConnectionTest.php index b1daf453e..5f90ad047 100755 --- a/tests/DataStorage/Database/Connection/SQLiteConnectionTest.php +++ b/tests/DataStorage/Database/Connection/SQLiteConnectionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,11 @@ use phpOMS\DataStorage\Database\DatabaseStatus; use phpOMS\DataStorage\Database\DatabaseType; /** - * @testdox phpOMS\tests\DataStorage\Database\Connection\SQLiteConnectionTest: SQLite connection - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Connection\SQLiteConnection::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Connection\SQLiteConnection::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Database\Connection\SQLiteConnectionTest: SQLite connection')] final class SQLiteConnectionTest extends \PHPUnit\Framework\TestCase { protected function setUp() : void @@ -34,11 +35,8 @@ final class SQLiteConnectionTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox Valid sqlite connection data result in a valid database connection - * @covers phpOMS\DataStorage\Database\Connection\SQLiteConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Valid sqlite connection data result in a valid database connection')] public function testConnect() : void { $sqlite = new SQLiteConnection($GLOBALS['CONFIG']['db']['core']['sqlite']['admin']); @@ -50,11 +48,8 @@ final class SQLiteConnectionTest extends \PHPUnit\Framework\TestCase $sqlite->close(); } - /** - * @testdox A missing database type returns a failure - * @covers phpOMS\DataStorage\Database\Connection\SQLiteConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database type returns a failure')] public function testInvalidDatabaseType() : void { $db = $GLOBALS['CONFIG']['db']['core']['sqlite']['admin']; @@ -65,11 +60,8 @@ final class SQLiteConnectionTest extends \PHPUnit\Framework\TestCase $sqlite->close(); } - /** - * @testdox Valid sqlite connection data result in a valid database connection - * @covers phpOMS\DataStorage\Database\Connection\SQLiteConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Valid sqlite connection data result in a valid database connection')] public function testInvalidDatabasePath() : void { $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; @@ -81,11 +73,8 @@ final class SQLiteConnectionTest extends \PHPUnit\Framework\TestCase $sqlite->close(); } - /** - * @testdox A missing database returns a failure - * @covers phpOMS\DataStorage\Database\Connection\SQLiteConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database returns a failure')] public function testInvalidDatabase() : void { $db = $GLOBALS['CONFIG']['db']['core']['sqlite']['admin']; @@ -96,11 +85,8 @@ final class SQLiteConnectionTest extends \PHPUnit\Framework\TestCase $sqlite->close(); } - /** - * @testdox A invalid database returns a failure - * @covers phpOMS\DataStorage\Database\Connection\SQLiteConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid database returns a failure')] public function testInvalidDatabaseName() : void { $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; diff --git a/tests/DataStorage/Database/Connection/SqlServerConnectionTest.php b/tests/DataStorage/Database/Connection/SqlServerConnectionTest.php index c87abe0d1..99af5a83f 100755 --- a/tests/DataStorage/Database/Connection/SqlServerConnectionTest.php +++ b/tests/DataStorage/Database/Connection/SqlServerConnectionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,11 @@ use phpOMS\DataStorage\Database\DatabaseStatus; use phpOMS\DataStorage\Database\DatabaseType; /** - * @testdox phpOMS\tests\DataStorage\Database\Connection\SqlServerConnectionTest: Sqlserver connection - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Connection\SqlServerConnection::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Connection\SqlServerConnection::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Database\Connection\SqlServerConnectionTest: Sqlserver connection')] final class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase { protected function setUp() : void @@ -43,11 +44,8 @@ final class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase $ssql->close(); } - /** - * @testdox Valid sqlserver connection data result in a valid database connection - * @covers phpOMS\DataStorage\Database\Connection\SqlServerConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Valid sqlserver connection data result in a valid database connection')] public function testConnect() : void { $ssql = new SqlServerConnection($GLOBALS['CONFIG']['db']['core']['mssql']['admin']); @@ -61,11 +59,8 @@ final class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase $ssql->close(); } - /** - * @testdox A missing database type returns a failure - * @covers phpOMS\DataStorage\Database\Connection\SqlServerConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database type returns a failure')] public function testInvalidDatabaseType() : void { $db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin']; @@ -76,11 +71,8 @@ final class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase $ssql->close(); } - /** - * @testdox A missing database host returns a failure - * @covers phpOMS\DataStorage\Database\Connection\SqlServerConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database host returns a failure')] public function testInvalidHost() : void { $db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin']; @@ -91,11 +83,8 @@ final class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase $ssql->close(); } - /** - * @testdox A missing database port returns a failure - * @covers phpOMS\DataStorage\Database\Connection\SqlServerConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database port returns a failure')] public function testInvalidPort() : void { $db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin']; @@ -106,11 +95,8 @@ final class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase $ssql->close(); } - /** - * @testdox A missing database returns a failure - * @covers phpOMS\DataStorage\Database\Connection\SqlServerConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database returns a failure')] public function testInvalidDatabase() : void { $db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin']; @@ -121,11 +107,8 @@ final class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase $ssql->close(); } - /** - * @testdox A missing database login returns a failure - * @covers phpOMS\DataStorage\Database\Connection\SqlServerConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database login returns a failure')] public function testInvalidLogin() : void { $db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin']; @@ -136,11 +119,8 @@ final class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase $ssql->close(); } - /** - * @testdox A missing database password returns a failure - * @covers phpOMS\DataStorage\Database\Connection\SqlServerConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database password returns a failure')] public function testInvalidPassword() : void { $db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin']; @@ -151,11 +131,8 @@ final class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase $ssql->close(); } - /** - * @testdox A invalid database type returns a failure - * @covers phpOMS\DataStorage\Database\Connection\SqlServerConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid database type returns a failure')] public function testInvalidDatabaseTypeName() : void { $db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin']; @@ -166,11 +143,8 @@ final class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase $ssql->close(); } - /** - * @testdox A invalid database returns a failure - * @covers phpOMS\DataStorage\Database\Connection\SqlServerConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid database returns a failure')] public function testInvalidDatabaseName() : void { $db['database'] = 'invalid'; diff --git a/tests/DataStorage/Database/DataMapperAbstractTest.php b/tests/DataStorage/Database/DataMapperAbstractTest.php index ceb2b0873..9dddefc75 100755 --- a/tests/DataStorage/Database/DataMapperAbstractTest.php +++ b/tests/DataStorage/Database/DataMapperAbstractTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -27,10 +27,15 @@ use phpOMS\tests\DataStorage\Database\TestModel\ManyToManyRelModelMapper; use phpOMS\tests\DataStorage\Database\TestModel\NullBaseModel; /** - * @testdox phpOMS\tests\DataStorage\Database\Mapper\DataMapperAbstractTest: Datamapper for database models - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Mapper\DataMapperAbstract::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Mapper\DataMapperFactory::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Mapper\ReadMapper::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Mapper\WriteMapper::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Mapper\UpdateMapper::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Mapper\DeleteMapper::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Database\Mapper\DataMapperAbstractTest: Datamapper for database models')] final class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase { protected BaseModel $model; @@ -184,16 +189,8 @@ final class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase \phpOMS\Log\FileLogger::getInstance()->verbose = false; } - /** - * @testdox The datamapper successfully creates a database entry of a model - * @covers phpOMS\DataStorage\Database\Mapper\DataMapperAbstract - * @covers phpOMS\DataStorage\Database\Mapper\DataMapperFactory - * @covers phpOMS\DataStorage\Database\Mapper\ReadMapper - * @covers phpOMS\DataStorage\Database\Mapper\WriteMapper - * @covers phpOMS\DataStorage\Database\Mapper\UpdateMapper - * @covers phpOMS\DataStorage\Database\Mapper\DeleteMapper - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The datamapper successfully creates a database entry of a model')] public function testCreate() : void { self::assertGreaterThan(0, BaseModelMapper::create()->execute($this->model)); @@ -232,16 +229,8 @@ final class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase self::assertCount($count1 + 1, $base->hasManyRelations); } - /** - * @testdox The datamapper successfully returns a database entry as model - * @covers phpOMS\DataStorage\Database\Mapper\DataMapperAbstract - * @covers phpOMS\DataStorage\Database\Mapper\DataMapperFactory - * @covers phpOMS\DataStorage\Database\Mapper\ReadMapper - * @covers phpOMS\DataStorage\Database\Mapper\WriteMapper - * @covers phpOMS\DataStorage\Database\Mapper\UpdateMapper - * @covers phpOMS\DataStorage\Database\Mapper\DeleteMapper - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The datamapper successfully returns a database entry as model')] public function testRead() : void { $id = BaseModelMapper::create()->execute($this->model); @@ -299,7 +288,7 @@ final class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase public function testGetAll() : void { BaseModelMapper::create()->execute($this->model); - self::assertCount(1, BaseModelMapper::getAll()->execute()); + self::assertCount(1, BaseModelMapper::getAll()->executeGetArray()); } public function testGetYield() : void @@ -314,7 +303,7 @@ final class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase public function testGetFor() : void { $id = BaseModelMapper::create()->execute($this->model); - $for = ManyToManyDirectModelMapper::getAll()->where('to', $id)->execute(); + $for = ManyToManyDirectModelMapper::getAll()->where('to', $id)->executeGetArray(); self::assertEquals( \reset($this->model->hasManyDirect)->string, @@ -348,7 +337,7 @@ final class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase $model2->datetime = new \DateTime('now'); $id2 = BaseModelMapper::create()->execute($model2); - $newest = BaseModelMapper::getAll()->sort('id', OrderType::DESC)->limit(1)->execute(); + $newest = BaseModelMapper::getAll()->sort('id', OrderType::DESC)->limit(1)->executeGetArray(); self::assertEquals($id2, \reset($newest)->id); } @@ -360,7 +349,7 @@ final class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase public function testCount() : void { BaseModelMapper::create()->execute($this->model); - self::assertEquals(1, BaseModelMapper::count()->execute()); + self::assertEquals(1, BaseModelMapper::count()->executeCount()); } public function testSum() : void @@ -389,15 +378,7 @@ final class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase self::assertEquals($id, BaseModelMApper::getRandom()->limit(1)->execute()->id); } - /** - * @covers phpOMS\DataStorage\Database\Mapper\DataMapperAbstract - * @covers phpOMS\DataStorage\Database\Mapper\DataMapperFactory - * @covers phpOMS\DataStorage\Database\Mapper\ReadMapper - * @covers phpOMS\DataStorage\Database\Mapper\WriteMapper - * @covers phpOMS\DataStorage\Database\Mapper\UpdateMapper - * @covers phpOMS\DataStorage\Database\Mapper\DeleteMapper - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testFind() : void { $model1 = clone $this->model; @@ -412,7 +393,7 @@ final class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase BaseModelMapper::create()->execute($model2); BaseModelMapper::create()->execute($model3); - $found = BaseModelMapper::getAll()->where('string', '%sir%' , 'LIKE')->execute(); + $found = BaseModelMapper::getAll()->where('string', '%sir%' , 'LIKE')->executeGetArray(); self::assertCount(2, $found); self::assertEquals($model2->string, \reset($found)->string); self::assertEquals($model3->string, \end($found)->string); @@ -441,15 +422,7 @@ final class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase self::assertEquals(2, \count($list['data'])); } - /** - * @covers phpOMS\DataStorage\Database\Mapper\DataMapperAbstract - * @covers phpOMS\DataStorage\Database\Mapper\DataMapperFactory - * @covers phpOMS\DataStorage\Database\Mapper\ReadMapper - * @covers phpOMS\DataStorage\Database\Mapper\WriteMapper - * @covers phpOMS\DataStorage\Database\Mapper\UpdateMapper - * @covers phpOMS\DataStorage\Database\Mapper\DeleteMapper - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testWithConditional() : void { $model1 = clone $this->model; @@ -482,7 +455,7 @@ final class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase $cond3->base = $id2; ConditionalMapper::create()->execute($cond3); - $found = BaseModelMapper::getAll()->with('conditional')->where('conditional/language', 'de')->execute(); + $found = BaseModelMapper::getAll()->with('conditional')->where('conditional/language', 'de')->executeGetArray(); self::assertCount(2, $found); self::assertEquals($model1->string, \reset($found)->string); self::assertEquals($model2->string, \end($found)->string); @@ -490,16 +463,8 @@ final class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase self::assertEquals('cond2_de', \end($found)->conditional); } - /** - * @testdox The datamapper successfully updates a database entry from a model - * @covers phpOMS\DataStorage\Database\Mapper\DataMapperAbstract - * @covers phpOMS\DataStorage\Database\Mapper\DataMapperFactory - * @covers phpOMS\DataStorage\Database\Mapper\ReadMapper - * @covers phpOMS\DataStorage\Database\Mapper\WriteMapper - * @covers phpOMS\DataStorage\Database\Mapper\UpdateMapper - * @covers phpOMS\DataStorage\Database\Mapper\DeleteMapper - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The datamapper successfully updates a database entry from a model')] public function testUpdate() : void { $id = BaseModelMapper::create()->execute($this->model); @@ -525,16 +490,8 @@ final class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase self::assertNull($modelR2->datetime_null); } - /** - * @testdox The datamapper successfully deletes a database entry from a model - * @covers phpOMS\DataStorage\Database\Mapper\DataMapperAbstract - * @covers phpOMS\DataStorage\Database\Mapper\DataMapperFactory - * @covers phpOMS\DataStorage\Database\Mapper\ReadMapper - * @covers phpOMS\DataStorage\Database\Mapper\WriteMapper - * @covers phpOMS\DataStorage\Database\Mapper\UpdateMapper - * @covers phpOMS\DataStorage\Database\Mapper\DeleteMapper - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The datamapper successfully deletes a database entry from a model')] public function testDelete() : void { $id = BaseModelMapper::create()->execute($this->model); diff --git a/tests/DataStorage/Database/DatabasePoolTest.php b/tests/DataStorage/Database/DatabasePoolTest.php index a772a94c9..8c92c3101 100755 --- a/tests/DataStorage/Database/DatabasePoolTest.php +++ b/tests/DataStorage/Database/DatabasePoolTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,9 @@ use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\DataStorage\Database\DatabaseStatus; /** - * @testdox phpOMS\tests\DataStorage\Database\DatabasePool: Pool for database connections - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Database\DatabasePool: Pool for database connections')] final class DatabasePoolTest extends \PHPUnit\Framework\TestCase { protected DatabasePool $dbPool; @@ -35,19 +34,15 @@ final class DatabasePoolTest extends \PHPUnit\Framework\TestCase $this->dbPool = new DatabasePool(); } - /** - * @testdox The pool has the expected default values after initialization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The pool has the expected default values after initialization')] public function testDefault() : void { self::assertInstanceOf('\phpOMS\DataStorage\Database\Connection\NullConnection', $this->dbPool->get()); } - /** - * @testdox A database connection can be created by the pool - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A database connection can be created by the pool')] public function testCreateConnection() : void { /** @var array $CONFIG */ @@ -55,10 +50,8 @@ final class DatabasePoolTest extends \PHPUnit\Framework\TestCase self::assertEquals($this->dbPool->get()->getStatus(), DatabaseStatus::OK); } - /** - * @testdox Database connections cannot be overwritten - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Database connections cannot be overwritten')] public function testInvalidOverwrite() : void { /** @var array $CONFIG */ @@ -67,10 +60,8 @@ final class DatabasePoolTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->dbPool->add('core', new MysqlConnection($GLOBALS['CONFIG']['db']['core']['masters']['admin']))); } - /** - * @testdox Existing database connections can be added to the pool - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Existing database connections can be added to the pool')] public function testAddConnections() : void { /** @var array $CONFIG */ @@ -78,10 +69,8 @@ final class DatabasePoolTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\phpOMS\DataStorage\Database\Connection\ConnectionAbstract', $this->dbPool->get()); } - /** - * @testdox Database connections can be removed from the pool - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Database connections can be removed from the pool')] public function testRemoveConnections() : void { /** @var array $CONFIG */ @@ -90,10 +79,8 @@ final class DatabasePoolTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\phpOMS\DataStorage\Database\Connection\NullConnection', $this->dbPool->get()); } - /** - * @testdox Invalid database connections cannot be removed - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid database connections cannot be removed')] public function testInvalidRemove() : void { /** @var array $CONFIG */ @@ -101,10 +88,8 @@ final class DatabasePoolTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->dbPool->remove('cores')); } - /** - * @testdox The first connection added to the pool is the default connection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The first connection added to the pool is the default connection')] public function testDefaultConnection() : void { /** @var array $CONFIG */ diff --git a/tests/DataStorage/Database/DatabaseStatusTest.php b/tests/DataStorage/Database/DatabaseStatusTest.php index 4184407dd..b349c5ed4 100755 --- a/tests/DataStorage/Database/DatabaseStatusTest.php +++ b/tests/DataStorage/Database/DatabaseStatusTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\DataStorage\Database\DatabaseStatus; */ final class DatabaseStatusTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(6, DatabaseStatus::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(DatabaseStatus::getConstants(), \array_unique(DatabaseStatus::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(0, DatabaseStatus::OK); diff --git a/tests/DataStorage/Database/DatabaseTypeTest.php b/tests/DataStorage/Database/DatabaseTypeTest.php index 025ea582c..2cf24625b 100755 --- a/tests/DataStorage/Database/DatabaseTypeTest.php +++ b/tests/DataStorage/Database/DatabaseTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\DataStorage\Database\DatabaseType; */ final class DatabaseTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(5, DatabaseType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(DatabaseType::getConstants(), \array_unique(DatabaseType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('mysql', DatabaseType::MYSQL); diff --git a/tests/DataStorage/Database/Exception/InvalidConnectionConfigExceptionTest.php b/tests/DataStorage/Database/Exception/InvalidConnectionConfigExceptionTest.php index 1b8dea5aa..081dcfdad 100755 --- a/tests/DataStorage/Database/Exception/InvalidConnectionConfigExceptionTest.php +++ b/tests/DataStorage/Database/Exception/InvalidConnectionConfigExceptionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class)] final class InvalidConnectionConfigExceptionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testException() : void { self::assertInstanceOf(\InvalidArgumentException::class, new InvalidConnectionConfigException('')); diff --git a/tests/DataStorage/Database/Exception/InvalidDatabaseTypeExceptionTest.php b/tests/DataStorage/Database/Exception/InvalidDatabaseTypeExceptionTest.php index 7056e10aa..a3aa76e77 100755 --- a/tests/DataStorage/Database/Exception/InvalidDatabaseTypeExceptionTest.php +++ b/tests/DataStorage/Database/Exception/InvalidDatabaseTypeExceptionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\DataStorage\Database\Exception\InvalidDatabaseTypeException; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Exception\InvalidDatabaseTypeException::class)] final class InvalidDatabaseTypeExceptionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\DataStorage\Database\Exception\InvalidDatabaseTypeException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testException() : void { self::assertInstanceOf(\InvalidArgumentException::class, new InvalidDatabaseTypeException('')); diff --git a/tests/DataStorage/Database/Exception/InvalidMapperExceptionTest.php b/tests/DataStorage/Database/Exception/InvalidMapperExceptionTest.php index a1fe90e26..c76b8f420 100755 --- a/tests/DataStorage/Database/Exception/InvalidMapperExceptionTest.php +++ b/tests/DataStorage/Database/Exception/InvalidMapperExceptionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\DataStorage\Database\Exception\InvalidMapperException; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Exception\InvalidMapperException::class)] final class InvalidMapperExceptionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\DataStorage\Database\Exception\InvalidMapperException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testException() : void { self::assertInstanceOf(\RuntimeException::class, new InvalidMapperException('')); diff --git a/tests/DataStorage/Database/Query/BuilderTest.php b/tests/DataStorage/Database/Query/BuilderTest.php index c9b2b9720..cd6d009bc 100755 --- a/tests/DataStorage/Database/Query/BuilderTest.php +++ b/tests/DataStorage/Database/Query/BuilderTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -22,13 +22,12 @@ use phpOMS\DataStorage\Database\Query\Builder; use phpOMS\DataStorage\Database\Query\Parameter; /** - * @testdox phpOMS\tests\DataStorage\Database\Query\BuilderTest: Query builder for sql queries - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Database\Query\BuilderTest: Query builder for sql queries')] final class BuilderTest extends \PHPUnit\Framework\TestCase { - public function dbConnectionProvider() : array + public static function dbConnectionProvider() : array { $cons = [ [new MysqlConnection($GLOBALS['CONFIG']['db']['core']['masters']['admin'])], @@ -45,11 +44,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase return $cons; } - /** - * @testdox Mysql selects form a valid query - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Mysql selects form a valid query')] public function testSelect($con) : void { if (!$con->isInitialized()) { @@ -165,11 +162,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase self::assertEquals($sql, $query->random('a.test')->fromAs('a', 'b')->where('a.test', '=', 1)->toSql()); } - /** - * @testdox Mysql orders form a valid query - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Mysql orders form a valid query')] public function testOrder($con) : void { if (!$con->isInitialized()) { @@ -212,11 +207,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase self::assertEquals($sql, $query->select('a.test')->from('a')->where('a.test', '=', 1)->orderBy(['a.test', 'a.test2'], 'ASC')->toSql()); } - /** - * @testdox Mysql offsets and limits form a valid query - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Mysql offsets and limits form a valid query')] public function testOffsetLimit($con) : void { if (!$con->isInitialized()) { @@ -239,11 +232,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase self::assertEquals($sql, $query->select('a.test')->from('a')->where('a.test', '=', 1)->offset(3)->toSql()); } - /** - * @testdox Mysql groupings form a valid query - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Mysql groupings form a valid query')] public function testGroup($con) : void { if (!$con->isInitialized()) { @@ -274,11 +265,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase self::assertEquals($sql, $query->select('a.test')->from('a')->where('a.test', '=', new Parameter('test'))->groupBy('a', 'b')->toSql()); } - /** - * @testdox Mysql wheres form a valid query - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Mysql wheres form a valid query')] public function testWheres($con) : void { if (!$con->isInitialized()) { @@ -361,11 +350,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase self::assertEquals($sql, $query->select('a.test')->from('a')->where('a.test', '=', new Parameter('testWhere'))->whereIn('a.test2', ['a', new Parameter('bValue'), 'c'], 'or')->toSql()); } - /** - * @testdox Mysql joins form a valid query - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Mysql joins form a valid query')] public function testJoins($con) : void { if (!$con->isInitialized()) { @@ -448,11 +435,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase self::assertEquals($sql, $query->select('a.test')->from('a')->fullOuterJoin('b')->on('a.id', '=', 'b.id')->where('a.test', '=', 1)->toSql()); } - /** - * @testdox Mysql inserts form a valid query - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Mysql inserts form a valid query')] public function testInsert($con) : void { if (!$con->isInitialized()) { @@ -491,11 +476,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase self::assertEquals($sql, $query->insert('test', 'test2')->into('a')->values(new Parameter('test'), new Parameter('test2'))->toSql()); } - /** - * @testdox Mysql deletes form a valid query - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Mysql deletes form a valid query')] public function testDelete($con) : void { if (!$con->isInitialized()) { @@ -518,11 +501,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase self::assertEquals($sql, $query->delete()->from('a')->where('a.test', '=', new Parameter('testVal'))->toSql()); } - /** - * @testdox Mysql updates form a valid query - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Mysql updates form a valid query')] public function testUpdate($con) : void { if (!$con->isInitialized()) { @@ -550,11 +531,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase self::assertEquals($sql, $query->update('a')->set(['test' => 1])->set(['test2' => new Parameter('test2')])->where('a.test', '=', new Parameter('test3'))->toSql()); } - /** - * @testdox Raw queries get output as defined - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Raw queries get output as defined')] public function testRawInputOutput($con) : void { if (!$con->isInitialized()) { @@ -570,11 +549,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase self::assertEquals('SELECT test.val FROM test;', $query->raw('SELECT test.val FROM test;')->toSql()); } - /** - * @testdox Read only queries allow selects - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Read only queries allow selects')] public function testReadOnlyRawSelect($con) : void { if (!$con->isInitialized()) { @@ -590,11 +567,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf(Builder::class, $query->raw('SELECT * from oms;')); } - /** - * @testdox Read only queries don't allow drops - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Read only queries don't allow drops")] public function testReadOnlyRawDrop($con) : void { if (!$con->isInitialized()) { @@ -612,11 +587,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase $query->raw('DROP DATABASE oms;'); } - /** - * @testdox Read only queries don't allow deletes - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Read only queries don't allow deletes")] public function testReadOnlyRawDelete($con) : void { if (!$con->isInitialized()) { @@ -634,11 +607,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase $query->raw('DELETE oms;'); } - /** - * @testdox Read only queries don't allow creates - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Read only queries don't allow creates")] public function testReadOnlyRawCreate($con) : void { if (!$con->isInitialized()) { @@ -656,11 +627,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase $query->raw('CREATE oms;'); } - /** - * @testdox Read only queries don't allow modifications - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Read only queries don't allow modifications")] public function testReadOnlyRawAlter($con) : void { if (!$con->isInitialized()) { @@ -678,11 +647,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase $query->raw('ALTER oms;'); } - /** - * @testdox Read only queries don't allow inserts - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Read only queries don't allow inserts")] public function testReadOnlyInsert($con) : void { if (!$con->isInitialized()) { @@ -700,11 +667,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase $query->insert('test'); } - /** - * @testdox Read only queries don't allow updates - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Read only queries don't allow updates")] public function testReadOnlyUpdate($con) : void { if (!$con->isInitialized()) { @@ -722,11 +687,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase $query->update('table'); } - /** - * @testdox Read only queries don't allow deletes - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Read only queries don't allow deletes")] public function testReadOnlyDelete($con) : void { if (!$con->isInitialized()) { @@ -744,11 +707,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase $query->delete(); } - /** - * @testdox Invalid from types throw a InvalidArgumentException - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid from types throw a InvalidArgumentException')] public function testInvalidFromParameter($con) : void { if (!$con->isInitialized()) { @@ -766,11 +727,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase $query->from(false); } - /** - * @testdox Invalid group types throw a InvalidArgumentException - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid group types throw a InvalidArgumentException')] public function testInvalidGroupByParameter($con) : void { if (!$con->isInitialized()) { @@ -788,11 +747,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase $query->groupBy(false); } - /** - * @testdox Invalid where operators throw a InvalidArgumentException - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid where operators throw a InvalidArgumentException')] public function testInvalidWhereOperator($con) : void { if (!$con->isInitialized()) { @@ -810,11 +767,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase $query->where('a', 'invalid', 'b'); } - /** - * @testdox Invalid join operators throw a InvalidArgumentException - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid join operators throw a InvalidArgumentException')] public function testInvalidJoinOperator($con) : void { if (!$con->isInitialized()) { diff --git a/tests/DataStorage/Database/Query/Grammar/GrammarTest.php b/tests/DataStorage/Database/Query/Grammar/GrammarTest.php index 187c950ef..c69c828ed 100755 --- a/tests/DataStorage/Database/Query/Grammar/GrammarTest.php +++ b/tests/DataStorage/Database/Query/Grammar/GrammarTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,16 +17,13 @@ namespace phpOMS\tests\DataStorage\Database\Query\Grammar; use phpOMS\DataStorage\Database\Query\Grammar\Grammar; /** - * @testdox phpOMS\tests\DataStorage\Database\Query\GrammarTest: Basic sql query grammar - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Database\Query\GrammarTest: Basic sql query grammar')] final class GrammarTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The grammar has the expected default values after initialization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The grammar has the expected default values after initialization')] public function testDefault() : void { $grammar = new Grammar(); diff --git a/tests/DataStorage/Database/Query/Grammar/MysqlGrammarTest.php b/tests/DataStorage/Database/Query/Grammar/MysqlGrammarTest.php index 7e3340443..ae71a9f21 100755 --- a/tests/DataStorage/Database/Query/Grammar/MysqlGrammarTest.php +++ b/tests/DataStorage/Database/Query/Grammar/MysqlGrammarTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,16 +18,13 @@ use phpOMS\DataStorage\Database\Query\Grammar\MysqlGrammar; use phpOMS\Utils\TestUtils; /** - * @testdox phpOMS\tests\DataStorage\Database\Query\MysqlGrammarTest: Mysql sql query grammar - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Database\Query\MysqlGrammarTest: Mysql sql query grammar')] final class MysqlGrammarTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The grammar has the expected default values after initialization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The grammar has the expected default values after initialization')] public function testDefault() : void { self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new MysqlGrammar()); diff --git a/tests/DataStorage/Database/Query/Grammar/OracleGrammarTest.php b/tests/DataStorage/Database/Query/Grammar/OracleGrammarTest.php index 819d669cc..a4be1e469 100755 --- a/tests/DataStorage/Database/Query/Grammar/OracleGrammarTest.php +++ b/tests/DataStorage/Database/Query/Grammar/OracleGrammarTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\DataStorage\Database\Query\Grammar\OracleGrammar; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Query\Grammar\OracleGrammar::class)] final class OracleGrammarTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\DataStorage\Database\Query\Grammar\OracleGrammar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDefault() : void { self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new OracleGrammar()); diff --git a/tests/DataStorage/Database/Query/Grammar/PostgresGrammarTest.php b/tests/DataStorage/Database/Query/Grammar/PostgresGrammarTest.php index fc43b3323..4917d77d7 100755 --- a/tests/DataStorage/Database/Query/Grammar/PostgresGrammarTest.php +++ b/tests/DataStorage/Database/Query/Grammar/PostgresGrammarTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\DataStorage\Database\Query\Grammar\PostgresGrammar; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Query\Grammar\PostgresGrammar::class)] final class PostgresGrammarTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\DataStorage\Database\Query\Grammar\PostgresGrammar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDefault() : void { self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new PostgresGrammar()); diff --git a/tests/DataStorage/Database/Query/Grammar/SQLiteGrammarTest.php b/tests/DataStorage/Database/Query/Grammar/SQLiteGrammarTest.php index 97f566073..3887fcd9d 100755 --- a/tests/DataStorage/Database/Query/Grammar/SQLiteGrammarTest.php +++ b/tests/DataStorage/Database/Query/Grammar/SQLiteGrammarTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,16 +18,13 @@ use phpOMS\DataStorage\Database\Query\Grammar\SQLiteGrammar; use phpOMS\Utils\TestUtils; /** - * @testdox phpOMS\tests\DataStorage\Database\Query\SQLiteGrammarTest: SQLite sql query grammar - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Database\Query\SQLiteGrammarTest: SQLite sql query grammar')] final class SQLiteGrammarTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The grammar has the expected default values after initialization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The grammar has the expected default values after initialization')] public function testDefault() : void { self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new SqliteGrammar()); diff --git a/tests/DataStorage/Database/Query/Grammar/SqlServerGrammarTest.php b/tests/DataStorage/Database/Query/Grammar/SqlServerGrammarTest.php index b757ffbe1..091f1e96e 100755 --- a/tests/DataStorage/Database/Query/Grammar/SqlServerGrammarTest.php +++ b/tests/DataStorage/Database/Query/Grammar/SqlServerGrammarTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\DataStorage\Database\Query\Grammar\SqlServerGrammar; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Query\Grammar\SqlServerGrammar::class)] final class SqlServerGrammarTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\DataStorage\Database\Query\Grammar\SqlServerGrammar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDefault() : void { self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new SqlServerGrammar()); diff --git a/tests/DataStorage/Database/Query/JoinTypeTest.php b/tests/DataStorage/Database/Query/JoinTypeTest.php index a8d836eca..91aacd8a9 100755 --- a/tests/DataStorage/Database/Query/JoinTypeTest.php +++ b/tests/DataStorage/Database/Query/JoinTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\DataStorage\Database\Query\JoinType; */ final class JoinTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(12, JoinType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(JoinType::getConstants(), \array_unique(JoinType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('JOIN', JoinType::JOIN); diff --git a/tests/DataStorage/Database/Query/QueryTypeTest.php b/tests/DataStorage/Database/Query/QueryTypeTest.php index 14a8e8e1b..de959588e 100755 --- a/tests/DataStorage/Database/Query/QueryTypeTest.php +++ b/tests/DataStorage/Database/Query/QueryTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\DataStorage\Database\Query\QueryType; */ final class QueryTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(7, QueryType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(QueryType::getConstants(), \array_unique(QueryType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(0, QueryType::SELECT); diff --git a/tests/DataStorage/Database/Query/WhereTest.php b/tests/DataStorage/Database/Query/WhereTest.php index 0743cca4c..0ae5c3697 100755 --- a/tests/DataStorage/Database/Query/WhereTest.php +++ b/tests/DataStorage/Database/Query/WhereTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\DataStorage\Database\Query\Where; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Query\Where::class)] final class WhereTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\DataStorage\Database\Query\Where - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDefault() : void { self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Builder', new Where($GLOBALS['dbpool']->get())); diff --git a/tests/DataStorage/Database/RelationTypeTest.php b/tests/DataStorage/Database/RelationTypeTest.php index f0a853583..cd8f540ef 100755 --- a/tests/DataStorage/Database/RelationTypeTest.php +++ b/tests/DataStorage/Database/RelationTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\DataStorage\Database\RelationType; */ final class RelationTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(7, RelationType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(RelationType::getConstants(), \array_unique(RelationType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(1, RelationType::NONE); diff --git a/tests/DataStorage/Database/Schema/BuilderTest.php b/tests/DataStorage/Database/Schema/BuilderTest.php index edc19f660..53e2da22f 100755 --- a/tests/DataStorage/Database/Schema/BuilderTest.php +++ b/tests/DataStorage/Database/Schema/BuilderTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,13 +21,13 @@ use phpOMS\DataStorage\Database\Connection\SqlServerConnection; use phpOMS\DataStorage\Database\Schema\Builder; /** - * @testdox phpOMS\tests\DataStorage\Database\Schema\BuilderTest: Query builder for sql schemas - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Schema\Grammar\MysqlGrammar::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Database\Schema\BuilderTest: Query builder for sql schemas')] final class BuilderTest extends \PHPUnit\Framework\TestCase { - public function dbConnectionProvider() : array + public static function dbConnectionProvider() : array { $cons = [ [new MysqlConnection($GLOBALS['CONFIG']['db']['core']['masters']['admin'])], @@ -44,11 +44,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase return $cons; } - /** - * @testdox Mysql database drop forms a valid query - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Mysql database drop forms a valid query')] public function testDrop($con) : void { if (!$con->isInitialized()) { @@ -66,11 +64,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase self::assertEquals($sql, $query->dropDatabase('test')->toSql()); } - /** - * @testdox Mysql table drop forms a valid query - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Mysql table drop forms a valid query')] public function testDropTable($con) : void { if (!$con->isInitialized()) { @@ -88,11 +84,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase self::assertEquals($sql, $query->dropTable('test')->toSql()); } - /** - * @testdox Mysql show tables form a valid query - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Mysql show tables form a valid query')] public function testShowTables($con) : void { if (!$con->isInitialized()) { @@ -121,11 +115,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase self::assertEquals($sql, $query->selectTables()->toSql()); } - /** - * @testdox Mysql show fields form a valid query - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Mysql show fields form a valid query')] public function testShowFields($con) : void { if (!$con->isInitialized()) { @@ -154,11 +146,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase self::assertEquals($sql, $query->selectFields('test')->toSql()); } - /** - * @testdox Mysql create tables form a valid query - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Mysql create tables form a valid query')] public function testCreateTable($con) : void { if (!$con->isInitialized()) { @@ -217,13 +207,9 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase ); } */ - - /** - * @testdox The grammar correctly deletes a table - * @covers phpOMS\DataStorage\Database\Schema\Grammar\MysqlGrammar - * @group framework - * @dataProvider dbConnectionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dbConnectionProvider')] + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The grammar correctly deletes a table')] public function testCreateFromSchema($con) : void { if (!$con->isInitialized()) { diff --git a/tests/DataStorage/Database/Schema/Grammar/GrammarTest.php b/tests/DataStorage/Database/Schema/Grammar/GrammarTest.php index 56c920a16..77b3ecac9 100755 --- a/tests/DataStorage/Database/Schema/Grammar/GrammarTest.php +++ b/tests/DataStorage/Database/Schema/Grammar/GrammarTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,16 +17,13 @@ namespace phpOMS\tests\DataStorage\Database\Schema\Grammar; use phpOMS\DataStorage\Database\Schema\Grammar\Grammar; /** - * @testdox phpOMS\tests\DataStorage\Database\Schema\GrammarTest: Basic sql query grammar - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Database\Schema\GrammarTest: Basic sql query grammar')] final class GrammarTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The grammar has the expected default values after initialization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The grammar has the expected default values after initialization')] public function testDefault() : void { $grammar = new Grammar(); diff --git a/tests/DataStorage/Database/Schema/Grammar/MysqlGrammarTest.php b/tests/DataStorage/Database/Schema/Grammar/MysqlGrammarTest.php index bc1315f34..2b26c08ba 100755 --- a/tests/DataStorage/Database/Schema/Grammar/MysqlGrammarTest.php +++ b/tests/DataStorage/Database/Schema/Grammar/MysqlGrammarTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,10 +21,11 @@ use phpOMS\Utils\ArrayUtils; use phpOMS\Utils\TestUtils; /** - * @testdox phpOMS\tests\DataStorage\Database\Schema\Grammar\MysqlGrammarTest: Mysql sql schema grammar - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Schema\Grammar\MysqlGrammar::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Schema\Builder::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Database\Schema\Grammar\MysqlGrammarTest: Mysql sql schema grammar')] final class MysqlGrammarTest extends \PHPUnit\Framework\TestCase { protected MysqlConnection $con; @@ -38,11 +39,8 @@ final class MysqlGrammarTest extends \PHPUnit\Framework\TestCase $this->con->connect(); } - /** - * @testdox The grammar has the expected default values after initialization - * @covers phpOMS\DataStorage\Database\Schema\Grammar\MysqlGrammar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The grammar has the expected default values after initialization')] public function testDefault() : void { self::assertInstanceOf('\phpOMS\DataStorage\Database\Schema\Grammar\Grammar', new MysqlGrammar()); @@ -50,12 +48,8 @@ final class MysqlGrammarTest extends \PHPUnit\Framework\TestCase self::assertEquals('`', TestUtils::getMember(new MysqlGrammar(), 'systemIdentifierEnd')); } - /** - * @testdox The the grammar correctly creates and returns a database table - * @covers phpOMS\DataStorage\Database\Schema\Builder - * @covers phpOMS\DataStorage\Database\Schema\Grammar\MysqlGrammar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The the grammar correctly creates and returns a database table')] public function testSchemaInputOutput() : void { $definitions = \json_decode(\file_get_contents(__DIR__ . '/testSchema.json'), true); @@ -84,11 +78,8 @@ final class MysqlGrammarTest extends \PHPUnit\Framework\TestCase ->execute(); } - /** - * @testdox The grammar correctly deletes a table - * @covers phpOMS\DataStorage\Database\Schema\Grammar\MysqlGrammar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The grammar correctly deletes a table')] public function testDelete() : void { $definitions = \json_decode(\file_get_contents(__DIR__ . '/testSchema.json'), true); diff --git a/tests/DataStorage/Database/Schema/Grammar/OracleGrammarTest.php b/tests/DataStorage/Database/Schema/Grammar/OracleGrammarTest.php index faa3c0e43..de916c5e4 100755 --- a/tests/DataStorage/Database/Schema/Grammar/OracleGrammarTest.php +++ b/tests/DataStorage/Database/Schema/Grammar/OracleGrammarTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\DataStorage\Database\Schema\Grammar\OracleGrammar; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Schema\Grammar\OracleGrammar::class)] final class OracleGrammarTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\DataStorage\Database\Schema\Grammar\OracleGrammar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDefault() : void { self::assertInstanceOf('\phpOMS\DataStorage\Database\Schema\Grammar\Grammar', new OracleGrammar()); diff --git a/tests/DataStorage/Database/Schema/Grammar/PostgresGrammarTest.php b/tests/DataStorage/Database/Schema/Grammar/PostgresGrammarTest.php index c207ea5c2..e2ad6555d 100755 --- a/tests/DataStorage/Database/Schema/Grammar/PostgresGrammarTest.php +++ b/tests/DataStorage/Database/Schema/Grammar/PostgresGrammarTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\DataStorage\Database\Schema\Grammar\PostgresGrammar; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Schema\Grammar\PostgresGrammar::class)] final class PostgresGrammarTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\DataStorage\Database\Schema\Grammar\PostgresGrammar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDefault() : void { self::assertInstanceOf('\phpOMS\DataStorage\Database\Schema\Grammar\Grammar', new PostgresGrammar()); diff --git a/tests/DataStorage/Database/Schema/Grammar/SQLiteGrammarTest.php b/tests/DataStorage/Database/Schema/Grammar/SQLiteGrammarTest.php index ffbc34775..1e506144e 100755 --- a/tests/DataStorage/Database/Schema/Grammar/SQLiteGrammarTest.php +++ b/tests/DataStorage/Database/Schema/Grammar/SQLiteGrammarTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,16 +18,13 @@ use phpOMS\DataStorage\Database\Schema\Grammar\SQLiteGrammar; use phpOMS\Utils\TestUtils; /** - * @testdox phpOMS\tests\DataStorage\Database\Schema\Grammar\SQLiteGrammarTest: SQLite sql schema grammar - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Database\Schema\Grammar\SQLiteGrammarTest: SQLite sql schema grammar')] final class SQLiteGrammarTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The grammar has the expected default values after initialization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The grammar has the expected default values after initialization')] public function testDefault() : void { self::assertInstanceOf('\phpOMS\DataStorage\Database\Schema\Grammar\Grammar', new SQLiteGrammar()); diff --git a/tests/DataStorage/Database/Schema/Grammar/SqlServerGrammarTest.php b/tests/DataStorage/Database/Schema/Grammar/SqlServerGrammarTest.php index d24c02e44..76c369976 100755 --- a/tests/DataStorage/Database/Schema/Grammar/SqlServerGrammarTest.php +++ b/tests/DataStorage/Database/Schema/Grammar/SqlServerGrammarTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\DataStorage\Database\Schema\Grammar\SqlServerGrammar; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\Schema\Grammar\SqlServerGrammar::class)] final class SqlServerGrammarTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\DataStorage\Database\Schema\Grammar\SqlServerGrammar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDefault() : void { self::assertInstanceOf('\phpOMS\DataStorage\Database\Schema\Grammar\Grammar', new SqlServerGrammar()); diff --git a/tests/DataStorage/Database/Schema/QueryTypeTest.php b/tests/DataStorage/Database/Schema/QueryTypeTest.php index 6fe8dc7f7..aa1b15721 100755 --- a/tests/DataStorage/Database/Schema/QueryTypeTest.php +++ b/tests/DataStorage/Database/Schema/QueryTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\DataStorage\Database\Schema\QueryType; */ final class QueryTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(13, QueryType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(QueryType::getConstants(), \array_unique(QueryType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(128, QueryType::DROP_DATABASE); diff --git a/tests/DataStorage/Database/SchemaMapperTest.php b/tests/DataStorage/Database/SchemaMapperTest.php index 122970610..e7b8f0bc8 100755 --- a/tests/DataStorage/Database/SchemaMapperTest.php +++ b/tests/DataStorage/Database/SchemaMapperTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,10 @@ namespace phpOMS\tests\DataStorage\Database; use phpOMS\DataStorage\Database\SchemaMapper; /** - * @testdox phpOMS\tests\DataStorage\Database\SchemaMapperTest: Mapper for the database schema - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\Database\SchemaMapper::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Database\SchemaMapperTest: Mapper for the database schema')] final class SchemaMapperTest extends \PHPUnit\Framework\TestCase { protected function setUp() : void @@ -59,11 +59,8 @@ final class SchemaMapperTest extends \PHPUnit\Framework\TestCase $GLOBALS['dbpool']->get()->con->prepare('DROP TABLE test_belongs_to_one')->execute(); } - /** - * @testdox The tables can be returned - * @covers phpOMS\DataStorage\Database\SchemaMapper - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The tables can be returned')] public function testTables() : void { $schema = new SchemaMapper($GLOBALS['dbpool']->get()); @@ -72,11 +69,8 @@ final class SchemaMapperTest extends \PHPUnit\Framework\TestCase self::assertTrue(\in_array('test_belongs_to_one', $schema->getTables())); } - /** - * @testdox The fields of a table can be returned - * @covers phpOMS\DataStorage\Database\SchemaMapper - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The fields of a table can be returned')] public function testFields() : void { $schema = new SchemaMapper($GLOBALS['dbpool']->get()); diff --git a/tests/DataStorage/Database/TestModel/BaseModel.php b/tests/DataStorage/Database/TestModel/BaseModel.php index 7c6a6c117..893fcf71e 100755 --- a/tests/DataStorage/Database/TestModel/BaseModel.php +++ b/tests/DataStorage/Database/TestModel/BaseModel.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/BaseModelMapper.php b/tests/DataStorage/Database/TestModel/BaseModelMapper.php index 6809192b3..0718fba1b 100755 --- a/tests/DataStorage/Database/TestModel/BaseModelMapper.php +++ b/tests/DataStorage/Database/TestModel/BaseModelMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/BelongsToModel.php b/tests/DataStorage/Database/TestModel/BelongsToModel.php index 42b78b72b..fb078c97c 100755 --- a/tests/DataStorage/Database/TestModel/BelongsToModel.php +++ b/tests/DataStorage/Database/TestModel/BelongsToModel.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/BelongsToModelMapper.php b/tests/DataStorage/Database/TestModel/BelongsToModelMapper.php index b58748b0f..fe29e987c 100755 --- a/tests/DataStorage/Database/TestModel/BelongsToModelMapper.php +++ b/tests/DataStorage/Database/TestModel/BelongsToModelMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/BelongsToModelPrivateMapper.php b/tests/DataStorage/Database/TestModel/BelongsToModelPrivateMapper.php index 4ed89646e..d2ee3cb67 100644 --- a/tests/DataStorage/Database/TestModel/BelongsToModelPrivateMapper.php +++ b/tests/DataStorage/Database/TestModel/BelongsToModelPrivateMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/Conditional.php b/tests/DataStorage/Database/TestModel/Conditional.php index 9eb9f876d..ae8088bbd 100755 --- a/tests/DataStorage/Database/TestModel/Conditional.php +++ b/tests/DataStorage/Database/TestModel/Conditional.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/ConditionalMapper.php b/tests/DataStorage/Database/TestModel/ConditionalMapper.php index cb9adaafd..ad54ea951 100755 --- a/tests/DataStorage/Database/TestModel/ConditionalMapper.php +++ b/tests/DataStorage/Database/TestModel/ConditionalMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package Modules\Tag\Models * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/ManyToManyDirectModel.php b/tests/DataStorage/Database/TestModel/ManyToManyDirectModel.php index e6bf5f841..39603d844 100755 --- a/tests/DataStorage/Database/TestModel/ManyToManyDirectModel.php +++ b/tests/DataStorage/Database/TestModel/ManyToManyDirectModel.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/ManyToManyDirectModelMapper.php b/tests/DataStorage/Database/TestModel/ManyToManyDirectModelMapper.php index 0341707f4..877bd7733 100755 --- a/tests/DataStorage/Database/TestModel/ManyToManyDirectModelMapper.php +++ b/tests/DataStorage/Database/TestModel/ManyToManyDirectModelMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/ManyToManyDirectModelPrivateMapper.php b/tests/DataStorage/Database/TestModel/ManyToManyDirectModelPrivateMapper.php index e1de0fd8a..fd414cd4a 100644 --- a/tests/DataStorage/Database/TestModel/ManyToManyDirectModelPrivateMapper.php +++ b/tests/DataStorage/Database/TestModel/ManyToManyDirectModelPrivateMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/ManyToManyRelModel.php b/tests/DataStorage/Database/TestModel/ManyToManyRelModel.php index 292d6e05f..906a7fd83 100755 --- a/tests/DataStorage/Database/TestModel/ManyToManyRelModel.php +++ b/tests/DataStorage/Database/TestModel/ManyToManyRelModel.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/ManyToManyRelModelMapper.php b/tests/DataStorage/Database/TestModel/ManyToManyRelModelMapper.php index beaf3deb9..3e377d54e 100755 --- a/tests/DataStorage/Database/TestModel/ManyToManyRelModelMapper.php +++ b/tests/DataStorage/Database/TestModel/ManyToManyRelModelMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/ManyToManyRelModelPrivateMapper.php b/tests/DataStorage/Database/TestModel/ManyToManyRelModelPrivateMapper.php index e7df8b66d..4a33a6b01 100644 --- a/tests/DataStorage/Database/TestModel/ManyToManyRelModelPrivateMapper.php +++ b/tests/DataStorage/Database/TestModel/ManyToManyRelModelPrivateMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/NullBaseModel.php b/tests/DataStorage/Database/TestModel/NullBaseModel.php index ca41d294d..f40e89306 100755 --- a/tests/DataStorage/Database/TestModel/NullBaseModel.php +++ b/tests/DataStorage/Database/TestModel/NullBaseModel.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/NullBelongsToModel.php b/tests/DataStorage/Database/TestModel/NullBelongsToModel.php index bc3dd2120..0e3e74c99 100755 --- a/tests/DataStorage/Database/TestModel/NullBelongsToModel.php +++ b/tests/DataStorage/Database/TestModel/NullBelongsToModel.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/NullManyToManyDirectModel.php b/tests/DataStorage/Database/TestModel/NullManyToManyDirectModel.php index f4a978406..add914e5a 100755 --- a/tests/DataStorage/Database/TestModel/NullManyToManyDirectModel.php +++ b/tests/DataStorage/Database/TestModel/NullManyToManyDirectModel.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/NullManyToManyRelModel.php b/tests/DataStorage/Database/TestModel/NullManyToManyRelModel.php index 5ae478a54..6792e6411 100755 --- a/tests/DataStorage/Database/TestModel/NullManyToManyRelModel.php +++ b/tests/DataStorage/Database/TestModel/NullManyToManyRelModel.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/NullOwnsOneModel.php b/tests/DataStorage/Database/TestModel/NullOwnsOneModel.php index c9108503e..5fd847421 100755 --- a/tests/DataStorage/Database/TestModel/NullOwnsOneModel.php +++ b/tests/DataStorage/Database/TestModel/NullOwnsOneModel.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/OwnsOneModel.php b/tests/DataStorage/Database/TestModel/OwnsOneModel.php index 667f6d0d1..d168976f3 100755 --- a/tests/DataStorage/Database/TestModel/OwnsOneModel.php +++ b/tests/DataStorage/Database/TestModel/OwnsOneModel.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/OwnsOneModelMapper.php b/tests/DataStorage/Database/TestModel/OwnsOneModelMapper.php index 51e97d290..8dea68eda 100755 --- a/tests/DataStorage/Database/TestModel/OwnsOneModelMapper.php +++ b/tests/DataStorage/Database/TestModel/OwnsOneModelMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/Database/TestModel/OwnsOneModelPrivateMapper.php b/tests/DataStorage/Database/TestModel/OwnsOneModelPrivateMapper.php index 08511b3aa..abcf4a8d9 100644 --- a/tests/DataStorage/Database/TestModel/OwnsOneModelPrivateMapper.php +++ b/tests/DataStorage/Database/TestModel/OwnsOneModelPrivateMapper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/DataStorage/LockExceptionTest.php b/tests/DataStorage/LockExceptionTest.php index af06036b1..9410246c7 100755 --- a/tests/DataStorage/LockExceptionTest.php +++ b/tests/DataStorage/LockExceptionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\DataStorage\LockException; /** - * @testdox phpOMS\tests\DataStorage\LockExceptionTest: Lock exception * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\DataStorage\LockException::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\LockExceptionTest: Lock exception')] final class LockExceptionTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The lock exception is an instance of the runtime exception - * @covers phpOMS\DataStorage\LockException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The lock exception is an instance of the runtime exception')] public function testException() : void { self::assertInstanceOf(\RuntimeException::class, new LockException('')); diff --git a/tests/DataStorage/Session/HttpSessionTest.php b/tests/DataStorage/Session/HttpSessionTest.php index c80a7f910..98a8b844a 100755 --- a/tests/DataStorage/Session/HttpSessionTest.php +++ b/tests/DataStorage/Session/HttpSessionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,9 @@ namespace phpOMS\tests\DataStorage\Session; use phpOMS\DataStorage\Session\HttpSession; /** - * @testdox phpOMS\tests\DataStorage\Session\HttpSessionTest: Session data handler for http sessions - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\DataStorage\Session\HttpSessionTest: Session data handler for http sessions')] final class HttpSessionTest extends \PHPUnit\Framework\TestCase { protected HttpSession $session; @@ -33,10 +32,8 @@ final class HttpSessionTest extends \PHPUnit\Framework\TestCase $this->session = new HttpSession(1, '', 1); } - /** - * @testdox The session has the expected default values after initialization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The session has the expected default values after initialization')] public function testDefault() : void { $session = new HttpSession(); @@ -44,20 +41,16 @@ final class HttpSessionTest extends \PHPUnit\Framework\TestCase self::assertFalse($session->isLocked()); } - /** - * @testdox Session data can be set and returned - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Session data can be set and returned')] public function testInputOutput() : void { self::assertTrue($this->session->set('test', 'value')); self::assertEquals('value', $this->session->get('test')); } - /** - * @testdox Session data cannot be overwritten - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Session data cannot be overwritten')] public function testInvalidOverwrite() : void { $this->session->set('test', 'value'); @@ -65,10 +58,8 @@ final class HttpSessionTest extends \PHPUnit\Framework\TestCase self::assertEquals('value', $this->session->get('test')); } - /** - * @testdox Session data can be forced to overwrite - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Session data can be forced to overwrite')] public function testOverwrite() : void { $this->session->set('test', 'value'); @@ -76,20 +67,16 @@ final class HttpSessionTest extends \PHPUnit\Framework\TestCase self::assertEquals('value2', $this->session->get('test')); } - /** - * @testdox Session data can be removed - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Session data can be removed')] public function testRemove() : void { $this->session->set('test', 'value'); self::assertTrue($this->session->remove('test')); } - /** - * @testdox None-existing session data cannot be removed - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('None-existing session data cannot be removed')] public function testInvalidRemove() : void { $this->session->set('test', 'value'); @@ -98,50 +85,40 @@ final class HttpSessionTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->session->remove('test')); } - /** - * @testdox A session id can be set and returned - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A session id can be set and returned')] public function testSessionIdInputOutput() : void { $this->session->setSID('abc'); self::assertEquals('abc', $this->session->getSID()); } - /** - * @testdox A session can be locked - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A session can be locked')] public function testLockInputOutput() : void { $this->session->lock(); self::assertTrue($this->session->isLocked()); } - /** - * @testdox Locked sessions cannot be saved - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Locked sessions cannot be saved')] public function testInvalidLockSave() : void { $this->session->lock(); self::assertFalse($this->session->save()); } - /** - * @testdox A locked session cannot add or change data - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A locked session cannot add or change data')] public function testLockInvalidSet() : void { $this->session->lock(); self::assertFalse($this->session->set('test', 'value')); } - /** - * @testdox A locked session cannot remove data - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A locked session cannot remove data')] public function testLockInvalidRemove() : void { self::assertTrue($this->session->set('test', 'value')); diff --git a/tests/Dispatcher/DispatcherTest.php b/tests/Dispatcher/DispatcherTest.php index 2af67ec07..2ccd322e8 100755 --- a/tests/Dispatcher/DispatcherTest.php +++ b/tests/Dispatcher/DispatcherTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -26,10 +26,10 @@ use phpOMS\Uri\HttpUri; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Dispatcher\DispatcherTest: Dispatcher for executing request endpoints - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Dispatcher\Dispatcher::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Dispatcher\DispatcherTest: Dispatcher for executing request endpoints')] final class DispatcherTest extends \PHPUnit\Framework\TestCase { protected ApplicationAbstract $app; @@ -47,18 +47,15 @@ final class DispatcherTest extends \PHPUnit\Framework\TestCase $this->app->dispatcher = new Dispatcher($this->app); } - /** - * @testdox A route can be added and dispatched - * @covers phpOMS\Dispatcher\Dispatcher - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A route can be added and dispatched')] public function testControllerInputOutput() : void { - $this->app->dispatcher->set(new class() extends ModuleAbstract { + $this->app->dispatcher->controllers['test'] = new class() extends ModuleAbstract { public string $name = 'test'; public function testFunction() { return $this->name; } - }, 'test'); + }; $localization = new Localization(); @@ -73,11 +70,8 @@ final class DispatcherTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The dispatcher can dispatch a function/closure - * @covers phpOMS\Dispatcher\Dispatcher - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The dispatcher can dispatch a function/closure')] public function testClosure() : void { $localization = new Localization(); @@ -101,11 +95,8 @@ final class DispatcherTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The dispatcher can dispatch a method as string representation of a controller - * @covers phpOMS\Dispatcher\Dispatcher - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The dispatcher can dispatch a method as string representation of a controller')] public function testPathMethod() : void { $localization = new Localization(); @@ -121,11 +112,8 @@ final class DispatcherTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The dispatcher can dispatch a method as array representation of a controller - * @covers phpOMS\Dispatcher\Dispatcher - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The dispatcher can dispatch a method as array representation of a controller')] public function testPathMethodInArray() : void { $localization = new Localization(); @@ -149,11 +137,8 @@ final class DispatcherTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The dispatcher can dispatch a static method as string representation - * @covers phpOMS\Dispatcher\Dispatcher - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The dispatcher can dispatch a static method as string representation')] public function testPathStatic() : void { $localization = new Localization(); @@ -169,11 +154,8 @@ final class DispatcherTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The dispatcher can dispatch multiple destinations after another - * @covers phpOMS\Dispatcher\Dispatcher - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The dispatcher can dispatch multiple destinations after another')] public function testArray() : void { $localization = new Localization(); @@ -193,11 +175,8 @@ final class DispatcherTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The dispatcher can pass additional data to the destination - * @covers phpOMS\Dispatcher\Dispatcher - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The dispatcher can pass additional data to the destination')] public function testArrayWithData() : void { $localization = new Localization(); @@ -214,39 +193,21 @@ final class DispatcherTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A invalid controller path throws a PathException - * @covers phpOMS\Dispatcher\Dispatcher - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid controller path throws a PathException')] public function testInvalidControllerPath() : void { - $this->expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\Error::class); $this->app->dispatcher->dispatch('phpOMS\tests\Dispatcher\TestControllers::testFunctionStatic'); } - /** - * @testdox A invalid function path throws a Exception - * @covers phpOMS\Dispatcher\Dispatcher - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid function path throws a Exception')] public function testInvalidControllerFunction() : void { - $this->expectException(\Exception::class); + $this->expectException(\Error::class); $this->app->dispatcher->dispatch('phpOMS\tests\Dispatcher\TestController::testFunctionStaticINVALID'); } - - /** - * @testdox A malformed dispatch path throws UnexpectedValueException - * @covers phpOMS\Dispatcher\Dispatcher - * @group framework - */ - public function testInvalidControllerString() : void - { - $this->expectException(\UnexpectedValueException::class); - - $this->app->dispatcher->dispatch('phpOMS\tests\Dispatcher\TestController::testFunctionStatic:failure'); - } } diff --git a/tests/Dispatcher/TestController.php b/tests/Dispatcher/TestController.php index 96badf149..508151205 100755 --- a/tests/Dispatcher/TestController.php +++ b/tests/Dispatcher/TestController.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Event/EventManagerTest.php b/tests/Event/EventManagerTest.php index 2b71fca2b..72b5755b7 100755 --- a/tests/Event/EventManagerTest.php +++ b/tests/Event/EventManagerTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,10 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Event\EventManager; /** - * @testdox phpOMS\tests\Event\EventManager: Event manager for managing and executing events - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Event\EventManager::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Event\EventManager: Event manager for managing and executing events')] final class EventManagerTest extends \PHPUnit\Framework\TestCase { protected EventManager $event; @@ -35,32 +35,23 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase $this->event = new EventManager(); } - /** - * @testdox The event manager has the expected default values after initialization - * @covers phpOMS\Event\EventManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The event manager has the expected default values after initialization')] public function testDefault() : void { self::assertEquals(0, $this->event->count()); } - /** - * @testdox New events can be added - * @covers phpOMS\Event\EventManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('New events can be added')] public function testAdd() : void { self::assertTrue($this->event->attach('group', function() : bool { return true; }, false, false)); self::assertEquals(1, $this->event->count()); } - /** - * @testdox Events can be cleared - * @covers phpOMS\Event\EventManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Events can be cleared')] public function testClear() : void { self::assertTrue($this->event->attach('group', function() : bool { return true; }, false, false)); @@ -70,11 +61,8 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase self::assertEquals(0, $this->event->count()); } - /** - * @testdox Multiple callbacks can be added to an event - * @covers phpOMS\Event\EventManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Multiple callbacks can be added to an event')] public function testAddMultiple() : void { self::assertTrue($this->event->attach('group', function() : bool { return true; }, false, false)); @@ -82,11 +70,8 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase self::assertEquals(1, $this->event->count()); } - /** - * @testdox An event gets executed if all conditions and sub conditions are met - * @covers phpOMS\Event\EventManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An event gets executed if all conditions and sub conditions are met')] public function testDispatchAfterAllConditions() : void { $this->event->attach('group', 'path_to_execute', false, true); @@ -97,11 +82,8 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->event->trigger('group', 'id2')); } - /** - * @testdox An event doesn't get executed if not all conditions and sub conditions are met - * @covers phpOMS\Event\EventManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("An event doesn't get executed if not all conditions and sub conditions are met")] public function testDispatchAfterSomeConditionsInvalid() : void { $this->event->attach('group', 'path_to_execute', false, true); @@ -111,21 +93,15 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->event->trigger('group', 'id1')); } - /** - * @testdox None-existing events cannot be executed/triggered - * @covers phpOMS\Event\EventManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('None-existing events cannot be executed/triggered')] public function testInvalidEventTrigger() : void { self::assertFalse($this->event->trigger('invalid')); } - /** - * @testdox An event can be triggered with group and id regex matches - * @covers phpOMS\Event\EventManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An event can be triggered with group and id regex matches')] public function testDispatchSimilarGroupAndId() : void { $this->event->attach('group', 'path_to_execute', false, true); @@ -135,11 +111,8 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->event->triggerSimilar('/[a-z]+/', '/id\\d/')); } - /** - * @testdox An event can be triggered with a fixed group definition and id regex matches - * @covers phpOMS\Event\EventManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An event can be triggered with a fixed group definition and id regex matches')] public function testDispatchSimilarId() : void { $this->event->attach('group', 'path_to_execute', false, true); @@ -149,11 +122,8 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->event->triggerSimilar('group', '/id\\d/')); } - /** - * @testdox An event can be triggered with regex group matches and fixed id definition - * @covers phpOMS\Event\EventManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An event can be triggered with regex group matches and fixed id definition')] public function testDispatchSimilarGroup() : void { $this->event->attach('group', 'path_to_execute', false, true); @@ -164,11 +134,8 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->event->triggerSimilar('group', 'id2')); } - /** - * @testdox A invalid regex match will not triggered an event - * @covers phpOMS\Event\EventManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid regex match will not triggered an event')] public function testDispatchSimilarInvalid() : void { $this->event->attach('group', 'path_to_execute', false, true); @@ -178,11 +145,8 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->event->triggerSimilar('group', '/id\\d0/')); } - /** - * @testdox An event can be defined to reset after all conditions and subconditions are met. Then all conditions and sub conditions must be met again before it gets triggered again. - * @covers phpOMS\Event\EventManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An event can be defined to reset after all conditions and subconditions are met. Then all conditions and sub conditions must be met again before it gets triggered again.')] public function testReset() : void { self::assertTrue($this->event->attach('group', function() : bool { return true; }, false, true)); @@ -194,11 +158,8 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->event->trigger('group', 'id2')); } - /** - * @testdox An event can be defined to not reset after all conditions and subconditions are met. Then an event can be triggered any time. - * @covers phpOMS\Event\EventManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An event can be defined to not reset after all conditions and subconditions are met. Then an event can be triggered any time.')] public function testNoReset() : void { self::assertTrue($this->event->attach('group', function() : bool { return true; }, false, false)); @@ -210,11 +171,8 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->event->trigger('group', 'id2')); } - /** - * @testdox An event can be manually removed/detached - * @covers phpOMS\Event\EventManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An event can be manually removed/detached')] public function testDetach() : void { $this->event->attach('group', function() : bool { return true; }, false, true); @@ -227,11 +185,8 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->event->trigger('group')); } - /** - * @testdox None-existing events cannot be manually removed/detached - * @covers phpOMS\Event\EventManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('None-existing events cannot be manually removed/detached')] public function testInvalidDetach() : void { $this->event->attach('group', function() : bool { return true; }, false, true); @@ -242,11 +197,8 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->event->detach('group')); } - /** - * @testdox An event can be defined to automatically remove itself after all conditions and subconditions are met and it is executed - * @covers phpOMS\Event\EventManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An event can be defined to automatically remove itself after all conditions and subconditions are met and it is executed')] public function testRemove() : void { self::assertTrue($this->event->attach('group1', function() : bool { return true; }, true, false)); @@ -257,11 +209,8 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase self::assertEquals(1, $this->event->count()); } - /** - * @testdox Events can be imported from a file - * @covers phpOMS\Event\EventManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Events can be imported from a file')] public function testImportEvents() : void { self::assertTrue($this->event->importFromFile(__DIR__ . '/events.php')); @@ -271,11 +220,8 @@ final class EventManagerTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->event->trigger('SomeName2', '', 4)); } - /** - * @testdox Invalid event files cannot be imported and return a failure - * @covers phpOMS\Event\EventManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid event files cannot be imported and return a failure')] public function testInvalidImportEvents() : void { self::assertFalse($this->event->importFromFile(__DIR__ . '/invalid.php')); diff --git a/tests/ExtensionTest.php b/tests/ExtensionTest.php index 297bcda22..1de468d2e 100755 --- a/tests/ExtensionTest.php +++ b/tests/ExtensionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Image/KernelTest.php b/tests/Image/KernelTest.php index 4bb5dcbfb..5c9e972a1 100755 --- a/tests/Image/KernelTest.php +++ b/tests/Image/KernelTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,15 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Image\Kernel; /** - * @testdox phpOMS\tests\Image\KernelTest: Image kernel * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Image\Kernel::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Image\KernelTest: Image kernel')] final class KernelTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The kernel can be applied to an image which is then stored in a new file - * @group framework - * @group slow - * @covers phpOMS\Image\Kernel - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\Group('slow')] + #[\PHPUnit\Framework\Attributes\TestDox('The kernel can be applied to an image which is then stored in a new file')] public function testKernel() : void { Kernel::convolve(__DIR__ . '/img1.png', __DIR__ . '/test_img1_sharpen.png', Kernel::KERNEL_SHARPEN); diff --git a/tests/Image/SkewTest.php b/tests/Image/SkewTest.php index 6fde54bd1..3dd9b8d06 100755 --- a/tests/Image/SkewTest.php +++ b/tests/Image/SkewTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,15 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Image\Skew; /** - * @testdox phpOMS\tests\Image\SkewTest: Image skew * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Image\Skew::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Image\SkewTest: Image skew')] final class SkewTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A image can be automatically unskewed - * @group framework - * @group slow - * @covers phpOMS\Image\Skew - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\Group('slow')] + #[\PHPUnit\Framework\Attributes\TestDox('A image can be automatically unskewed')] public function testSkew() : void { Skew::autoRotate( diff --git a/tests/Image/ThresholdingTest.php b/tests/Image/ThresholdingTest.php index 3768a89ba..769a7c79a 100755 --- a/tests/Image/ThresholdingTest.php +++ b/tests/Image/ThresholdingTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Image\Thresholding; /** - * @testdox phpOMS\tests\Image\ThresholdingTest: Image thresholding * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Image\Thresholding::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Image\ThresholdingTest: Image thresholding')] final class ThresholdingTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The thresholding is correctly applied to the image - * @group framework - * @covers phpOMS\Image\Thresholding - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The thresholding is correctly applied to the image')] public function testThresholding() : void { Thresholding::integralThresholding(__DIR__ . '/img1.png', __DIR__ . '/test_img1_integral_thresholding.png'); diff --git a/tests/Localization/Defaults/CityMapperTest.php b/tests/Localization/Defaults/CityMapperTest.php index cf9cb420d..f9a83cf22 100755 --- a/tests/Localization/Defaults/CityMapperTest.php +++ b/tests/Localization/Defaults/CityMapperTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -22,10 +22,10 @@ use phpOMS\Localization\Defaults\City; use phpOMS\Localization\Defaults\CityMapper; /** - * @testdox phpOMS\tests\Localization\Defaults\CityMapperTest: City database mapper - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Localization\Defaults\CityMapper::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\Defaults\CityMapperTest: City database mapper')] final class CityMapperTest extends \PHPUnit\Framework\TestCase { private static SQLiteConnection $con; @@ -42,11 +42,8 @@ final class CityMapperTest extends \PHPUnit\Framework\TestCase DataMapperFactory::db(self::$con); } - /** - * @testdox The model can be read from the database - * @covers phpOMS\Localization\Defaults\CityMapper - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The model can be read from the database')] public function testR() : void { /** @var City $obj */ diff --git a/tests/Localization/Defaults/CityTest.php b/tests/Localization/Defaults/CityTest.php index 8f286f259..cc1ba7d3b 100755 --- a/tests/Localization/Defaults/CityTest.php +++ b/tests/Localization/Defaults/CityTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ require_once __DIR__ . '/../../Autoloader.php'; use phpOMS\Localization\Defaults\City; /** - * @testdox phpOMS\tests\Localization\Defaults\CityTest: City database model - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Localization\Defaults\City::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\Defaults\CityTest: City database model')] final class CityTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The model has the expected member variables and default values - * @covers phpOMS\Localization\Defaults\City - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The model has the expected member variables and default values')] public function testDefaults() : void { $obj = new City(); diff --git a/tests/Localization/Defaults/CountryMapperTest.php b/tests/Localization/Defaults/CountryMapperTest.php index 9ea15f43f..ddc3555e2 100755 --- a/tests/Localization/Defaults/CountryMapperTest.php +++ b/tests/Localization/Defaults/CountryMapperTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -22,10 +22,10 @@ use phpOMS\Localization\Defaults\Country; use phpOMS\Localization\Defaults\CountryMapper; /** - * @testdox phpOMS\tests\Localization\Defaults\CountryMapperTest: Country database mapper - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Localization\Defaults\CountryMapper::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\Defaults\CountryMapperTest: Country database mapper')] final class CountryMapperTest extends \PHPUnit\Framework\TestCase { private static SQLiteConnection $con; @@ -42,11 +42,8 @@ final class CountryMapperTest extends \PHPUnit\Framework\TestCase DataMapperFactory::db(self::$con); } - /** - * @testdox The model can be read from the database - * @covers phpOMS\Localization\Defaults\CountryMapper - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The model can be read from the database')] public function testR() : void { /** @var Country $obj */ diff --git a/tests/Localization/Defaults/CountryTest.php b/tests/Localization/Defaults/CountryTest.php index ee5c76381..5db5ee208 100755 --- a/tests/Localization/Defaults/CountryTest.php +++ b/tests/Localization/Defaults/CountryTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ require_once __DIR__ . '/../../Autoloader.php'; use phpOMS\Localization\Defaults\Country; /** - * @testdox phpOMS\tests\Localization\Defaults\CountryTest: Country database model - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Localization\Defaults\Country::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\Defaults\CountryTest: Country database model')] final class CountryTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The model has the expected member variables and default values - * @covers phpOMS\Localization\Defaults\Country - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The model has the expected member variables and default values')] public function testDefaults() : void { $obj = new Country(); diff --git a/tests/Localization/Defaults/CurrencyMapperTest.php b/tests/Localization/Defaults/CurrencyMapperTest.php index 6c576276c..d9b2cd357 100755 --- a/tests/Localization/Defaults/CurrencyMapperTest.php +++ b/tests/Localization/Defaults/CurrencyMapperTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -22,10 +22,10 @@ use phpOMS\Localization\Defaults\Currency; use phpOMS\Localization\Defaults\CurrencyMapper; /** - * @testdox phpOMS\tests\Localization\Defaults\CurrencyMapperTest: Currency database mapper - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Localization\Defaults\CurrencyMapper::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\Defaults\CurrencyMapperTest: Currency database mapper')] final class CurrencyMapperTest extends \PHPUnit\Framework\TestCase { private static SQLiteConnection $con; @@ -42,11 +42,8 @@ final class CurrencyMapperTest extends \PHPUnit\Framework\TestCase DataMapperFactory::db(self::$con); } - /** - * @testdox The model can be read from the database - * @covers phpOMS\Localization\Defaults\CurrencyMapper - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The model can be read from the database')] public function testR() : void { /** @var Currency $obj */ diff --git a/tests/Localization/Defaults/CurrencyTest.php b/tests/Localization/Defaults/CurrencyTest.php index 98475351c..18d88f415 100755 --- a/tests/Localization/Defaults/CurrencyTest.php +++ b/tests/Localization/Defaults/CurrencyTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ require_once __DIR__ . '/../../Autoloader.php'; use phpOMS\Localization\Defaults\Currency; /** - * @testdox phpOMS\tests\Localization\Defaults\CurrencyTest: Currency database model - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Localization\Defaults\Currency::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\Defaults\CurrencyTest: Currency database model')] final class CurrencyTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The model has the expected member variables and default values - * @covers phpOMS\Localization\Defaults\Currency - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The model has the expected member variables and default values')] public function testDefaults() : void { $obj = new Currency(); diff --git a/tests/Localization/Defaults/IbanMapperTest.php b/tests/Localization/Defaults/IbanMapperTest.php index f4dcecd3b..d093ca67f 100755 --- a/tests/Localization/Defaults/IbanMapperTest.php +++ b/tests/Localization/Defaults/IbanMapperTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -22,10 +22,10 @@ use phpOMS\Localization\Defaults\Iban; use phpOMS\Localization\Defaults\IbanMapper; /** - * @testdox phpOMS\tests\Localization\Defaults\IbanMapperTest: Iban database mapper - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Localization\Defaults\IbanMapper::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\Defaults\IbanMapperTest: Iban database mapper')] final class IbanMapperTest extends \PHPUnit\Framework\TestCase { private static SQLiteConnection $con; @@ -42,11 +42,8 @@ final class IbanMapperTest extends \PHPUnit\Framework\TestCase DataMapperFactory::db(self::$con); } - /** - * @testdox The model can be read from the database - * @covers phpOMS\Localization\Defaults\IbanMapper - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The model can be read from the database')] public function testR() : void { /** @var Iban $obj */ diff --git a/tests/Localization/Defaults/IbanTest.php b/tests/Localization/Defaults/IbanTest.php index bbf92365f..62f497e29 100755 --- a/tests/Localization/Defaults/IbanTest.php +++ b/tests/Localization/Defaults/IbanTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ require_once __DIR__ . '/../../Autoloader.php'; use phpOMS\Localization\Defaults\Iban; /** - * @testdox phpOMS\tests\Localization\Defaults\IbanTest: Iban database model - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Localization\Defaults\Iban::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\Defaults\IbanTest: Iban database model')] final class IbanTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The model has the expected member variables and default values - * @covers phpOMS\Localization\Defaults\Iban - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The model has the expected member variables and default values')] public function testDefaults() : void { $obj = new Iban(); diff --git a/tests/Localization/Defaults/LanguageMapperTest.php b/tests/Localization/Defaults/LanguageMapperTest.php index fd96411f2..a8ccd8c69 100755 --- a/tests/Localization/Defaults/LanguageMapperTest.php +++ b/tests/Localization/Defaults/LanguageMapperTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -22,10 +22,10 @@ use phpOMS\Localization\Defaults\Language; use phpOMS\Localization\Defaults\LanguageMapper; /** - * @testdox phpOMS\tests\Localization\Defaults\LanguageMapperTest: Language database mapper - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Localization\Defaults\LanguageMapper::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\Defaults\LanguageMapperTest: Language database mapper')] final class LanguageMapperTest extends \PHPUnit\Framework\TestCase { private static SQLiteConnection $con; @@ -42,11 +42,8 @@ final class LanguageMapperTest extends \PHPUnit\Framework\TestCase DataMapperFactory::db(self::$con); } - /** - * @testdox The model can be read from the database - * @covers phpOMS\Localization\Defaults\LanguageMapper - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The model can be read from the database')] public function testR() : void { /** @var Language $obj */ diff --git a/tests/Localization/Defaults/LanguageTest.php b/tests/Localization/Defaults/LanguageTest.php index bfafe2464..5487a7da9 100755 --- a/tests/Localization/Defaults/LanguageTest.php +++ b/tests/Localization/Defaults/LanguageTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ require_once __DIR__ . '/../../Autoloader.php'; use phpOMS\Localization\Defaults\Language; /** - * @testdox phpOMS\tests\Localization\Defaults\LanguageTest: Language database model - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Localization\Defaults\Language::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\Defaults\LanguageTest: Language database model')] final class LanguageTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The model has the expected member variables and default values - * @covers phpOMS\Localization\Defaults\Language - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The model has the expected member variables and default values')] public function testDefaults() : void { $obj = new Language(); diff --git a/tests/Localization/ISO3166CharEnumTest.php b/tests/Localization/ISO3166CharEnumTest.php index 460fd2a39..0aeac3d99 100755 --- a/tests/Localization/ISO3166CharEnumTest.php +++ b/tests/Localization/ISO3166CharEnumTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Localization\ISO3166CharEnum; /** - * @testdox phpOMS\tests\Localization\ISO3166CharEnumTest: ISO 3166 country codes * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\ISO3166CharEnumTest: ISO 3166 country codes')] final class ISO3166CharEnumTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The ISO 3166 country code enum has the correct format of country codes - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 3166 country code enum has the correct format of country codes')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { $ok = true; @@ -45,11 +43,9 @@ final class ISO3166CharEnumTest extends \PHPUnit\Framework\TestCase self::assertTrue($ok); } - /** - * @testdox The ISO 3166 enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 3166 enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(ISO3166CharEnum::getConstants(), \array_unique(ISO3166CharEnum::getConstants())); diff --git a/tests/Localization/ISO3166NameEnumTest.php b/tests/Localization/ISO3166NameEnumTest.php index 1c440a9d4..7314d5454 100755 --- a/tests/Localization/ISO3166NameEnumTest.php +++ b/tests/Localization/ISO3166NameEnumTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Localization\ISO3166NameEnum; /** - * @testdox phpOMS\tests\Localization\ISO3166NameEnumTest: ISO 3166 country names * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\ISO3166NameEnumTest: ISO 3166 country names')] final class ISO3166NameEnumTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The ISO 3166 enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 3166 enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { $enum = ISO3166NameEnum::getConstants(); diff --git a/tests/Localization/ISO3166NumEnumTest.php b/tests/Localization/ISO3166NumEnumTest.php index 936ca240d..11bc8d134 100755 --- a/tests/Localization/ISO3166NumEnumTest.php +++ b/tests/Localization/ISO3166NumEnumTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Localization\ISO3166NumEnum; /** - * @testdox phpOMS\tests\Localization\ISO3166NumEnumTest: ISO 3166 country codes * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\ISO3166NumEnumTest: ISO 3166 country codes')] final class ISO3166NumEnumTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The ISO 3166 country code enum has the correct format of country codes - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 3166 country code enum has the correct format of country codes')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { $ok = true; diff --git a/tests/Localization/ISO3166TwoEnumTest.php b/tests/Localization/ISO3166TwoEnumTest.php index bf39d9010..2f1cb8198 100755 --- a/tests/Localization/ISO3166TwoEnumTest.php +++ b/tests/Localization/ISO3166TwoEnumTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Localization\ISO3166TwoEnum; /** - * @testdox phpOMS\tests\Localization\ISO3166NumEnumTest: ISO 3166 country codes * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\ISO3166NumEnumTest: ISO 3166 country codes')] final class ISO3166TwoEnumTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The ISO 3166 country code enum has the correct format of country codes - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 3166 country code enum has the correct format of country codes')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { $ok = true; @@ -45,11 +43,9 @@ final class ISO3166TwoEnumTest extends \PHPUnit\Framework\TestCase self::assertTrue($ok); } - /** - * @testdox The ISO 3166 enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 3166 enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(ISO3166TwoEnum::getConstants(), \array_unique(ISO3166TwoEnum::getConstants())); diff --git a/tests/Localization/ISO4217CharEnumTest.php b/tests/Localization/ISO4217CharEnumTest.php index 7f2bb702c..e2dc4ecf8 100755 --- a/tests/Localization/ISO4217CharEnumTest.php +++ b/tests/Localization/ISO4217CharEnumTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Localization\ISO4217CharEnum; /** - * @testdox phpOMS\tests\Localization\ISO4217CharEnumTest: ISO 4217 currency codes * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\ISO4217CharEnumTest: ISO 4217 currency codes')] final class ISO4217CharEnumTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The ISO 4217 currency code enum has the correct format of currency codes - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 4217 currency code enum has the correct format of currency codes')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { $ok = true; @@ -45,11 +43,9 @@ final class ISO4217CharEnumTest extends \PHPUnit\Framework\TestCase self::assertTrue($ok); } - /** - * @testdox The ISO 4217 enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 4217 enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(ISO4217CharEnum::getConstants(), \array_unique(ISO4217CharEnum::getConstants())); diff --git a/tests/Localization/ISO4217DecimalEnumTest.php b/tests/Localization/ISO4217DecimalEnumTest.php index 8e305c8c8..10bb312d2 100755 --- a/tests/Localization/ISO4217DecimalEnumTest.php +++ b/tests/Localization/ISO4217DecimalEnumTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Localization\ISO4217DecimalEnum; /** - * @testdox phpOMS\tests\Localization\ISO4217DecimalEnumTest: ISO 4217 currency codes * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\ISO4217DecimalEnumTest: ISO 4217 currency codes')] final class ISO4217DecimalEnumTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The ISO 4217 currency code enum has the correct format of currency decimal places - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 4217 currency code enum has the correct format of currency decimal places')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { $ok = true; diff --git a/tests/Localization/ISO4217EnumTest.php b/tests/Localization/ISO4217EnumTest.php index 8640e5f04..10a24b971 100755 --- a/tests/Localization/ISO4217EnumTest.php +++ b/tests/Localization/ISO4217EnumTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Localization\ISO4217Enum; /** - * @testdox phpOMS\tests\Localization\ISO4217EnumTest: ISO 4217 currency codes * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\ISO4217EnumTest: ISO 4217 currency codes')] final class ISO4217EnumTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The ISO 4217 currency code enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 4217 currency code enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { $enum = ISO4217Enum::getConstants(); diff --git a/tests/Localization/ISO4217NumEnumTest.php b/tests/Localization/ISO4217NumEnumTest.php index 27c929d7b..8868d1755 100755 --- a/tests/Localization/ISO4217NumEnumTest.php +++ b/tests/Localization/ISO4217NumEnumTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Localization\ISO4217NumEnum; /** - * @testdox phpOMS\tests\Localization\ISO4217NumEnumTest: ISO 4217 currency codes * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\ISO4217NumEnumTest: ISO 4217 currency codes')] final class ISO4217NumEnumTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The ISO 4217 currency code enum has the correct format of currency codes - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 4217 currency code enum has the correct format of currency codes')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { $ok = true; diff --git a/tests/Localization/ISO4217SubUnitEnumTest.php b/tests/Localization/ISO4217SubUnitEnumTest.php index ba0b92e1a..5bb3482bd 100755 --- a/tests/Localization/ISO4217SubUnitEnumTest.php +++ b/tests/Localization/ISO4217SubUnitEnumTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Localization\ISO4217SubUnitEnum; /** - * @testdox phpOMS\tests\Localization\ISO4217SubUnitEnumTest: ISO 4217 currency codes * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\ISO4217SubUnitEnumTest: ISO 4217 currency codes')] final class ISO4217SubUnitEnumTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The ISO 4217 currency code enum has the correct format of currency sub units - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 4217 currency code enum has the correct format of currency sub units')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { $ok = true; diff --git a/tests/Localization/ISO4217SymbolEnumTest.php b/tests/Localization/ISO4217SymbolEnumTest.php index 686842983..0c8e1974a 100755 --- a/tests/Localization/ISO4217SymbolEnumTest.php +++ b/tests/Localization/ISO4217SymbolEnumTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Localization\ISO4217SymbolEnum; /** - * @testdox phpOMS\tests\Localization\ISO4217SymbolEnumTest: ISO 4217 currency codes * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\ISO4217SymbolEnumTest: ISO 4217 currency codes')] final class ISO4217SymbolEnumTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The ISO 4217 currency code enum has the correct number of currency symbols - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 4217 currency code enum has the correct number of currency symbols')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { $enum = ISO4217SymbolEnum::getConstants(); diff --git a/tests/Localization/ISO639EnumTest.php b/tests/Localization/ISO639EnumTest.php index e08def3ed..7a3384613 100755 --- a/tests/Localization/ISO639EnumTest.php +++ b/tests/Localization/ISO639EnumTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,16 +20,14 @@ use phpOMS\Localization\ISO3166TwoEnum; use phpOMS\Localization\ISO639Enum; /** - * @testdox phpOMS\tests\Localization\ISO639EnumTest: ISO 639 language codes * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\ISO639EnumTest: ISO 639 language codes')] final class ISO639EnumTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The ISO 639 language code enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 639 language code enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { $enum = ISO639Enum::getConstants(); diff --git a/tests/Localization/ISO639x1EnumTest.php b/tests/Localization/ISO639x1EnumTest.php index 0032b2934..691fe8699 100755 --- a/tests/Localization/ISO639x1EnumTest.php +++ b/tests/Localization/ISO639x1EnumTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,16 +20,14 @@ use phpOMS\Localization\ISO3166TwoEnum; use phpOMS\Localization\ISO639x1Enum; /** - * @testdox phpOMS\tests\Localization\ISO639x1EnumTest: ISO 639-1 language codes * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\ISO639x1EnumTest: ISO 639-1 language codes')] final class ISO639x1EnumTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The ISO 639-1 language code enum has the correct format of language codes - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 639-1 language code enum has the correct format of language codes')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { $ok = true; @@ -46,11 +44,9 @@ final class ISO639x1EnumTest extends \PHPUnit\Framework\TestCase self::assertTrue($ok, 'Failed for ' . $code); } - /** - * @testdox The ISO 639-1 enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 639-1 enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(ISO639x1Enum::getConstants(), \array_unique(ISO639x1Enum::getConstants())); diff --git a/tests/Localization/ISO639x2EnumTest.php b/tests/Localization/ISO639x2EnumTest.php index bc9947413..5d3b01340 100755 --- a/tests/Localization/ISO639x2EnumTest.php +++ b/tests/Localization/ISO639x2EnumTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,16 +20,14 @@ use phpOMS\Localization\ISO3166TwoEnum; use phpOMS\Localization\ISO639x2Enum; /** - * @testdox phpOMS\tests\Localization\ISO639x2EnumTest: ISO 639-2 language codes * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\ISO639x2EnumTest: ISO 639-2 language codes')] final class ISO639x2EnumTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The ISO 639-2 language code enum has the correct format of language codes - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 639-2 language code enum has the correct format of language codes')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { $ok = true; @@ -46,11 +44,9 @@ final class ISO639x2EnumTest extends \PHPUnit\Framework\TestCase self::assertTrue($ok); } - /** - * @testdox The ISO 639-2 enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 639-2 enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(ISO639x2Enum::getConstants(), \array_unique(ISO639x2Enum::getConstants())); diff --git a/tests/Localization/ISO8601EnumArrayTest.php b/tests/Localization/ISO8601EnumArrayTest.php index dd7d9975b..04e06085f 100755 --- a/tests/Localization/ISO8601EnumArrayTest.php +++ b/tests/Localization/ISO8601EnumArrayTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,26 +19,22 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Localization\ISO8601EnumArray; /** - * @testdox phpOMS\tests\Localization\ISO8601EnumArrayTest: ISO 8601 date time formats * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\ISO8601EnumArrayTest: ISO 8601 date time formats')] final class ISO8601EnumArrayTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The ISO 8601 date time format enum has the correct number of date time formats - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 8601 date time format enum has the correct number of date time formats')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(4, ISO8601EnumArray::getConstants()); } - /** - * @testdox The ISO 8601 enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ISO 8601 enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(ISO8601EnumArray::getConstants(), \array_unique(ISO8601EnumArray::getConstants())); diff --git a/tests/Localization/L11nManagerTest.php b/tests/Localization/L11nManagerTest.php index cf77c2e1e..f20986b0f 100755 --- a/tests/Localization/L11nManagerTest.php +++ b/tests/Localization/L11nManagerTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,10 @@ use phpOMS\Localization\Localization; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Localization\L11nManagerTest: Localization manager for view templates - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Localization\L11nManager::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\L11nManagerTest: Localization manager for view templates')] final class L11nManagerTest extends \PHPUnit\Framework\TestCase { protected L11nManager $l11nManager; @@ -38,11 +38,8 @@ final class L11nManagerTest extends \PHPUnit\Framework\TestCase $this->l11nManager = new L11nManager('Api'); } - /** - * @testdox The localization manager has the expected default values after initialization - * @covers phpOMS\Localization\L11nManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The localization manager has the expected default values after initialization')] public function testDefault() : void { self::assertFalse($this->l11nManager->isLanguageLoaded('en')); @@ -52,11 +49,8 @@ final class L11nManagerTest extends \PHPUnit\Framework\TestCase self::assertEquals('ERROR-Test2', $this->l11nManager->getText('en', 'Admin', 'Backend', 'Test2')); } - /** - * @testdox Language data can be loaded and output as plain text or html - * @covers phpOMS\Localization\L11nManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Language data can be loaded and output as plain text or html')] public function testLanguageInputOutput() : void { $expected = [ @@ -83,21 +77,15 @@ final class L11nManagerTest extends \PHPUnit\Framework\TestCase self::assertEquals('Test strin&g2', $this->l11nManager->getHtml('en', 'Admin', 'RandomThemeDoesNotMatterAlreadyLoaded', 'Test2')); } - /** - * @testdox An invalid localization source returns an error string - * @covers phpOMS\Localization\L11nManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An invalid localization source returns an error string')] public function testInvalidControllerSource() : void { self::assertEquals('ERROR-Key', $this->l11nManager->getText('en', 'InvalidSource', 'RandomThemeDoesNotMatterAlreadyLoaded', 'Key')); } - /** - * @testdox Language data can be loaded from a file - * @covers phpOMS\Localization\L11nManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Language data can be loaded from a file')] public function testLanguageFromLanguageFile() : void { $this->l11nManager2 = new L11nManager('Api'); @@ -109,11 +97,8 @@ final class L11nManagerTest extends \PHPUnit\Framework\TestCase self::assertEquals(['key' => 'value'], $this->l11nManager2->getModuleLanguage('en', 'Test')); } - /** - * @testdox Multiple languages can be loaded from a file - * @covers phpOMS\Localization\L11nManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Multiple languages can be loaded from a file')] public function testLanguageMultipleLanguagesFromSingleFile() : void { $this->l11nManager2 = new L11nManager('Api'); @@ -123,11 +108,8 @@ final class L11nManagerTest extends \PHPUnit\Framework\TestCase self::assertEquals('Test_DE', $this->l11nManager2->getHtml('de', 'Test', 'RandomThemeDoesNotMatterAlreadyLoaded', 'key')); } - /** - * @testdox The numeric value can be printed based on the localization - * @covers phpOMS\Localization\L11nManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The numeric value can be printed based on the localization')] public function testGetNumeric() : void { $l11n = Localization::fromLanguage('en'); @@ -136,11 +118,8 @@ final class L11nManagerTest extends \PHPUnit\Framework\TestCase self::assertEquals('1,234.235', $this->l11nManager->getNumeric($l11n, 1234.2345, 'long')); } - /** - * @testdox The percentage value can be printed based on the localization - * @covers phpOMS\Localization\L11nManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The percentage value can be printed based on the localization')] public function testGetPercentage() : void { $l11n = Localization::fromLanguage('en'); @@ -148,11 +127,8 @@ final class L11nManagerTest extends \PHPUnit\Framework\TestCase self::assertEquals('1.235%', $this->l11nManager->getPercentage($l11n, 1.2345, 'long')); } - /** - * @testdox The currency value can be printed based on the localization - * @covers phpOMS\Localization\L11nManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The currency value can be printed based on the localization')] public function testGetCurrency() : void { $l11n = Localization::fromLanguage('en'); @@ -168,11 +144,8 @@ final class L11nManagerTest extends \PHPUnit\Framework\TestCase self::assertEquals('B$ 1.2', $this->l11nManager->getCurrency($l11n, 1234567890.0, '$', 'short', 1000000000)); } - /** - * @testdox The datetime value can be printed based on the localization - * @covers phpOMS\Localization\L11nManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The datetime value can be printed based on the localization')] public function testGetDateTime() : void { $l11n = Localization::fromLanguage('en'); diff --git a/tests/Localization/LanguageDetection/LanguageTest.php b/tests/Localization/LanguageDetection/LanguageTest.php index 87c66d1a8..ac4f70874 100644 --- a/tests/Localization/LanguageDetection/LanguageTest.php +++ b/tests/Localization/LanguageDetection/LanguageTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,9 +19,9 @@ require_once __DIR__ . '/../../Autoloader.php'; use phpOMS\Localization\LanguageDetection\Language; /** - * @testdox phpOMS\tests\Localization\LanguageDetection\LanguageTest: Language detection * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\LanguageDetection\LanguageTest: Language detection')] final class LanguageTest extends \PHPUnit\Framework\TestCase { public function testDetection() : void diff --git a/tests/Localization/LocalizationTest.php b/tests/Localization/LocalizationTest.php index 1e670bec7..c7f0257b3 100755 --- a/tests/Localization/LocalizationTest.php +++ b/tests/Localization/LocalizationTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -25,10 +25,10 @@ use phpOMS\Utils\Converter\TemperatureType; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Localization\LocalizationTest: Localization for information such as language, currency, location, language specific formatting etc. - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Localization\Localization::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\LocalizationTest: Localization for information such as language, currency, location, language specific formatting etc.')] final class LocalizationTest extends \PHPUnit\Framework\TestCase { protected Localization $localization; @@ -41,11 +41,8 @@ final class LocalizationTest extends \PHPUnit\Framework\TestCase $this->localization = new Localization(); } - /** - * @testdox The localization has the expected default values after initialization - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The localization has the expected default values after initialization')] public function testDefault() : void { self::assertEquals(0, $this->localization->id); @@ -66,11 +63,8 @@ final class LocalizationTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $this->localization->getVolume()); } - /** - * @testdox Setting a invalid country code throws InvalidEnumValue - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Setting a invalid country code throws InvalidEnumValue')] public function testInvalidCountry() : void { $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); @@ -78,11 +72,8 @@ final class LocalizationTest extends \PHPUnit\Framework\TestCase $this->localization->setCountry('abc'); } - /** - * @testdox Setting a invalid timezone code throws InvalidEnumValue - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Setting a invalid timezone code throws InvalidEnumValue')] public function testInvalidTimezone() : void { $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); @@ -90,11 +81,8 @@ final class LocalizationTest extends \PHPUnit\Framework\TestCase $this->localization->setTimezone('abc'); } - /** - * @testdox Setting a invalid angle throws InvalidEnumValue - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Setting a invalid angle throws InvalidEnumValue')] public function testInvalidAngle() : void { $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); @@ -102,11 +90,8 @@ final class LocalizationTest extends \PHPUnit\Framework\TestCase $this->localization->setAngle('abc'); } - /** - * @testdox Setting a invalid temperature throws InvalidEnumValue - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Setting a invalid temperature throws InvalidEnumValue')] public function testInvalidTemperature() : void { $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); @@ -114,187 +99,136 @@ final class LocalizationTest extends \PHPUnit\Framework\TestCase $this->localization->setTemperature('abc'); } - /** - * @testdox The country can be set and returned - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The country can be set and returned')] public function testCountryInputOutput() : void { $this->localization->setCountry(ISO3166TwoEnum::_USA); self::assertEquals(ISO3166TwoEnum::_USA, $this->localization->country); } - /** - * @testdox The timezone can be set and returned - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The timezone can be set and returned')] public function testTimezoneInputOutput() : void { $this->localization->setTimezone(TimeZoneEnumArray::get(315)); self::assertEquals(TimeZoneEnumArray::get(315), $this->localization->getTimezone()); } - /** - * @testdox The datetime can be set and returned - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The datetime can be set and returned')] public function testDatetimeInputOutput() : void { $this->localization->setDatetime(['Y-m-d H:i:s']); self::assertEquals(['Y-m-d H:i:s'], $this->localization->getDatetime()); } - /** - * @testdox The decimal can be set and returned - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The decimal can be set and returned')] public function testDecimalInputOutput() : void { $this->localization->setDecimal(','); self::assertEquals(',', $this->localization->getDecimal()); } - /** - * @testdox The thousands can be set and returned - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The thousands can be set and returned')] public function testThousandsInputOutput() : void { $this->localization->setThousands('.'); self::assertEquals('.', $this->localization->getThousands()); } - /** - * @testdox The angle can be set and returned - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The angle can be set and returned')] public function testAngleInputOutput() : void { $this->localization->setAngle(AngleType::CENTRAD); self::assertEquals(AngleType::CENTRAD, $this->localization->getAngle()); } - /** - * @testdox The temperature can be set and returned - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The temperature can be set and returned')] public function testTemperatureInputOutput() : void { $this->localization->setTemperature(TemperatureType::FAHRENHEIT); self::assertEquals(TemperatureType::FAHRENHEIT, $this->localization->getTemperature()); } - /** - * @testdox The weight can be set and returned - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The weight can be set and returned')] public function testWeightInputOutput() : void { $this->localization->setWeight([1]); self::assertEquals([1], $this->localization->getWeight()); } - /** - * @testdox The currency format can be set and returned - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The currency format can be set and returned')] public function testCurrencyFormatInputOutput() : void { $this->localization->setCurrencyFormat('1'); self::assertEquals('1', $this->localization->getCurrencyFormat()); } - /** - * @testdox The precision can be set and returned - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The precision can be set and returned')] public function testPrecisionInputOutput() : void { $this->localization->setPrecision([1]); self::assertEquals([1], $this->localization->getPrecision()); } - /** - * @testdox The length can be set and returned - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The length can be set and returned')] public function testLengthInputOutput() : void { $this->localization->setLength([1]); self::assertEquals([1], $this->localization->getLength()); } - /** - * @testdox The area can be set and returned - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The area can be set and returned')] public function testAreaInputOutput() : void { $this->localization->setArea([1]); self::assertEquals([1], $this->localization->getArea()); } - /** - * @testdox The volume can be set and returned - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The volume can be set and returned')] public function testVolumeInputOutput() : void { $this->localization->setVolume([1]); self::assertEquals([1], $this->localization->getVolume()); } - /** - * @testdox The speed can be set and returned - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The speed can be set and returned')] public function testSpeedInputOutput() : void { $this->localization->setSpeed([1]); self::assertEquals([1], $this->localization->getSpeed()); } - /** - * @testdox Localization data can be loaded from a locale file - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Localization data can be loaded from a locale file')] public function testLocalizationFromLanguageCode() : void { $l11n = Localization::fromLanguage(ISO639x1Enum::_DE); self::assertEquals(ISO4217CharEnum::_EUR, $l11n->currency); } - /** - * @testdox Localization data can be loaded from a locale file - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Localization data can be loaded from a locale file')] public function testLocalizationLoading() : void { $this->localization->loadFromLanguage(ISO639x1Enum::_DE); self::assertEquals(ISO4217CharEnum::_EUR, $this->localization->currency); } - /** - * @testdox Localization data can be serialized and unserialized - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Localization data can be serialized and unserialized')] public function testLocalizationSerialize() : void { $this->localization->loadFromLanguage(ISO639x1Enum::_DE); @@ -306,22 +240,16 @@ final class LocalizationTest extends \PHPUnit\Framework\TestCase self::assertEquals($l11n1, $l11n2); } - /** - * @testdox If no locale file for a specified country exists or a wild card country is used the first match of a locale file based on the defined language is loaded - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('If no locale file for a specified country exists or a wild card country is used the first match of a locale file based on the defined language is loaded')] public function testInvalidCountryLocalizationLoading() : void { $this->localization->loadFromLanguage(ISO639x1Enum::_DE, 'ABC'); self::assertEquals(ISO4217CharEnum::_EUR, $this->localization->currency); } - /** - * @testdox By default the english locale file will be loaded if no other locale file can be found - * @covers phpOMS\Localization\Localization - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('By default the english locale file will be loaded if no other locale file can be found')] public function testMissingLocalizationLoading() : void { $this->localization->loadFromLanguage(ISO639x1Enum::_AA); diff --git a/tests/Localization/MoneyTest.php b/tests/Localization/MoneyTest.php index e3096e92f..5bc9a9b19 100755 --- a/tests/Localization/MoneyTest.php +++ b/tests/Localization/MoneyTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,13 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Localization\Money; /** - * @testdox phpOMS\Localization\Money: Money datatype for internal representation of money - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\Localization\Money: Money datatype for internal representation of money')] final class MoneyTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The datatype has the expected member variables and default values - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The datatype has the expected member variables and default values')] public function testDefaultMemberVariables() : void { $money = new Money(0); @@ -36,20 +33,16 @@ final class MoneyTest extends \PHPUnit\Framework\TestCase self::assertEquals(0, $money->getInt()); } - /** - * @testdox The datatype returns the correct default string representation (#,###.##) - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The datatype returns the correct default string representation (#,###.##)')] public function testMoneyDefaultStringRepresentation() : void { $money = new Money(12345678); self::assertEquals('1,234.57', $money->getAmount()); } - /** - * @testdox The datatype returns up to 4 decimal places if requested (#,###.####) - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The datatype returns up to 4 decimal places if requested (#,###.####)')] public function testMoneyDecimalPlaces() : void { $money = new Money(12345678); @@ -57,10 +50,8 @@ final class MoneyTest extends \PHPUnit\Framework\TestCase self::assertEquals('1,234.5678', $money->getAmount(7)); } - /** - * @testdox The datatype returns the correct integer representation of a string with up to 4 decimal places also considering differences in decimal and thousands characters if requested for different localizations - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The datatype returns the correct integer representation of a string with up to 4 decimal places also considering differences in decimal and thousands characters if requested for different localizations')] public function testMoneyStringToIntConversion() : void { self::assertEquals(12345678, Money::toInt('1234.5678')); @@ -68,10 +59,8 @@ final class MoneyTest extends \PHPUnit\Framework\TestCase self::assertEquals(12345600, Money::toInt('1234,56', '.', ',')); } - /** - * @testdox The datatype allows to modify the value by overwriting it with new string characters or integers correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The datatype allows to modify the value by overwriting it with new string characters or integers correctly')] public function testCorrectValueChange() : void { $money = new Money(12345678); @@ -79,30 +68,24 @@ final class MoneyTest extends \PHPUnit\Framework\TestCase self::assertEquals('999.23', $money->setInt(9992300)->getAmount()); } - /** - * @testdox The datatype can print out money with different thousands, decimals and currency symbols as per definition by the user - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The datatype can print out money with different thousands, decimals and currency symbols as per definition by the user')] public function testMoneyLocalization() : void { $money = new Money(12345678); self::assertEquals('€ 9.992,30', $money->setInt(99923000)->setLocalization('.', ',')->getCurrency(symbol: '€')); } - /** - * @testdox The string character input is correctly serialized to the numeric representation - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The string character input is correctly serialized to the numeric representation')] public function testMoneySerialization() : void { $money = new Money('999.23'); self::assertEquals(9992300, $money->serialize()); } - /** - * @testdox The string character input is correctly unserialized from a numeric representation - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The string character input is correctly unserialized from a numeric representation')] public function testMoneyUnserialization() : void { $money = new Money('999.23'); @@ -110,10 +93,8 @@ final class MoneyTest extends \PHPUnit\Framework\TestCase self::assertEquals('333.12', $money->getAmount()); } - /** - * @testdox The datatype correctly adds and subtracts the different money representations in string, numeric or Money type - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The datatype correctly adds and subtracts the different money representations in string, numeric or Money type')] public function testMoneyAddSub() : void { $money = new Money(10000); @@ -130,10 +111,8 @@ final class MoneyTest extends \PHPUnit\Framework\TestCase self::assertEquals('1.0000', $money->sub(new Money(10000))->getAmount(4)); } - /** - * @testdox The datatype correctly multiplies and divides the money with numerics - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The datatype correctly multiplies and divides the money with numerics')] public function testMoneyMultDiv() : void { $money = new Money(19100); @@ -141,20 +120,16 @@ final class MoneyTest extends \PHPUnit\Framework\TestCase self::assertEquals('1.9100', $money->div(2.0)->getAmount(4)); } - /** - * @testdox The datatype correctly handles the absolute value - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The datatype correctly handles the absolute value')] public function testMoneyAbsoluteValue() : void { $money = new Money(-38200); self::assertEquals('3.8200', $money->mult(-1)->abs()->getAmount(4)); } - /** - * @testdox The datatype correctly handles the power operator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The datatype correctly handles the power operator')] public function testMoneyPower() : void { $money = new Money(-38200); diff --git a/tests/Localization/PhoneEnumTest.php b/tests/Localization/PhoneEnumTest.php index 4295ca1a6..7b125ab23 100755 --- a/tests/Localization/PhoneEnumTest.php +++ b/tests/Localization/PhoneEnumTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Localization\PhoneEnum; /** - * @testdox phpOMS\tests\Localization\PhoneEnumTest: Country phone codes * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\PhoneEnumTest: Country phone codes')] final class PhoneEnumTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The phone enum has the correct format of country phone numbers - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The phone enum has the correct format of country phone numbers')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { $ok = true; diff --git a/tests/Localization/TimeZoneEnumArrayTest.php b/tests/Localization/TimeZoneEnumArrayTest.php index 994b55bc5..6a9d5df6b 100755 --- a/tests/Localization/TimeZoneEnumArrayTest.php +++ b/tests/Localization/TimeZoneEnumArrayTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Localization\TimeZoneEnumArray; /** - * @testdox phpOMS\tests\Localization\TimeZoneEnumArrayTest: Time zone enum array * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Localization\TimeZoneEnumArrayTest: Time zone enum array')] final class TimeZoneEnumArrayTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The time zone enum array has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The time zone enum array has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(\count(TimeZoneEnumArray::getConstants()), \count(\array_unique(TimeZoneEnumArray::getConstants()))); diff --git a/tests/Log/FileLoggerTest.php b/tests/Log/FileLoggerTest.php index 6c52749d2..510e18ae1 100755 --- a/tests/Log/FileLoggerTest.php +++ b/tests/Log/FileLoggerTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,10 +21,10 @@ use phpOMS\Utils\TestUtils; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Log\FileLoggerTest: File logger for saving log information in a local file - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Log\FileLogger::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Log\FileLoggerTest: File logger for saving log information in a local file')] final class FileLoggerTest extends \PHPUnit\Framework\TestCase { protected FileLogger $log; @@ -56,11 +56,8 @@ final class FileLoggerTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox The logger has the expected default values after initialization - * @covers phpOMS\Log\FileLogger - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The logger has the expected default values after initialization')] public function testDefault() : void { self::assertEquals([], $this->log->countLogs()); @@ -69,11 +66,8 @@ final class FileLoggerTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $this->log->getByLine()); } - /** - * @testdox The file logger can automatically create a new instance if none exists - * @covers phpOMS\Log\FileLogger - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The file logger can automatically create a new instance if none exists')] public function testFileLoggerInstance() : void { if (\is_file(__DIR__ . '/named.log')) { @@ -93,11 +87,8 @@ final class FileLoggerTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox A log file for the output can be specified for the file logger - * @covers phpOMS\Log\FileLogger - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A log file for the output can be specified for the file logger')] public function testNamedLogFile() : void { if (\is_file(__DIR__ . '/named.log')) { @@ -114,11 +105,8 @@ final class FileLoggerTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox If no log file name is specified a log file per date is created - * @covers phpOMS\Log\FileLogger - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('If no log file name is specified a log file per date is created')] public function testUnnamedLogFile() : void { $log = new FileLogger(__DIR__, false); @@ -127,11 +115,8 @@ final class FileLoggerTest extends \PHPUnit\Framework\TestCase self::assertTrue(\is_file(__DIR__ . '/' . \date('Y-m-d') . '.log')); } - /** - * @testdox If no logs are performed no log file will be created - * @covers phpOMS\Log\FileLogger - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('If no logs are performed no log file will be created')] public function testNoFileIfNoLog() : void { $log = new FileLogger(__DIR__, false); @@ -139,11 +124,8 @@ final class FileLoggerTest extends \PHPUnit\Framework\TestCase self::assertFalse(\is_file(__DIR__ . '/' . \date('Y-m-d') . '.log')); } - /** - * @testdox Logs with different levels get correctly stored in the log file - * @covers phpOMS\Log\FileLogger - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Logs with different levels get correctly stored in the log file')] public function testLogInputOutput() : void { $this->log->emergency(FileLogger::MSG_FULL, [ @@ -229,11 +211,8 @@ final class FileLoggerTest extends \PHPUnit\Framework\TestCase self::assertEquals(2, $this->log->countLogs()['debug'] ?? 0); } - /** - * @testdox Log files can be analyzed for the highest perpetrator (IP address) - * @covers phpOMS\Log\FileLogger - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Log files can be analyzed for the highest perpetrator (IP address)')] public function testPerpetrator() : void { $this->log->emergency(FileLogger::MSG_FULL, [ @@ -245,11 +224,8 @@ final class FileLoggerTest extends \PHPUnit\Framework\TestCase self::assertEquals(['0.0.0.0' => 1], $this->log->getHighestPerpetrator()); } - /** - * @testdox Logs can be read from the log file - * @covers phpOMS\Log\FileLogger - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Logs can be read from the log file')] public function testReadLogs() : void { $this->log->emergency(FileLogger::MSG_FULL, [ @@ -283,11 +259,8 @@ final class FileLoggerTest extends \PHPUnit\Framework\TestCase self::assertEquals('error3', $logs[3][7]); } - /** - * @testdox Invalid log reads return empty log data - * @covers phpOMS\Log\FileLogger - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid log reads return empty log data')] public function testInvalidReadLogs() : void { $this->log->emergency(FileLogger::MSG_FULL, [ @@ -301,11 +274,8 @@ final class FileLoggerTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $logs); } - /** - * @testdox A line can be read from a log file - * @covers phpOMS\Log\FileLogger - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A line can be read from a log file')] public function testReadLine() : void { $this->log->alert(FileLogger::MSG_FULL, [ @@ -317,11 +287,8 @@ final class FileLoggerTest extends \PHPUnit\Framework\TestCase self::assertEquals('alert', $this->log->getByLine(1)[1]); } - /** - * @testdox None-existing lines return on read empty log data - * @covers phpOMS\Log\FileLogger - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('None-existing lines return on read empty log data')] public function testInvalidReadLine() : void { $this->log->emergency(FileLogger::MSG_FULL, [ @@ -333,11 +300,8 @@ final class FileLoggerTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $this->log->getByLine(2)); } - /** - * @testdox A verbose file logger automatically outputs log data - * @covers phpOMS\Log\FileLogger - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A verbose file logger automatically outputs log data')] public function testVerboseLogger() : void { $this->log = new FileLogger(__DIR__, true); @@ -350,11 +314,8 @@ final class FileLoggerTest extends \PHPUnit\Framework\TestCase self::assertEquals('my log message' . "\n", $ob); } - /** - * @testdox A verbose console log outputs log data - * @covers phpOMS\Log\FileLogger - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A verbose console log outputs log data')] public function testVerboseLog() : void { $this->log = new FileLogger(__DIR__, false); @@ -367,11 +328,8 @@ final class FileLoggerTest extends \PHPUnit\Framework\TestCase self::assertTrue(\stripos($ob, 'my log message') !== false); } - /** - * @testdox A invalid log type throws a InvalidEnumValue - * @covers phpOMS\Log\FileLogger - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid log type throws a InvalidEnumValue')] public function testLogException() : void { $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); @@ -384,11 +342,8 @@ final class FileLoggerTest extends \PHPUnit\Framework\TestCase ]); } - /** - * @testdox The logger can perform timings for internal duration logging - * @covers phpOMS\Log\FileLogger - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The logger can perform timings for internal duration logging')] public function testTiming() : void { self::assertTrue(FileLogger::startTimeLog('test')); diff --git a/tests/Log/LogLevelTest.php b/tests/Log/LogLevelTest.php index 1ee06dc45..d68aa5a5e 100755 --- a/tests/Log/LogLevelTest.php +++ b/tests/Log/LogLevelTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,36 +19,30 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Log\LogLevel; /** - * @testdox phpOMS\tests\Log\LogLevelTest: Log level enum * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Log\LogLevelTest: Log level enum')] final class LogLevelTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The log level enum has the correct number of log levels - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The log level enum has the correct number of log levels')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(8, LogLevel::getConstants()); } - /** - * @testdox The log level enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The log level enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(LogLevel::getConstants(), \array_unique(LogLevel::getConstants())); } - /** - * @testdox The log level enum has the correct values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The log level enum has the correct values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('emergency', LogLevel::EMERGENCY); diff --git a/tests/Math/Exception/ZeroDevisionExceptionTest.php b/tests/Math/Exception/ZeroDivisionExceptionTest.php old mode 100755 new mode 100644 similarity index 75% rename from tests/Math/Exception/ZeroDevisionExceptionTest.php rename to tests/Math/Exception/ZeroDivisionExceptionTest.php index 0c235faa6..0ca64517a --- a/tests/Math/Exception/ZeroDevisionExceptionTest.php +++ b/tests/Math/Exception/ZeroDivisionExceptionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Math\Exception\ZeroDivisionException; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Exception\ZeroDivisionException::class)] final class ZeroDivisionExceptionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Exception\ZeroDivisionException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testException() : void { self::assertInstanceOf(\UnexpectedValueException::class, new ZeroDivisionException()); diff --git a/tests/Math/Functions/AlgebraTest.php b/tests/Math/Functions/AlgebraTest.php index 7455ea3fe..1038626bc 100644 --- a/tests/Math/Functions/AlgebraTest.php +++ b/tests/Math/Functions/AlgebraTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,9 @@ namespace phpOMS\tests\Math\Functions; use phpOMS\Math\Functions\Algebra; /** - * @testdox phpOMS\tests\Math\Functions\AlgebraTest: Various math functions - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Functions\AlgebraTest: Various math functions')] final class AlgebraTest extends \PHPUnit\Framework\TestCase { public function testMultVectors() : void @@ -59,8 +58,9 @@ final class AlgebraTest extends \PHPUnit\Framework\TestCase Algebra::mult( [3, 4], [ - [1, 5, 7], - [2, 6, 8], + [1, 2], + [5, 6], + [7, 8], ] ) ); diff --git a/tests/Math/Functions/BetaTest.php b/tests/Math/Functions/BetaTest.php index ebd1bc749..0342b7f92 100755 --- a/tests/Math/Functions/BetaTest.php +++ b/tests/Math/Functions/BetaTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Math\Functions; use phpOMS\Math\Functions\Beta; /** - * @testdox phpOMS\tests\Math\Functions\BetaTest: Beta function - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Functions\Beta::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Functions\BetaTest: Beta function')] final class BetaTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The beta function can be approximated - * @covers phpOMS\Math\Functions\Beta - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The beta function can be approximated')] public function testBeta() : void { self::assertEqualsWithDelta(1.0, Beta::beta(0, 3), 0.001); @@ -35,11 +32,8 @@ final class BetaTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.05, Beta::beta(2, 4), 0.001); } - /** - * @testdox The log beta function can be approximated - * @covers phpOMS\Math\Functions\Beta - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The log beta function can be approximated')] public function testLogBeta() : void { self::assertEqualsWithDelta(0, Beta::logBeta(1, 0), 0.001); @@ -47,11 +41,8 @@ final class BetaTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(\log(Beta::beta(2, 4)), Beta::logBeta(2, 4), 0.001); } - /** - * @testdox The incomplete beta function can be approximated - * @covers phpOMS\Math\Functions\Beta - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The incomplete beta function can be approximated')] public function testIncompleteBeta() : void { self::assertEqualsWithDelta(0.0, Beta::incompleteBeta(-1, 1, 3), 0.001); @@ -61,11 +52,8 @@ final class BetaTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.045648, Beta::incompleteBeta(0.6, 2, 4), 0.001); } - /** - * @testdox The regularized beta function can be approximated - * @covers phpOMS\Math\Functions\Beta - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The regularized beta function can be approximated')] public function testRegularizedBeta() : void { self::assertEqualsWithDelta(0.0, Beta::regularizedBeta(-1, 1, 3), 0.001); diff --git a/tests/Math/Functions/FibonacciTest.php b/tests/Math/Functions/FibonacciTest.php index bf680e32e..b91b7dc10 100755 --- a/tests/Math/Functions/FibonacciTest.php +++ b/tests/Math/Functions/FibonacciTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Math\Functions; use phpOMS\Math\Functions\Fibonacci; /** - * @testdox phpOMS\tests\Math\Functions\FibonacciTest: Fibonacci functions - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Functions\Fibonacci::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Functions\FibonacciTest: Fibonacci functions')] final class FibonacciTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A number can be checked if it is a fibonacci number - * @covers phpOMS\Math\Functions\Fibonacci - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A number can be checked if it is a fibonacci number')] public function testFibonacci() : void { self::assertTrue(Fibonacci::isFibonacci(13)); @@ -37,32 +34,23 @@ final class FibonacciTest extends \PHPUnit\Framework\TestCase self::assertFalse(Fibonacci::isFibonacci(87)); } - /** - * @testdox A fibonacci number can be returned by index - * @covers phpOMS\Math\Functions\Fibonacci - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A fibonacci number can be returned by index')] public function testFibonacciByKey() : void { self::assertEquals(1, Fibonacci::fib(1)); } - /** - * @testdox The binet formula returns fibonacci numbers - * @covers phpOMS\Math\Functions\Fibonacci - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The binet formula returns fibonacci numbers')] public function testBinet() : void { self::assertTrue(Fibonacci::isFibonacci(Fibonacci::binet(3))); self::assertTrue(Fibonacci::isFibonacci(Fibonacci::binet(6))); } - /** - * @testdox The binet formula and the fibonacci formula return the same results - * @covers phpOMS\Math\Functions\Fibonacci - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The binet formula and the fibonacci formula return the same results')] public function testBinetFib() : void { self::assertEquals(Fibonacci::binet(6), Fibonacci::fib(6)); diff --git a/tests/Math/Functions/FunctionsTest.php b/tests/Math/Functions/FunctionsTest.php index b532d5cfb..42737b74a 100755 --- a/tests/Math/Functions/FunctionsTest.php +++ b/tests/Math/Functions/FunctionsTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,28 +17,22 @@ namespace phpOMS\tests\Math\Functions; use phpOMS\Math\Functions\Functions; /** - * @testdox phpOMS\tests\Math\Functions\FunctionsTest: Various math functions - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Functions\Functions::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Functions\FunctionsTest: Various math functions')] final class FunctionsTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The factorial of a number can be calculated - * @covers phpOMS\Math\Functions\Functions - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The factorial of a number can be calculated')] public function testFactorial() : void { self::assertEquals(120, Functions::fact(5)); self::assertEquals(39916800, Functions::fact(11)); } - /** - * @testdox The binomial coefficient can be calculated - * @covers phpOMS\Math\Functions\Functions - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The binomial coefficient can be calculated')] public function testBinomialCoefficient() : void { self::assertEquals(21, Functions::binomialCoefficient(7, 2)); @@ -46,11 +40,8 @@ final class FunctionsTest extends \PHPUnit\Framework\TestCase self::assertEquals(13983816, Functions::binomialCoefficient(49, 6)); } - /** - * @testdox The ackerman function can be calculated - * @covers phpOMS\Math\Functions\Functions - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ackerman function can be calculated')] public function testAckermann() : void { self::assertEquals(5, Functions::ackermann(2, 1)); @@ -59,11 +50,8 @@ final class FunctionsTest extends \PHPUnit\Framework\TestCase self::assertEquals(13, Functions::ackermann(4, 0)); } - /** - * @testdox The multiplicative inverse module can be calculated - * @covers phpOMS\Math\Functions\Functions - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The multiplicative inverse module can be calculated')] public function testMultiplicativeInverseModulo() : void { self::assertEquals(4, Functions::invMod(3, -11)); @@ -71,11 +59,8 @@ final class FunctionsTest extends \PHPUnit\Framework\TestCase self::assertEquals(5, Functions::invMod(-10, 17)); } - /** - * @testdox A number can be checked if it is odd - * @covers phpOMS\Math\Functions\Functions - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A number can be checked if it is odd')] public function testOdd() : void { self::assertTrue(Functions::isOdd(3)); @@ -84,11 +69,8 @@ final class FunctionsTest extends \PHPUnit\Framework\TestCase self::assertFalse(Functions::isOdd(-4)); } - /** - * @testdox A number can be checked if it is even - * @covers phpOMS\Math\Functions\Functions - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A number can be checked if it is even')] public function testEven() : void { self::assertTrue(Functions::isEven(4)); @@ -97,11 +79,8 @@ final class FunctionsTest extends \PHPUnit\Framework\TestCase self::assertFalse(Functions::isEven(-3)); } - /** - * @testdox The relative number can be calculated on a circular number system (e.g. month in a diverging business year) - * @covers phpOMS\Math\Functions\Functions - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The relative number can be calculated on a circular number system (e.g. month in a diverging business year)')] public function testCircularPosition() : void { self::assertEquals(0, Functions::getRelativeDegree(7, 12, 7)); @@ -109,11 +88,8 @@ final class FunctionsTest extends \PHPUnit\Framework\TestCase self::assertEquals(11, Functions::getRelativeDegree(6, 12, 7)); } - /** - * @testdox The error function can be correctly approximated - * @covers phpOMS\Math\Functions\Functions - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The error function can be correctly approximated')] public function testErf() : void { self::assertEqualsWithDelta(-0.8427, Functions::getErf(-1), 0.001); @@ -122,11 +98,8 @@ final class FunctionsTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.9988, Functions::getErf(2.3), 0.001); } - /** - * @testdox The complementary error function can be correctly approximated - * @covers phpOMS\Math\Functions\Functions - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The complementary error function can be correctly approximated')] public function testErfc() : void { self::assertEqualsWithDelta(1.8427, Functions::getErfc(-1), 0.001); @@ -135,11 +108,8 @@ final class FunctionsTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(2.0, Functions::getErfc(-5), 0.001); } - /** - * @testdox The generalized hypergeometric function can be correctly calculated - * @covers phpOMS\Math\Functions\Functions - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The generalized hypergeometric function can be correctly calculated')] public function testGeneralizedHypergeometricFunction() : void { self::assertEqualsWithDelta(2.7289353, Functions::generalizedHypergeometricFunction([2, 3], [4], 0.5), 0.001); diff --git a/tests/Math/Functions/GammaTest.php b/tests/Math/Functions/GammaTest.php index bb0c84044..192c06413 100755 --- a/tests/Math/Functions/GammaTest.php +++ b/tests/Math/Functions/GammaTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,38 +18,29 @@ use phpOMS\Math\Functions\Functions; use phpOMS\Math\Functions\Gamma; /** - * @testdox phpOMS\tests\Math\Functions\GammaTest: Gamma function - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Functions\Gamma::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Functions\GammaTest: Gamma function')] final class GammaTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The gamma function can be approximated - * @covers phpOMS\Math\Functions\Gamma - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The gamma function can be approximated')] public function testGamma() : void { self::assertEqualsWithDelta(2.0, Gamma::gamma(3.0), 0.001); self::assertEqualsWithDelta(11.631728, Gamma::gamma(4.5), 0.001); } - /** - * @testdox The gamma function can be calculated for integers - * @covers phpOMS\Math\Functions\Gamma - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The gamma function can be calculated for integers')] public function testFactorial() : void { self::assertEquals(Functions::fact(4), Gamma::getGammaInteger(5)); } - /** - * @testdox The gamma function can be approximated with the spouge formula - * @covers phpOMS\Math\Functions\Gamma - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The gamma function can be approximated with the spouge formula')] public function testApproximationSpouge() : void { $spouge = [ @@ -65,11 +56,8 @@ final class GammaTest extends \PHPUnit\Framework\TestCase self::assertTrue(true); } - /** - * @testdox The gamma function can be approximated with the stirling formula - * @covers phpOMS\Math\Functions\Gamma - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The gamma function can be approximated with the stirling formula')] public function testApproximationStirling() : void { $stirling = [ @@ -85,11 +73,8 @@ final class GammaTest extends \PHPUnit\Framework\TestCase self::assertTrue(true); } - /** - * @testdox The gamma function can be approximated with the lanzos formula - * @covers phpOMS\Math\Functions\Gamma - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The gamma function can be approximated with the lanzos formula')] public function testApproximationLanzos() : void { $gsl = [ @@ -105,11 +90,8 @@ final class GammaTest extends \PHPUnit\Framework\TestCase self::assertTrue(true); } - /** - * @testdox The log gamma function can be approximated - * @covers phpOMS\Math\Functions\Gamma - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The log gamma function can be approximated')] public function testLogGamma() : void { $gsl = [ @@ -125,11 +107,8 @@ final class GammaTest extends \PHPUnit\Framework\TestCase self::assertTrue(true); } - /** - * @testdox The first incomplete gamma function can be approximated - * @covers phpOMS\Math\Functions\Gamma - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The first incomplete gamma function can be approximated')] public function testFirstIncompleteGamma() : void { self::assertEqualsWithDelta(0.0, Gamma::incompleteGammaFirst(3.0, 0.0), 0.001); @@ -137,11 +116,8 @@ final class GammaTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(2.116608, Gamma::incompleteGammaFirst(4.0, 3.0), 0.001); } - /** - * @testdox The second incomplete gamma function can be approximated - * @covers phpOMS\Math\Functions\Gamma - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The second incomplete gamma function can be approximated')] public function testSecondIncompleteGamma() : void { self::assertEqualsWithDelta(2.0, Gamma::incompleteGammaSecond(3.0, 0.0), 0.001); @@ -149,11 +125,8 @@ final class GammaTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(3.883391, Gamma::incompleteGammaSecond(4.0, 3.0), 0.001); } - /** - * @testdox The regularized incomplete gamma function can be approximated - * @covers phpOMS\Math\Functions\Gamma - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The regularized incomplete gamma function can be approximated')] public function testRegularizedGamma() : void { self::assertEqualsWithDelta(0.0, Gamma::regularizedGamma(3.0, 0.0), 0.001); diff --git a/tests/Math/Geometry/ConvexHull/GrahamScanTest.php b/tests/Math/Geometry/ConvexHull/GrahamScanTest.php index c8ec30c1b..c42ee330c 100644 --- a/tests/Math/Geometry/ConvexHull/GrahamScanTest.php +++ b/tests/Math/Geometry/ConvexHull/GrahamScanTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Math\Geometry\ConvexHull; use phpOMS\Math\Geometry\ConvexHull\GrahamScan; /** - * @testdox phpOMS\tests\Math\Geometry\ConvexHull\GrahamScanTest: Monotone chain - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Geometry\ConvexHull\GrahamScan::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Geometry\ConvexHull\GrahamScanTest: Monotone chain')] final class GrahamScanTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A convex hull can be formed from multiple points on a plane - * @covers phpOMS\Math\Geometry\ConvexHull\GrahamScan - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A convex hull can be formed from multiple points on a plane')] public function testGrahamScan() : void { self::assertEquals([['x' => 9, 'y' => 0]], GrahamScan::createConvexHull([['x' => 9, 'y' => 0]])); diff --git a/tests/Math/Geometry/ConvexHull/MonotoneChainTest.php b/tests/Math/Geometry/ConvexHull/MonotoneChainTest.php index 31c832d22..d7878f638 100755 --- a/tests/Math/Geometry/ConvexHull/MonotoneChainTest.php +++ b/tests/Math/Geometry/ConvexHull/MonotoneChainTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Math\Geometry\ConvexHull; use phpOMS\Math\Geometry\ConvexHull\MonotoneChain; /** - * @testdox phpOMS\tests\Math\Geometry\ConvexHull\MonotoneChainTest: Monotone chain - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Geometry\ConvexHull\MonotoneChain::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Geometry\ConvexHull\MonotoneChainTest: Monotone chain')] final class MonotoneChainTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A convex hull can be formed from multiple points on a plane - * @covers phpOMS\Math\Geometry\ConvexHull\MonotoneChain - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A convex hull can be formed from multiple points on a plane')] public function testMonotoneChain() : void { self::assertEquals([['x' => 9, 'y' => 0]], MonotoneChain::createConvexHull([['x' => 9, 'y' => 0]])); diff --git a/tests/Math/Geometry/Shape/D2/CircleTest.php b/tests/Math/Geometry/Shape/D2/CircleTest.php index 5e1248133..f1ed29788 100755 --- a/tests/Math/Geometry/Shape/D2/CircleTest.php +++ b/tests/Math/Geometry/Shape/D2/CircleTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,47 +17,35 @@ namespace phpOMS\tests\Math\Geometry\Shape\D2; use phpOMS\Math\Geometry\Shape\D2\Circle; /** - * @testdox phpOMS\tests\Math\Geometry\Shape\D2\CircleTest: Circle shape - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Geometry\Shape\D2\Circle::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Geometry\Shape\D2\CircleTest: Circle shape')] final class CircleTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The surface can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Circle - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The surface can be calculated')] public function testSurface() : void { self::assertEqualsWithDelta(12.57, Circle::getSurface(2), 0.01); } - /** - * @testdox The perimeter can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Circle - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The perimeter can be calculated')] public function testPerimeter() : void { self::assertEqualsWithDelta(12.57, Circle::getPerimeter(2), 0.01); } - /** - * @testdox The radius can be calculated with the surface - * @covers phpOMS\Math\Geometry\Shape\D2\Circle - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The radius can be calculated with the surface')] public function testRadiusBySurface() : void { self::assertEqualsWithDelta(2.0, Circle::getRadiusBySurface(Circle::getSurface(2)), 0.001); } - /** - * @testdox The radius can be calculated with the perimeter - * @covers phpOMS\Math\Geometry\Shape\D2\Circle - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The radius can be calculated with the perimeter')] public function testRadiusByPerimeter() : void { self::assertEqualsWithDelta(2.0, Circle::getRadiusByPerimeter(Circle::getPerimeter(2)), 0.001); diff --git a/tests/Math/Geometry/Shape/D2/EllipseTest.php b/tests/Math/Geometry/Shape/D2/EllipseTest.php index 49e0ebd06..3de784d7b 100755 --- a/tests/Math/Geometry/Shape/D2/EllipseTest.php +++ b/tests/Math/Geometry/Shape/D2/EllipseTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,27 +17,21 @@ namespace phpOMS\tests\Math\Geometry\Shape\D2; use phpOMS\Math\Geometry\Shape\D2\Ellipse; /** - * @testdox phpOMS\tests\Math\Geometry\Shape\D2\EllipseTest: Ellipse shape - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Geometry\Shape\D2\Ellipse::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Geometry\Shape\D2\EllipseTest: Ellipse shape')] final class EllipseTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The surface can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Ellipse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The surface can be calculated')] public function testSurface() : void { self::assertEqualsWithDelta(6.28, Ellipse::getSurface(2, 1), 0.01); } - /** - * @testdox The perimeter can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Ellipse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The perimeter can be calculated')] public function testPerimeter() : void { self::assertEqualsWithDelta(9.69, Ellipse::getPerimeter(2, 1), 0.01); diff --git a/tests/Math/Geometry/Shape/D2/PolygonTest.php b/tests/Math/Geometry/Shape/D2/PolygonTest.php index 41c7e029a..6a71ee738 100755 --- a/tests/Math/Geometry/Shape/D2/PolygonTest.php +++ b/tests/Math/Geometry/Shape/D2/PolygonTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Math\Geometry\Shape\D2; use phpOMS\Math\Geometry\Shape\D2\Polygon; /** - * @testdox phpOMS\tests\Math\Geometry\Shape\D2\PolygonTest: Polygon shape - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Geometry\Shape\D2\Polygon::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Geometry\Shape\D2\PolygonTest: Polygon shape')] final class PolygonTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The location of a point can be checked relative to a polygon - * @covers phpOMS\Math\Geometry\Shape\D2\Polygon - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The location of a point can be checked relative to a polygon')] public function testPoint() : void { $polyArray = [ @@ -49,11 +46,8 @@ final class PolygonTest extends \PHPUnit\Framework\TestCase self::assertEquals(-1, Polygon::isPointInPolygon(['x' => 1.8, 'y' => 1.1], $polyArray)); } - /** - * @testdox The interior angle can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Polygon - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The interior angle can be calculated')] public function testInteriorAngle() : void { $polygon = new Polygon([[1, 2], [2, 3], [3, 4]]); @@ -75,22 +69,16 @@ final class PolygonTest extends \PHPUnit\Framework\TestCase self::assertEquals(1080, $polygon->getInteriorAngleSum()); } - /** - * @testdox The exterior angle can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Polygon - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The exterior angle can be calculated')] public function testExteriorAngle() : void { $polygon = new Polygon([[1, 2], [2, 3], [3, 4]]); self::assertEquals(360, $polygon->getExteriorAngleSum()); } - /** - * @testdox The perimeter can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Polygon - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The perimeter can be calculated')] public function testPerimeter() : void { $polygon = new Polygon([ @@ -106,11 +94,8 @@ final class PolygonTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(9.6568, $polygon->getPerimeter(), 0.1); } - /** - * @testdox The area can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Polygon - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The area can be calculated')] public function testArea() : void { $polygon = new Polygon([ @@ -126,11 +111,8 @@ final class PolygonTest extends \PHPUnit\Framework\TestCase self::assertEquals(7, $polygon->getSurface()); } - /** - * @testdox The barycenter can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Polygon - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The barycenter can be calculated')] public function testBarycenter() : void { $polygon = new Polygon([ @@ -146,21 +128,15 @@ final class PolygonTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(['x' => 3.5, 'y' => 1.5], $polygon->getBarycenter(), 0.5); } - /** - * @testdox The regular area can be calculated with the side length - * @covers phpOMS\Math\Geometry\Shape\D2\Polygon - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The regular area can be calculated with the side length')] public function testRegularAreaByLength() : void { self::assertEqualsWithDelta(3 * 3, Polygon::getRegularAreaByLength(3.0, 4), 0.01); } - /** - * @testdox The regular area can be calculated with the radius - * @covers phpOMS\Math\Geometry\Shape\D2\Polygon - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The regular area can be calculated with the radius')] public function testRegularAreaByRadius() : void { self::assertEqualsWithDelta(3 * 3 , Polygon::getRegularAreaByRadius(1.5, 4), 0.01); diff --git a/tests/Math/Geometry/Shape/D2/QuadrilateralTest.php b/tests/Math/Geometry/Shape/D2/QuadrilateralTest.php index b40ee3f1e..885b6e2c0 100755 --- a/tests/Math/Geometry/Shape/D2/QuadrilateralTest.php +++ b/tests/Math/Geometry/Shape/D2/QuadrilateralTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Math\Geometry\Shape\D2; use phpOMS\Math\Geometry\Shape\D2\Quadrilateral; /** - * @testdox phpOMS\tests\Math\Geometry\Shape\D2\QuadrilateralTest: Quadrilateral shape - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Geometry\Shape\D2\Quadrilateral::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Geometry\Shape\D2\QuadrilateralTest: Quadrilateral shape')] final class QuadrilateralTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The area can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Quadrilateral - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The area can be calculated')] public function testArea() : void { self::assertEqualsWithDelta(10.78, Quadrilateral::getSurfaceFromSidesAndAngle(4.0, 2.0, 4.0, 3.5, 106.56), 0.01); diff --git a/tests/Math/Geometry/Shape/D2/RectangleTest.php b/tests/Math/Geometry/Shape/D2/RectangleTest.php index 81ac87cd4..1f32858ad 100755 --- a/tests/Math/Geometry/Shape/D2/RectangleTest.php +++ b/tests/Math/Geometry/Shape/D2/RectangleTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,37 +17,28 @@ namespace phpOMS\tests\Math\Geometry\Shape\D2; use phpOMS\Math\Geometry\Shape\D2\Rectangle; /** - * @testdox phpOMS\tests\Math\Geometry\Shape\D2\RectangleTest: Rectangle shape - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Geometry\Shape\D2\Rectangle::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Geometry\Shape\D2\RectangleTest: Rectangle shape')] final class RectangleTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The surface can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Rectangle - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The surface can be calculated')] public function testSurface() : void { self::assertEqualsWithDelta(10, Rectangle::getSurface(5, 2), 0.001); } - /** - * @testdox The perimeter can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Rectangle - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The perimeter can be calculated')] public function testPerimeter() : void { self::assertEqualsWithDelta(10, Rectangle::getPerimeter(2, 3), 0.001); } - /** - * @testdox The diagonal can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Rectangle - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The diagonal can be calculated')] public function testDiagonal() : void { self::assertEqualsWithDelta(32.7, Rectangle::getDiagonal(30, 13), 0.01); diff --git a/tests/Math/Geometry/Shape/D2/TrapezoidTest.php b/tests/Math/Geometry/Shape/D2/TrapezoidTest.php index 64fb1e266..a56fca9df 100755 --- a/tests/Math/Geometry/Shape/D2/TrapezoidTest.php +++ b/tests/Math/Geometry/Shape/D2/TrapezoidTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,47 +17,35 @@ namespace phpOMS\tests\Math\Geometry\Shape\D2; use phpOMS\Math\Geometry\Shape\D2\Trapezoid; /** - * @testdox phpOMS\tests\Math\Geometry\Shape\D2\TrapezoidTest: Trapezoid shape - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Geometry\Shape\D2\Trapezoid::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Geometry\Shape\D2\TrapezoidTest: Trapezoid shape')] final class TrapezoidTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The surface can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Trapezoid - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The surface can be calculated')] public function testSurface() : void { self::assertEqualsWithDelta(10, Trapezoid::getSurface(2, 3, 4), 0.001); } - /** - * @testdox The perimeter can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Trapezoid - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The perimeter can be calculated')] public function testPerimeter() : void { self::assertEqualsWithDelta(14, Trapezoid::getPerimeter(2, 3, 4, 5), 0.001); } - /** - * @testdox The height can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Trapezoid - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The height can be calculated')] public function testHeight() : void { self::assertEqualsWithDelta(4, Trapezoid::getHeight(10, 2, 3), 0.001); } - /** - * @testdox The side lengths can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Trapezoid - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The side lengths can be calculated')] public function testSideLength() : void { self::assertEqualsWithDelta(2, Trapezoid::getA(10, 4, 3), 0.001); diff --git a/tests/Math/Geometry/Shape/D2/TriangleTest.php b/tests/Math/Geometry/Shape/D2/TriangleTest.php index 6efadee92..ad2789e14 100755 --- a/tests/Math/Geometry/Shape/D2/TriangleTest.php +++ b/tests/Math/Geometry/Shape/D2/TriangleTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,47 +17,35 @@ namespace phpOMS\tests\Math\Geometry\Shape\D2; use phpOMS\Math\Geometry\Shape\D2\Triangle; /** - * @testdox phpOMS\tests\Math\Geometry\Shape\D2\TriangleTest: Triangle shape - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Geometry\Shape\D2\Triangle::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Geometry\Shape\D2\TriangleTest: Triangle shape')] final class TriangleTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The surface can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Triangle - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The surface can be calculated')] public function testSurface() : void { self::assertEqualsWithDelta(3, Triangle::getSurface(2, 3), 0.001); } - /** - * @testdox The perimeter can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Triangle - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The perimeter can be calculated')] public function testPerimeter() : void { self::assertEqualsWithDelta(9, Triangle::getPerimeter(2, 3, 4), 0.001); } - /** - * @testdox The height can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Triangle - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The height can be calculated')] public function testHeight() : void { self::assertEqualsWithDelta(3, Triangle::getHeight(3, 2), 0.001); } - /** - * @testdox The hypotenuse can be calculated - * @covers phpOMS\Math\Geometry\Shape\D2\Triangle - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The hypotenuse can be calculated')] public function testHypot() : void { self::assertEqualsWithDelta(5, Triangle::getHypot(4, 3), 0.001); diff --git a/tests/Math/Geometry/Shape/D3/ConeTest.php b/tests/Math/Geometry/Shape/D3/ConeTest.php index 52751c194..77e51531d 100755 --- a/tests/Math/Geometry/Shape/D3/ConeTest.php +++ b/tests/Math/Geometry/Shape/D3/ConeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,47 +17,35 @@ namespace phpOMS\tests\Math\Geometry\Shape\D3; use phpOMS\Math\Geometry\Shape\D3\Cone; /** - * @testdox phpOMS\tests\Math\Geometry\Shape\D3\ConeTest: Cone shape - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Geometry\Shape\D3\Cone::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Geometry\Shape\D3\ConeTest: Cone shape')] final class ConeTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The volume can be calculated - * @covers phpOMS\Math\Geometry\Shape\D3\Cone - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The volume can be calculated')] public function testVolume() : void { self::assertEqualsWithDelta(12.57, Cone::getVolume(2, 3), 0.01); } - /** - * @testdox The surface can be calculated - * @covers phpOMS\Math\Geometry\Shape\D3\Cone - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The surface can be calculated')] public function testSurface() : void { self::assertEqualsWithDelta(35.22, Cone::getSurface(2, 3), 0.01); } - /** - * @testdox The slant height can be calculated - * @covers phpOMS\Math\Geometry\Shape\D3\Cone - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The slant height can be calculated')] public function testSlantHeight() : void { self::assertEqualsWithDelta(3.61, Cone::getSlantHeight(2, 3), 0.01); } - /** - * @testdox The height can be calculated with the volume - * @covers phpOMS\Math\Geometry\Shape\D3\Cone - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The height can be calculated with the volume')] public function testHeightFromVolume() : void { self::assertEqualsWithDelta(3, Cone::getHeightFromVolume(12.57, 2), 0.01); diff --git a/tests/Math/Geometry/Shape/D3/CuboidTest.php b/tests/Math/Geometry/Shape/D3/CuboidTest.php index 1d81a630c..8d1798919 100755 --- a/tests/Math/Geometry/Shape/D3/CuboidTest.php +++ b/tests/Math/Geometry/Shape/D3/CuboidTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,27 +17,21 @@ namespace phpOMS\tests\Math\Geometry\Shape\D3; use phpOMS\Math\Geometry\Shape\D3\Cuboid; /** - * @testdox phpOMS\tests\Math\Geometry\Shape\D3\CuboidTest: Cuboid shape - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Geometry\Shape\D3\Cuboid::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Geometry\Shape\D3\CuboidTest: Cuboid shape')] final class CuboidTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The volume can be calculated - * @covers phpOMS\Math\Geometry\Shape\D3\Cuboid - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The volume can be calculated')] public function testVolume() : void { self::assertEqualsWithDelta(200, Cuboid::getVolume(10, 5, 4), 0.001); } - /** - * @testdox The surface can be calculated - * @covers phpOMS\Math\Geometry\Shape\D3\Cuboid - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The surface can be calculated')] public function testSurface() : void { self::assertEqualsWithDelta(220, Cuboid::getSurface(10, 5, 4), 0.001); diff --git a/tests/Math/Geometry/Shape/D3/CylinderTest.php b/tests/Math/Geometry/Shape/D3/CylinderTest.php index bfd3d12de..424cf6c96 100755 --- a/tests/Math/Geometry/Shape/D3/CylinderTest.php +++ b/tests/Math/Geometry/Shape/D3/CylinderTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,37 +17,28 @@ namespace phpOMS\tests\Math\Geometry\Shape\D3; use phpOMS\Math\Geometry\Shape\D3\Cylinder; /** - * @testdox phpOMS\tests\Math\Geometry\Shape\D3\CylinderTest: Cylinder shape - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Geometry\Shape\D3\Cylinder::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Geometry\Shape\D3\CylinderTest: Cylinder shape')] final class CylinderTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The volume can be calculated - * @covers phpOMS\Math\Geometry\Shape\D3\Cylinder - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The volume can be calculated')] public function testVolume() : void { self::assertEqualsWithDelta(37.7, Cylinder::getVolume(2, 3), 0.01); } - /** - * @testdox The surface can be calculated - * @covers phpOMS\Math\Geometry\Shape\D3\Cylinder - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The surface can be calculated')] public function testSurface() : void { self::assertEqualsWithDelta(62.83, Cylinder::getSurface(2, 3), 0.01); } - /** - * @testdox The lateral surface can be calculated - * @covers phpOMS\Math\Geometry\Shape\D3\Cylinder - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The lateral surface can be calculated')] public function testLateralSurface() : void { self::assertEqualsWithDelta(37.7, Cylinder::getLateralSurface(2, 3), 0.01); diff --git a/tests/Math/Geometry/Shape/D3/PrismTest.php b/tests/Math/Geometry/Shape/D3/PrismTest.php index 9e840b4ae..3518bd93e 100755 --- a/tests/Math/Geometry/Shape/D3/PrismTest.php +++ b/tests/Math/Geometry/Shape/D3/PrismTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,37 +17,28 @@ namespace phpOMS\tests\Math\Geometry\Shape\D3; use phpOMS\Math\Geometry\Shape\D3\Prism; /** - * @testdox phpOMS\tests\Math\Geometry\Shape\D3\PrismTest: Prism shape - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Geometry\Shape\D3\Prism::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Geometry\Shape\D3\PrismTest: Prism shape')] final class PrismTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The volume can be calculated with the length - * @covers phpOMS\Math\Geometry\Shape\D3\Prism - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The volume can be calculated with the length')] public function testVolumeByLength() : void { self::assertEqualsWithDelta(3 * 3 * 12, Prism::getVolumeRegularLength(3, 4, 12), 0.01); } - /** - * @testdox The volume can be calculated with the radius - * @covers phpOMS\Math\Geometry\Shape\D3\Prism - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The volume can be calculated with the radius')] public function testVolumeByRadius() : void { self::assertEqualsWithDelta(3 * 3 * 12, Prism::getVolumeRegularRadius(1.5, 4, 12), 0.01); } - /** - * @testdox The surface can be calculated - * @covers phpOMS\Math\Geometry\Shape\D3\Prism - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The surface can be calculated')] public function testSurface() : void { self::assertEqualsWithDelta(3 * 3 * 2 + 3 * 12 * 4, Prism::getSurfaceRegularLength(3, 4, 12), 0.01); diff --git a/tests/Math/Geometry/Shape/D3/RectangularPyramidTest.php b/tests/Math/Geometry/Shape/D3/RectangularPyramidTest.php index 568e0a0ad..ac9efb1da 100755 --- a/tests/Math/Geometry/Shape/D3/RectangularPyramidTest.php +++ b/tests/Math/Geometry/Shape/D3/RectangularPyramidTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,37 +17,28 @@ namespace phpOMS\tests\Math\Geometry\Shape\D3; use phpOMS\Math\Geometry\Shape\D3\RectangularPyramid; /** - * @testdox phpOMS\tests\Math\Geometry\Shape\D3\RectangularPyramidTest: Rectangular pyramid shape - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Geometry\Shape\D3\RectangularPyramid::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Geometry\Shape\D3\RectangularPyramidTest: Rectangular pyramid shape')] final class RectangularPyramidTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The volume can be calculated - * @covers phpOMS\Math\Geometry\Shape\D3\RectangularPyramid - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The volume can be calculated')] public function testVolume() : void { self::assertEqualsWithDelta(8, RectangularPyramid::getVolume(2, 3, 4), 0.01); } - /** - * @testdox The surface can be calculated - * @covers phpOMS\Math\Geometry\Shape\D3\RectangularPyramid - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The surface can be calculated')] public function testSurface() : void { self::assertEqualsWithDelta(26.91, RectangularPyramid::getSurface(2, 3, 4), 0.01); } - /** - * @testdox The lateral surface can be calculated - * @covers phpOMS\Math\Geometry\Shape\D3\RectangularPyramid - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The lateral surface can be calculated')] public function testLateralSurface() : void { self::assertEqualsWithDelta(20.91, RectangularPyramid::getLateralSurface(2, 3, 4), 0.01); diff --git a/tests/Math/Geometry/Shape/D3/SphereTest.php b/tests/Math/Geometry/Shape/D3/SphereTest.php index 9a31f8c71..9805e0b0a 100755 --- a/tests/Math/Geometry/Shape/D3/SphereTest.php +++ b/tests/Math/Geometry/Shape/D3/SphereTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,71 +17,53 @@ namespace phpOMS\tests\Math\Geometry\Shape\D3; use phpOMS\Math\Geometry\Shape\D3\Sphere; /** - * @testdox phpOMS\tests\Math\Geometry\Shape\D3\SphereTest: Sphere shape - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Geometry\Shape\D3\Sphere::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Geometry\Shape\D3\SphereTest: Sphere shape')] final class SphereTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The volume can be calculated - * @covers phpOMS\Math\Geometry\Shape\D3\Sphere - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The volume can be calculated')] public function testVolume() : void { $sphere = new Sphere(3); self::assertEqualsWithDelta(113.1, $sphere->getVolume(), 0.1); } - /** - * @testdox The surface can be calculated - * @covers phpOMS\Math\Geometry\Shape\D3\Sphere - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The surface can be calculated')] public function testSurface() : void { $sphere = new Sphere(3); self::assertEqualsWithDelta(113.1, $sphere->getSurface(), 0.1); } - /** - * @testdox The distance on a sphere can be calculated - * @covers phpOMS\Math\Geometry\Shape\D3\Sphere - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The distance on a sphere can be calculated')] public function testDistanceOnSphere() : void { self::assertEqualsWithDelta(422740, Sphere::distance2PointsOnSphere(32.9697, -96.80322, 29.46786, -98.53506), 50); } - /** - * @testdox The sphere can be created by its radius - * @covers phpOMS\Math\Geometry\Shape\D3\Sphere - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The sphere can be created by its radius')] public function testGetSphereByRadius() : void { $sphere = Sphere::byRadius(3); self::assertEqualsWithDelta(3, $sphere->getRadius(), 0.1); } - /** - * @testdox The sphere can be created by its volume - * @covers phpOMS\Math\Geometry\Shape\D3\Sphere - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The sphere can be created by its volume')] public function testGetSphereByVolume() : void { $sphere = Sphere::byVolume(4); self::assertEqualsWithDelta(4, $sphere->getVolume(), 0.1); } - /** - * @testdox The sphere can be created by its surface - * @covers phpOMS\Math\Geometry\Shape\D3\Sphere - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The sphere can be created by its surface')] public function testGetSphereBySurface() : void { $sphere = Sphere::bySurface(5); diff --git a/tests/Math/Geometry/Shape/D3/TetrahedronTest.php b/tests/Math/Geometry/Shape/D3/TetrahedronTest.php index 4e3f94370..e16999cf0 100755 --- a/tests/Math/Geometry/Shape/D3/TetrahedronTest.php +++ b/tests/Math/Geometry/Shape/D3/TetrahedronTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,37 +17,28 @@ namespace phpOMS\tests\Math\Geometry\Shape\D3; use phpOMS\Math\Geometry\Shape\D3\Tetrahedron; /** - * @testdox phpOMS\tests\Math\Geometry\Shape\D3\TetrahedronTest: Tetrahedron shape - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Geometry\Shape\D3\Tetrahedron::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Geometry\Shape\D3\TetrahedronTest: Tetrahedron shape')] final class TetrahedronTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The volume can be calculated - * @covers phpOMS\Math\Geometry\Shape\D3\Tetrahedron - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The volume can be calculated')] public function testVolume() : void { self::assertEqualsWithDelta(3.18, Tetrahedron::getVolume(3), 0.01); } - /** - * @testdox The surface can be calculated - * @covers phpOMS\Math\Geometry\Shape\D3\Tetrahedron - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The surface can be calculated')] public function testSurface() : void { self::assertEqualsWithDelta(15.59, Tetrahedron::getSurface(3), 0.01); } - /** - * @testdox The face area can be calculated - * @covers phpOMS\Math\Geometry\Shape\D3\Tetrahedron - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The face area can be calculated')] public function testFaceArea() : void { self::assertEqualsWithDelta(3.9, Tetrahedron::getFaceArea(3), 0.01); diff --git a/tests/Math/Matrix/CholeskyDecompositionTest.php b/tests/Math/Matrix/CholeskyDecompositionTest.php index 22f6546a5..ad808a7f5 100755 --- a/tests/Math/Matrix/CholeskyDecompositionTest.php +++ b/tests/Math/Matrix/CholeskyDecompositionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ use phpOMS\Math\Matrix\Matrix; use phpOMS\Math\Matrix\Vector; /** - * @testdox phpOMS\tests\Math\Matrix\CholeskyDecompositionTest: Cholesky decomposition - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Matrix\CholeskyDecomposition::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Matrix\CholeskyDecompositionTest: Cholesky decomposition')] final class CholeskyDecompositionTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The decomposition can be created and the original matrix can be computed - * @covers phpOMS\Math\Matrix\CholeskyDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The decomposition can be created and the original matrix can be computed')] public function testDecomposition() : void { $A = new Matrix(); @@ -50,11 +47,8 @@ final class CholeskyDecompositionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The decomposition matrix has the expected values - * @covers phpOMS\Math\Matrix\CholeskyDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The decomposition matrix has the expected values')] public function testL() : void { $A = new Matrix(); @@ -73,11 +67,8 @@ final class CholeskyDecompositionTest extends \PHPUnit\Framework\TestCase ], $cholesky->getL()->toArray(), 0.2); } - /** - * @testdox A matrix can be checked for symmetric positivity - * @covers phpOMS\Math\Matrix\CholeskyDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A matrix can be checked for symmetric positivity')] public function testSymmetricPositive() : void { $A = new Matrix(); @@ -103,11 +94,8 @@ final class CholeskyDecompositionTest extends \PHPUnit\Framework\TestCase self::assertTrue($choleskyB->isSpd()); } - /** - * @testdox The equation Ax = b can be solved - * @covers phpOMS\Math\Matrix\CholeskyDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The equation Ax = b can be solved')] public function testSolve() : void { $A = new Matrix(); @@ -124,11 +112,8 @@ final class CholeskyDecompositionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta([[1], [2], [3]], $cholesky->solve($vec)->toArray(), 0.2); } - /** - * @testdox A invalid vector throws a InvalidDimensionException - * @covers phpOMS\Math\Matrix\CholeskyDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid vector throws a InvalidDimensionException')] public function testInvalidDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); diff --git a/tests/Math/Matrix/EigenvalueDecompositionTest.php b/tests/Math/Matrix/EigenvalueDecompositionTest.php index 6d142b05d..bb823c9c6 100755 --- a/tests/Math/Matrix/EigenvalueDecompositionTest.php +++ b/tests/Math/Matrix/EigenvalueDecompositionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,17 +18,14 @@ use phpOMS\Math\Matrix\EigenvalueDecomposition; use phpOMS\Math\Matrix\Matrix; /** - * @testdox phpOMS\tests\Math\Matrix\EigenvalueDecompositionTest: Eigenvalue decomposition - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Matrix\EigenvalueDecomposition::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Matrix\EigenvalueDecompositionTest: Eigenvalue decomposition')] final class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A matrix can be checked for symmetry - * @covers phpOMS\Math\Matrix\EigenvalueDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A matrix can be checked for symmetry')] public function testSymmetricSymmetryMatrix() : void { $A = new Matrix(); @@ -54,11 +51,8 @@ final class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase self::assertFalse($eigB->isSymmetric()); } - /** - * @testdox The eigenvalues can be calculated for a symmetric matrix - * @covers phpOMS\Math\Matrix\EigenvalueDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The eigenvalues can be calculated for a symmetric matrix')] public function testSymmetricMatrixEigenvalues() : void { $A = new Matrix(); @@ -74,11 +68,8 @@ final class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta([0, 0, 0], $eig->getImagEigenvalues()->toArray(), 0.1); } - /** - * @testdox The V matrix of the decomposition can be calculated for a symmetric matrix - * @covers phpOMS\Math\Matrix\EigenvalueDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The V matrix of the decomposition can be calculated for a symmetric matrix')] public function testSymmetricMatrixV() : void { $A = new Matrix(); @@ -97,11 +88,8 @@ final class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase ], $eig->getV()->toArray(), 0.2); } - /** - * @testdox The D matrix of the decomposition can be calculated for a symmetric matrix - * @covers phpOMS\Math\Matrix\EigenvalueDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The D matrix of the decomposition can be calculated for a symmetric matrix')] public function testSymmetricMatrixD() : void { $A = new Matrix(); @@ -120,11 +108,8 @@ final class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase ], $eig->getD()->toArray(), 0.2); } - /** - * @testdox The eigenvalues can be calculated for a none-symmetric matrix - * @covers phpOMS\Math\Matrix\EigenvalueDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The eigenvalues can be calculated for a none-symmetric matrix')] public function testNonSymmetricMatrixEigenvalues() : void { $A = new Matrix(); @@ -140,11 +125,6 @@ final class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta([0, 0, 0], $eig->getImagEigenvalues()->toArray(), 0.1); } - /** - * @testdox The V matrix of the decomposition can be calculated for a none-symmetric matrix - * @covers phpOMS\Math\Matrix\EigenvalueDecomposition - * @group framework - */ /* Testing for this makes little sense, since this can change depending on the algorithm, precision etc. It's much more important to check the identity A = VDV' which is done in the test "testCompositeNonSymmetric" @@ -166,12 +146,8 @@ final class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase ], $eig->getV()->toArray(), 0.2); } */ - - /** - * @testdox The D matrix of the decomposition can be calculated for a none-symmetric matrix - * @covers phpOMS\Math\Matrix\EigenvalueDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The D matrix of the decomposition can be calculated for a none-symmetric matrix')] public function testNonSymmetricMatrixD() : void { $A = new Matrix(); @@ -190,11 +166,8 @@ final class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase ], $eig->getD()->toArray(), 0.2); } - /** - * @testdox The decomposition can be created and the original matrix can be computed for a symmetric matrix - * @covers phpOMS\Math\Matrix\EigenvalueDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The decomposition can be created and the original matrix can be computed for a symmetric matrix')] public function testCompositeSymmetric() : void { $A = new Matrix(); @@ -215,11 +188,8 @@ final class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase , 0.2); } - /** - * @testdox The decomposition can be created and the original matrix can be computed for a none-symmetric matrix - * @covers phpOMS\Math\Matrix\EigenvalueDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The decomposition can be created and the original matrix can be computed for a none-symmetric matrix')] public function testCompositeNonSymmetric() : void { $A = new Matrix(); @@ -241,10 +211,7 @@ final class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Matrix\EigenvalueDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testComplexEigenvalueDecomposition() : void { $A = new Matrix(); @@ -263,10 +230,7 @@ final class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta([2, -2], $eig->getImagEigenvalues()->toArray(), 0.1); } - /** - * @covers phpOMS\Math\Matrix\EigenvalueDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testComplexDivision() : void { $A = new Matrix(); @@ -287,10 +251,7 @@ final class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta([4.49865, -4.49865, 0.0], $eig->getImagEigenvalues()->toArray(), 0.1); } - /** - * @covers phpOMS\Math\Matrix\EigenvalueDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testComplexDivision2() : void { $A = new Matrix(); @@ -311,10 +272,7 @@ final class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta([0.0, 4.7940, -4.7940], $eig->getImagEigenvalues()->toArray(), 0.1); } - /** - * @covers phpOMS\Math\Matrix\EigenvalueDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testComplexDivision3() : void { $A = new Matrix(); @@ -338,10 +296,7 @@ final class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta([14.8641, -14.8641, 5.6595, -5.6595], $eig->getImagEigenvalues()->toArray(), 0.1); } - /** - * @covers phpOMS\Math\Matrix\EigenvalueDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testComplexDivision4() : void { $A = new Matrix(); diff --git a/tests/Math/Matrix/Exception/InvalidDimensionExceptionTest.php b/tests/Math/Matrix/Exception/InvalidDimensionExceptionTest.php index b87a3a6a0..7f3d07349 100755 --- a/tests/Math/Matrix/Exception/InvalidDimensionExceptionTest.php +++ b/tests/Math/Matrix/Exception/InvalidDimensionExceptionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Math\Matrix\Exception\InvalidDimensionException; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class)] final class InvalidDimensionExceptionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Matrix\Exception\InvalidDimensionException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testException() : void { self::assertInstanceOf(\UnexpectedValueException::class, new InvalidDimensionException('')); diff --git a/tests/Math/Matrix/IdentityMatrixTest.php b/tests/Math/Matrix/IdentityMatrixTest.php index 1dbae5875..e8f42a9b4 100755 --- a/tests/Math/Matrix/IdentityMatrixTest.php +++ b/tests/Math/Matrix/IdentityMatrixTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Math\Matrix; use phpOMS\Math\Matrix\IdentityMatrix; /** - * @testdox phpOMS\tests\Math\Matrix\IdentityMatrixTest: Identity matrix - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Matrix\IdentityMatrix::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Matrix\IdentityMatrixTest: Identity matrix')] final class IdentityMatrixTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The identity matrix is the identity - * @covers phpOMS\Math\Matrix\IdentityMatrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The identity matrix is the identity')] public function testIdentity() : void { $id = new IdentityMatrix(5); diff --git a/tests/Math/Matrix/LUDecompositionTest.php b/tests/Math/Matrix/LUDecompositionTest.php index 5bd43e149..72a2423c7 100755 --- a/tests/Math/Matrix/LUDecompositionTest.php +++ b/tests/Math/Matrix/LUDecompositionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ use phpOMS\Math\Matrix\Matrix; use phpOMS\Math\Matrix\Vector; /** - * @testdox phpOMS\tests\Math\Matrix\LUDecompositionTest: LU decomposition - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Matrix\LUDecomposition::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Matrix\LUDecompositionTest: LU decomposition')] final class LUDecompositionTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The L matrix of the decomposition can be calculated - * @covers phpOMS\Math\Matrix\LUDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The L matrix of the decomposition can be calculated')] public function testL() : void { $B = new Matrix(); @@ -48,11 +45,8 @@ final class LUDecompositionTest extends \PHPUnit\Framework\TestCase ], $lu->getL()->toArray(), 0.2); } - /** - * @testdox The U matrix of the decomposition can be calculated - * @covers phpOMS\Math\Matrix\LUDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The U matrix of the decomposition can be calculated')] public function testU() : void { $B = new Matrix(); @@ -71,11 +65,8 @@ final class LUDecompositionTest extends \PHPUnit\Framework\TestCase ], $lu->getU()->toArray(), 0.2); } - /** - * @testdox The matrix can be checked for singularity - * @covers phpOMS\Math\Matrix\LUDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The matrix can be checked for singularity')] public function testSingularity() : void { $A = new Matrix(); @@ -101,11 +92,8 @@ final class LUDecompositionTest extends \PHPUnit\Framework\TestCase self::assertFalse($luB->isNonSingular()); } - /** - * @testdox The equation Ax = b can be solved for a none-singular matrix - * @covers phpOMS\Math\Matrix\LUDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The equation Ax = b can be solved for a none-singular matrix')] public function testSolve() : void { $B = new Matrix(); @@ -122,11 +110,8 @@ final class LUDecompositionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta([[1], [2], [3]], $lu->solve($vec)->toArray(), 0.2); } - /** - * @testdox The pivots of the decomposition can be calculated - * @covers phpOMS\Math\Matrix\LUDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The pivots of the decomposition can be calculated')] public function testPivot() : void { $B = new Matrix(); @@ -141,11 +126,8 @@ final class LUDecompositionTest extends \PHPUnit\Framework\TestCase self::assertEquals([0, 1, 2], $lu->getPivot()); } - /** - * @testdox The equation Ax = b can be solved for a singular matrix - * @covers phpOMS\Math\Matrix\LUDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The equation Ax = b can be solved for a singular matrix')] public function testSolveOfSingularMatrix() : void { $this->expectException(\Exception::class); @@ -165,11 +147,8 @@ final class LUDecompositionTest extends \PHPUnit\Framework\TestCase $lu->solve($vec); } - /** - * @testdox The decomposition can be created and the original matrix can be computed - * @covers phpOMS\Math\Matrix\LUDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The decomposition can be created and the original matrix can be computed')] public function testComposition() : void { $A = new Matrix(); @@ -190,11 +169,8 @@ final class LUDecompositionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The determinat can be calculated - * @covers phpOMS\Math\Matrix\LUDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The determinat can be calculated')] public function testDet() : void { $B = new Matrix(); @@ -208,11 +184,8 @@ final class LUDecompositionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(1775.0, $lu->det(), 0.1); } - /** - * @testdox A invalid vector throws a InvalidDimensionException - * @covers phpOMS\Math\Matrix\LUDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid vector throws a InvalidDimensionException')] public function testInvalidDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); diff --git a/tests/Math/Matrix/MatrixTest.php b/tests/Math/Matrix/MatrixTest.php index 32f0776e4..5b5c1ff72 100755 --- a/tests/Math/Matrix/MatrixTest.php +++ b/tests/Math/Matrix/MatrixTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,10 +18,10 @@ use phpOMS\Math\Matrix\Matrix; use phpOMS\Math\Matrix\Vector; /** - * @testdox phpOMS\tests\Math\Matrix\MatrixTest: Matrix operations - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Matrix\Matrix::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Matrix\MatrixTest: Matrix operations')] final class MatrixTest extends \PHPUnit\Framework\TestCase { protected $A = null; @@ -51,42 +51,30 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase $this->C = $this->A->mult($this->B); } - /** - * @testdox A matrix can return its dimension - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A matrix can return its dimension')] public function testBase() : void { self::assertEquals(2, $this->A->getM()); self::assertEquals(3, $this->A->getN()); } - /** - * @testdox A matrix can be right-hand multiplied with a matrix - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A matrix can be right-hand multiplied with a matrix')] public function testMultMatrix() : void { self::assertEquals([[0, -5], [-6, -7]], $this->C->toArray()); } - /** - * @testdox A matrix can be right-hand multiplied with a scalar - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A matrix can be right-hand multiplied with a scalar')] public function testMultMatrixScalar() : void { self::assertEquals([[0, -10], [-12, -14]], $this->C->mult(2)->toArray()); } - /** - * @testdox A scalar can be added to every matrix element - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A scalar can be added to every matrix element')] public function testAddScalar() : void { $A = new Matrix(); @@ -95,11 +83,8 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase self::assertEquals([[1 + 2, 2 + 2], [3 + 2, 4 + 2]], $A->add(2)->toArray()); } - /** - * @testdox A scalar can be subtracted from every matrix element - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A scalar can be subtracted from every matrix element')] public function testSubScalar() : void { $A = new Matrix(); @@ -108,11 +93,8 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase self::assertEquals([[1 - 2, 2 - 2], [3 - 2, 4 - 2]], $A->sub(2)->toArray()); } - /** - * @testdox Two matrices can be added to each other - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Two matrices can be added to each other')] public function testAddMatrix() : void { $A = new Matrix(); @@ -124,11 +106,8 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase self::assertEquals([[1 + 1, 2 + 2], [3 + 3, 4 + 4]], $A->add($B)->toArray()); } - /** - * @testdox Two matrices can be subtracted from each other - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Two matrices can be subtracted from each other')] public function testSubMatrix() : void { $A = new Matrix(); @@ -140,11 +119,8 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase self::assertEquals([[1 - 1, 2 - 2], [3 - 3, 4 - 4]], $A->sub($B)->toArray()); } - /** - * @testdox The determinant of a matrix can be calculated - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The determinant of a matrix can be calculated')] public function testDet() : void { $B = new Matrix(); @@ -157,11 +133,8 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase self::assertEquals(-306, $B->det()); } - /** - * @testdox A symmetric matrix can be validated for symmetry - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A symmetric matrix can be validated for symmetry')] public function testSymmetry() : void { $B = new Matrix(); @@ -174,11 +147,8 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase self::assertTrue($B->isSymmetric()); } - /** - * @testdox A none-symmetric matrix cannot be validated for symmetry - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-symmetric matrix cannot be validated for symmetry')] public function testInvalidSymmetry() : void { $C = new Matrix(); @@ -191,11 +161,8 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase self::assertFalse($C->isSymmetric()); } - /** - * @testdox A matrix can be transposed - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A matrix can be transposed')] public function testTranspose() : void { $B = new Matrix(); @@ -207,11 +174,8 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase self::assertEquals([[6, 4], [1, -2], [1, 5],], $B->transpose()->toArray()); } - /** - * @testdox A matrix equation Ax = b can be solved for x - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A matrix equation Ax = b can be solved for x')] public function testSolve() : void { $A = new Matrix(); @@ -227,11 +191,8 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta([[1], [2], [3]], $A->solve($vec)->toArray(), 0.2); } - /** - * @testdox The rank of a matrix can be calculated - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The rank of a matrix can be calculated')] public function testRank() : void { $B = new Matrix(); @@ -264,10 +225,7 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase self::assertEquals(2, $B->rank()); } - /** - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInverse() : void { $A = new Matrix(); @@ -284,20 +242,14 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase ], $A->inverse()->toArray(), 0.2); } - /** - * @testdox The upper triangular matrix can be calculated - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The upper triangular matrix can be calculated')] public function testUpperTriangular() : void { self::assertEquals([[-6, -7], [0, -5]], $this->C->upperTriangular()->toArray()); } - /** - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testLowerTriangular() : void { self::markTestIncomplete(); @@ -305,11 +257,8 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase //self::assertEquals([], $this->C->diagonalize()->toArray()); } - /** - * @testdox The matrix elements can be set and returned - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The matrix elements can be set and returned')] public function testMatrixInputOutput() : void { $id = new Matrix(); @@ -338,11 +287,8 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A matrix can be accessed like a 1-dimensional array - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A matrix can be accessed like a 1-dimensional array')] public function testArrayAccess() : void { $A = new Matrix(); @@ -369,11 +315,8 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase self::assertFalse(isset($A[6])); } - /** - * @testdox Sub matrices can be extracted from a matrix - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Sub matrices can be extracted from a matrix')] public function testMatrixExtract() : void { $A = new Matrix(); @@ -405,11 +348,8 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Setting a matrix element outside of the dimensions throws a InvalidDimensionException - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Setting a matrix element outside of the dimensions throws a InvalidDimensionException')] public function testInvalidSetIndexException() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); @@ -422,11 +362,8 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase $id->set(99, 99, 99); } - /** - * @testdox Returning a matrix element outside of the dimensions throws a InvalidDimensionException - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Returning a matrix element outside of the dimensions throws a InvalidDimensionException')] public function testInvalidGetIndexException() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); @@ -439,11 +376,8 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase $id->get(99, 99); } - /** - * @testdox Adding a matrix with a different dimension to a matrix throws a InvalidDimensionException - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Adding a matrix with a different dimension to a matrix throws a InvalidDimensionException')] public function testInvalidDimensionAdd() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); @@ -457,11 +391,8 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase $A->add($B); } - /** - * @testdox Subtracting a matrix from a different dimension to a matrix throws a InvalidDimensionException - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Subtracting a matrix from a different dimension to a matrix throws a InvalidDimensionException')] public function testInvalidDimensionSub() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); @@ -475,11 +406,8 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase $A->sub($B); } - /** - * @testdox Multiplying a matrix with a different n x m dimension to a matrix throws a InvalidDimensionException - * @covers phpOMS\Math\Matrix\Matrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Multiplying a matrix with a different n x m dimension to a matrix throws a InvalidDimensionException')] public function testInvalidDimensionMult() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); @@ -604,6 +532,8 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase ); } + // @bug This is somehow wrong + /* public function testExp() : void { $m = Matrix::fromArray([ @@ -622,4 +552,5 @@ final class MatrixTest extends \PHPUnit\Framework\TestCase 1.0 ); } + */ } diff --git a/tests/Math/Matrix/QRDecompositionTest.php b/tests/Math/Matrix/QRDecompositionTest.php index 17c821fef..dc47b85fb 100755 --- a/tests/Math/Matrix/QRDecompositionTest.php +++ b/tests/Math/Matrix/QRDecompositionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ use phpOMS\Math\Matrix\QRDecomposition; use phpOMS\Math\Matrix\Vector; /** - * @testdox phpOMS\tests\Math\Matrix\QRDecompositionTest: QR decomposition - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Matrix\QRDecomposition::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Matrix\QRDecompositionTest: QR decomposition')] final class QRDecompositionTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A matrix can be checked if it has a full rank - * @covers phpOMS\Math\Matrix\QRDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A matrix can be checked if it has a full rank')] public function testRank() : void { $A = new Matrix(); @@ -44,11 +41,8 @@ final class QRDecompositionTest extends \PHPUnit\Framework\TestCase self::assertTrue($QR->isFullRank()); } - /** - * @testdox The Q matrix of the decomposition can be calculated - * @covers phpOMS\Math\Matrix\QRDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The Q matrix of the decomposition can be calculated')] public function testQ() : void { $A = new Matrix(); @@ -67,11 +61,8 @@ final class QRDecompositionTest extends \PHPUnit\Framework\TestCase ], $QR->getQ()->toArray(), 0.2); } - /** - * @testdox The R matrix of the decomposition can be calculated - * @covers phpOMS\Math\Matrix\QRDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The R matrix of the decomposition can be calculated')] public function testR() : void { $A = new Matrix(); @@ -90,11 +81,8 @@ final class QRDecompositionTest extends \PHPUnit\Framework\TestCase ], $QR->getR()->toArray(), 0.2); } - /** - * @testdox The decomposition can be created and the original matrix can be computed - * @covers phpOMS\Math\Matrix\QRDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The decomposition can be created and the original matrix can be computed')] public function testComposition() : void { $A = new Matrix(); @@ -115,11 +103,8 @@ final class QRDecompositionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The equation Ax = b can be solved - * @covers phpOMS\Math\Matrix\QRDecomposition - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The equation Ax = b can be solved')] public function testSolve() : void { $A = new Matrix(); diff --git a/tests/Math/Matrix/VectorTest.php b/tests/Math/Matrix/VectorTest.php index 70200aa89..9f2c55c00 100755 --- a/tests/Math/Matrix/VectorTest.php +++ b/tests/Math/Matrix/VectorTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Math\Matrix; use phpOMS\Math\Matrix\Vector; /** - * @testdox phpOMS\tests\Math\Matrix\VectorTest: Vector operations - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Matrix\Vector::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Matrix\VectorTest: Vector operations')] final class VectorTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The vector has the expected default values after initialization - * @covers phpOMS\Math\Matrix\Vector - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The vector has the expected default values after initialization')] public function testDefault() : void { self::assertInstanceOf('\phpOMS\Math\Matrix\Vector', new Vector()); @@ -37,11 +34,8 @@ final class VectorTest extends \PHPUnit\Framework\TestCase self::assertCount(5, $vec->toArray()); } - /** - * @testdox The vector values can be set and returned - * @covers phpOMS\Math\Matrix\Vector - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The vector values can be set and returned')] public function testValueInputOutput() : void { $vec = new Vector(5); @@ -53,11 +47,8 @@ final class VectorTest extends \PHPUnit\Framework\TestCase self::assertEquals(9, $vec->getV(3)); } - /** - * @testdox The vector dimension can be returned - * @covers phpOMS\Math\Matrix\Vector - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The vector dimension can be returned')] public function testDim() : void { $vec = new Vector(5); diff --git a/tests/Math/Number/ComplexTest.php b/tests/Math/Number/ComplexTest.php index a36a86420..0e632ff41 100755 --- a/tests/Math/Number/ComplexTest.php +++ b/tests/Math/Number/ComplexTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Math\Number; use phpOMS\Math\Number\Complex; /** - * @testdox phpOMS\tests\Math\Number\ComplexTest: Complex number operations - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Number\Complex::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Number\ComplexTest: Complex number operations')] final class ComplexTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The complex number has the expected default values after initialization - * @covers phpOMS\Math\Number\Complex - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The complex number has the expected default values after initialization')] public function testDefault() : void { $cpl = new Complex(); @@ -36,11 +33,8 @@ final class ComplexTest extends \PHPUnit\Framework\TestCase self::assertEquals('', $cpl->render()); } - /** - * @testdox The real and imaginary part can be set during initialization and returned - * @covers phpOMS\Math\Number\Complex - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The real and imaginary part can be set during initialization and returned')] public function testConstructorInputOutput() : void { $cpl = new Complex(1, 2); @@ -48,11 +42,8 @@ final class ComplexTest extends \PHPUnit\Framework\TestCase self::assertEquals(2, $cpl->im()); } - /** - * @testdox A complex number can be added to a complex number - * @covers phpOMS\Math\Number\Complex - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A complex number can be added to a complex number')] public function testAddComplex() : void { $cpl1 = new Complex(2, 3); @@ -61,22 +52,16 @@ final class ComplexTest extends \PHPUnit\Framework\TestCase self::assertEquals('5.00 + 7.00i', $cpl1->add($cpl2)->render()); } - /** - * @testdox A real number can be added to a complex number - * @covers phpOMS\Math\Number\Complex - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A real number can be added to a complex number')] public function testAddReal() : void { $cpl1 = new Complex(2, 3); self::assertEquals('6.00 + 3.00i', $cpl1->add(4)->render()); } - /** - * @testdox A complex number can be subtracted from a complex number - * @covers phpOMS\Math\Number\Complex - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A complex number can be subtracted from a complex number')] public function testSubComplex() : void { $cpl1 = new Complex(2, 3); @@ -85,22 +70,16 @@ final class ComplexTest extends \PHPUnit\Framework\TestCase self::assertEquals('-1.00 - 1.00i', $cpl1->sub($cpl2)->render()); } - /** - * @testdox A real number can be subtracted from a complex number - * @covers phpOMS\Math\Number\Complex - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A real number can be subtracted from a complex number')] public function testSubReal() : void { $cpl1 = new Complex(2, 3); self::assertEquals('-2.00 + 3.00i', $cpl1->sub(4)->render()); } - /** - * @testdox A complex number can be multiplied with a complex number - * @covers phpOMS\Math\Number\Complex - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A complex number can be multiplied with a complex number')] public function testMultComplex() : void { $cpl1 = new Complex(2, 3); @@ -109,22 +88,16 @@ final class ComplexTest extends \PHPUnit\Framework\TestCase self::assertEquals('-6.00 + 17.00i', $cpl1->mult($cpl2)->render()); } - /** - * @testdox A real number can be multiplied with a complex number - * @covers phpOMS\Math\Number\Complex - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A real number can be multiplied with a complex number')] public function testMultReal() : void { $cpl1 = new Complex(2, 3); self::assertEquals('8.00 + 12.00i', $cpl1->mult(4)->render()); } - /** - * @testdox A complex number can be divided by a complex number number - * @covers phpOMS\Math\Number\Complex - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A complex number can be divided by a complex number number')] public function testDivComplex() : void { $cpl1 = new Complex(2, 3); @@ -133,22 +106,16 @@ final class ComplexTest extends \PHPUnit\Framework\TestCase self::assertEquals('0.72 + 0.04i', $cpl1->div($cpl2)->render(2)); } - /** - * @testdox A complex number can be divided by a real number - * @covers phpOMS\Math\Number\Complex - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A complex number can be divided by a real number')] public function testDivReal() : void { $cpl1 = new Complex(2, 3); self::assertEquals('0.50 + 0.75i', $cpl1->div(4)->render(2)); } - /** - * @testdox A complex number can be conjugated - * @covers phpOMS\Math\Number\Complex - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A complex number can be conjugated')] public function testConjugate() : void { $cpl = new Complex(4, 3); @@ -156,11 +123,8 @@ final class ComplexTest extends \PHPUnit\Framework\TestCase self::assertEquals('4 - 3i', $cpl->conjugate()->render(0)); } - /** - * @testdox The reciprocal of a complex number can be calculated - * @covers phpOMS\Math\Number\Complex - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The reciprocal of a complex number can be calculated')] public function testReciprocal() : void { $cpl = new Complex(4, 3); @@ -168,11 +132,8 @@ final class ComplexTest extends \PHPUnit\Framework\TestCase self::assertEquals('0.16 - 0.12i', $cpl->reciprocal()->render(2)); } - /** - * @testdox A complex number can be squared - * @covers phpOMS\Math\Number\Complex - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A complex number can be squared')] public function testSquare() : void { $cpl = new Complex(4, 3); @@ -180,11 +141,8 @@ final class ComplexTest extends \PHPUnit\Framework\TestCase self::assertEquals('7.00 + 24.00i', $cpl->square()->render()); } - /** - * @testdox The real power of a complex number can be calculated - * @covers phpOMS\Math\Number\Complex - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The real power of a complex number can be calculated')] public function testPower() : void { $cpl = new Complex(4, 3); @@ -194,11 +152,8 @@ final class ComplexTest extends \PHPUnit\Framework\TestCase self::assertEquals('1.00', $cpl->pow(0)->render()); } - /** - * @testdox The absolute value of a complex number can be calculated - * @covers phpOMS\Math\Number\Complex - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The absolute value of a complex number can be calculated')] public function testAbs() : void { $cpl = new Complex(4, 3); @@ -206,11 +161,8 @@ final class ComplexTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(5, $cpl->abs(), 0.01); } - /** - * @testdox The square root of a complex number can be calculated - * @covers phpOMS\Math\Number\Complex - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The square root of a complex number can be calculated')] public function testSqrt() : void { $cpl = new Complex(4, 3); diff --git a/tests/Math/Number/IntegerTest.php b/tests/Math/Number/IntegerTest.php index a045496fa..e878642aa 100755 --- a/tests/Math/Number/IntegerTest.php +++ b/tests/Math/Number/IntegerTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Math\Number; use phpOMS\Math\Number\Integer; /** - * @testdox phpOMS\tests\Math\Number\IntegerTest: Integer operations - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Number\Integer::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Number\IntegerTest: Integer operations')] final class IntegerTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A value can be checked to be an integer - * @covers phpOMS\Math\Number\Integer - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A value can be checked to be an integer')] public function testIsInteger() : void { self::assertTrue(Integer::isInteger(4)); @@ -35,11 +32,8 @@ final class IntegerTest extends \PHPUnit\Framework\TestCase self::assertFalse(Integer::isInteger('3')); } - /** - * @testdox An integer can be factorized - * @covers phpOMS\Math\Number\Integer - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An integer can be factorized')] public function testFactorization() : void { $arr = [2, 2, 5, 5]; @@ -67,31 +61,22 @@ final class IntegerTest extends \PHPUnit\Framework\TestCase self::assertEquals([], Integer::trialFactorization(1)); } - /** - * @testdox The Pollard's Roh algorithm calculates a factor of an integer - * @covers phpOMS\Math\Number\Integer - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("The Pollard's Roh algorithm calculates a factor of an integer")] public function testPollardsRho() : void { self::assertEquals(101, Integer::pollardsRho(10403, 2, 1, 2, 2)); } - /** - * @testdox The Fermat factorization calculates a factor of an integer - * @covers phpOMS\Math\Number\Integer - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The Fermat factorization calculates a factor of an integer')] public function testFermatFactor() : void { self::assertEquals([59, 101], Integer::fermatFactor(5959)); } - /** - * @testdox A even number for the fermat factorization throws a InvalidArgumentException - * @covers phpOMS\Math\Number\Integer - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A even number for the fermat factorization throws a InvalidArgumentException')] public function testInvalidFermatParameter() : void { $this->expectException(\InvalidArgumentException::class); @@ -99,11 +84,8 @@ final class IntegerTest extends \PHPUnit\Framework\TestCase Integer::fermatFactor(8); } - /** - * @testdox The greatest common divisor can be calculated - * @covers phpOMS\Math\Number\Integer - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The greatest common divisor can be calculated')] public function testGCD() : void { self::assertEquals(4, Integer::greatestCommonDivisor(4, 4)); diff --git a/tests/Math/Number/NaturalTest.php b/tests/Math/Number/NaturalTest.php index 041479eab..802ff98d5 100755 --- a/tests/Math/Number/NaturalTest.php +++ b/tests/Math/Number/NaturalTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Math\Number; use phpOMS\Math\Number\Natural; /** - * @testdox phpOMS\tests\Math\Number\NaturalTest: Natural number operations - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Number\Natural::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Number\NaturalTest: Natural number operations')] final class NaturalTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A number can be checked to be natural - * @covers phpOMS\Math\Number\Natural - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A number can be checked to be natural')] public function testIsNatural() : void { self::assertTrue(Natural::isNatural(1235)); diff --git a/tests/Math/Number/NumberTypeTest.php b/tests/Math/Number/NumberTypeTest.php index 112e4bbf0..58ab0825f 100755 --- a/tests/Math/Number/NumberTypeTest.php +++ b/tests/Math/Number/NumberTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Math\Number\NumberType; */ final class NumberTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(9, NumberType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(NumberType::getConstants(), \array_unique(NumberType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(0, NumberType::N_INTEGER); diff --git a/tests/Math/Number/NumbersTest.php b/tests/Math/Number/NumbersTest.php index 897ae0d57..72cfaade4 100755 --- a/tests/Math/Number/NumbersTest.php +++ b/tests/Math/Number/NumbersTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Math\Number; use phpOMS\Math\Number\Numbers; /** - * @testdox phpOMS\tests\Math\Number\NumbersTest: General number utilities - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Number\Numbers::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Number\NumbersTest: General number utilities')] final class NumbersTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A number can be checked to be perfect - * @covers phpOMS\Math\Number\Numbers - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A number can be checked to be perfect')] public function testPerfect() : void { self::assertTrue(Numbers::isPerfect(496)); @@ -36,11 +33,8 @@ final class NumbersTest extends \PHPUnit\Framework\TestCase self::assertFalse(Numbers::isPerfect(100)); } - /** - * @testdox A number can be checked to be self-describing - * @covers phpOMS\Math\Number\Numbers - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A number can be checked to be self-describing')] public function testSelfdescribing() : void { self::assertFalse(Numbers::isSelfdescribing(2029)); @@ -48,11 +42,8 @@ final class NumbersTest extends \PHPUnit\Framework\TestCase self::assertTrue(Numbers::isSelfdescribing(3211000)); } - /** - * @testdox A number can be checked to be squared - * @covers phpOMS\Math\Number\Numbers - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A number can be checked to be squared')] public function testSquare() : void { self::assertTrue(Numbers::isSquare(81)); @@ -60,11 +51,8 @@ final class NumbersTest extends \PHPUnit\Framework\TestCase self::assertFalse(Numbers::isSquare(5545348)); } - /** - * @testdox The amount of trailing zeros can be counted - * @covers phpOMS\Math\Number\Numbers - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The amount of trailing zeros can be counted')] public function testZeroCounting() : void { self::assertEquals(3, Numbers::countTrailingZeros(1000)); diff --git a/tests/Math/Number/PrimeTest.php b/tests/Math/Number/PrimeTest.php index 7ab05369a..c0996da7b 100755 --- a/tests/Math/Number/PrimeTest.php +++ b/tests/Math/Number/PrimeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Math\Number; use phpOMS\Math\Number\Prime; /** - * @testdox phpOMS\tests\Math\Number\PrimeTest: Prime number utilities - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Number\Prime::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Number\PrimeTest: Prime number utilities')] final class PrimeTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A number can be checked to be a prime number - * @covers phpOMS\Math\Number\Prime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A number can be checked to be a prime number')] public function testPrime() : void { self::assertTrue(Prime::isPrime(2)); @@ -35,22 +32,16 @@ final class PrimeTest extends \PHPUnit\Framework\TestCase self::assertFalse(Prime::isPrime(998)); } - /** - * @testdox A prime number can be generated with the sieve of erathosthenes - * @covers phpOMS\Math\Number\Prime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A prime number can be generated with the sieve of erathosthenes')] public function testSieve() : void { self::assertTrue(Prime::isPrime(Prime::sieveOfEratosthenes(12)[3])); self::assertTrue(Prime::isPrime(Prime::sieveOfEratosthenes(51)[7])); } - /** - * @testdox A number can be checked to be prime with the rabin test - * @covers phpOMS\Math\Number\Prime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A number can be checked to be prime with the rabin test')] public function testRabin() : void { self::assertTrue(Prime::rabinTest(2)); @@ -60,11 +51,8 @@ final class PrimeTest extends \PHPUnit\Framework\TestCase self::assertFalse(Prime::rabinTest(998)); } - /** - * @testdox Mersenne numbers can be calculated - * @covers phpOMS\Math\Number\Prime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Mersenne numbers can be calculated')] public function testMersenne() : void { self::assertEquals(2047, Prime::mersenne(11)); @@ -72,11 +60,8 @@ final class PrimeTest extends \PHPUnit\Framework\TestCase self::assertTrue(Prime::isMersenne(Prime::mersenne(4))); } - /** - * @testdox A number can be checked to be a mersenne number - * @covers phpOMS\Math\Number\Prime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A number can be checked to be a mersenne number')] public function testIsMersenne() : void { self::assertTrue(Prime::isMersenne(8191)); diff --git a/tests/Math/Numerics/IntegrationTest.php b/tests/Math/Numerics/IntegrationTest.php index 6d6c11920..9de82189f 100755 --- a/tests/Math/Numerics/IntegrationTest.php +++ b/tests/Math/Numerics/IntegrationTest.php @@ -3,7 +3,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,19 +18,16 @@ namespace phpOMS\tests\Math\Numerics; use phpOMS\Math\Numerics\Integration; /** - * @testdox phpOMS\tests\Math\Numerics\IntegrationTest: Numeric integration - * * @internal * * Commented out assertions which take a long time with xdebug. without xdebug these are fine! */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Numerics\Integration::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Numerics\IntegrationTest: Numeric integration')] final class IntegrationTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Integration by summing up rectangle areas from the left side - * @covers phpOMS\Math\Numerics\Integration - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Integration by summing up rectangle areas from the left side')] public function testLRect() : void { self::assertEqualsWithDelta(0.235322, Integration::intLeftRect(0.0, 1.0, 100.0, function($x) { return $x ** 3; }), 0.001); @@ -39,11 +36,8 @@ final class IntegrationTest extends \PHPUnit\Framework\TestCase //self::assertEqualsWithDelta(17999991.001392, Integration::intLeftRect(0.0, 6000.0, 6000000.0, function($x) { return $x; }), 0.001); } - /** - * @testdox Integration by summing up rectangle areas from the right side - * @covers phpOMS\Math\Numerics\Integration - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Integration by summing up rectangle areas from the right side')] public function testRRect() : void { self::assertEqualsWithDelta(0.245025, Integration::intRightRect(0.0, 1.0, 100.0, function($x) { return $x ** 3; }), 0.001); @@ -52,11 +46,8 @@ final class IntegrationTest extends \PHPUnit\Framework\TestCase //self::assertEqualsWithDelta(17999997.001390, Integration::intRightRect(0.0, 6000.0, 6000000.0, function($x) { return $x; }), 0.001); } - /** - * @testdox Integration by summing up rectangle areas from the middle - * @covers phpOMS\Math\Numerics\Integration - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Integration by summing up rectangle areas from the middle')] public function testMRect() : void { self::assertEqualsWithDelta(0.240137, Integration::intMiddleRect(0.0, 1.0, 100.0, function($x) { return $x ** 3; }), 0.001); @@ -65,11 +56,8 @@ final class IntegrationTest extends \PHPUnit\Framework\TestCase //self::assertEqualsWithDelta(17999994.001391, Integration::intMiddleRect(0.0, 6000.0, 6000000.0, function($x) { return $x; }), 0.001); } - /** - * @testdox Integration by summing up trapezoid areas - * @covers phpOMS\Math\Numerics\Integration - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Integration by summing up trapezoid areas')] public function testTrapeze() : void { self::assertEqualsWithDelta(0.250025, Integration::intTrapezium(0.0, 1.0, 100.0, function($x) { return $x ** 3; }), 0.001); @@ -78,11 +66,8 @@ final class IntegrationTest extends \PHPUnit\Framework\TestCase //self::assertEqualsWithDelta(18000000.0, Integration::intTrapezium(0.0, 6000.0, 6000000.0, function($x) { return $x; }), 0.001); } - /** - * @testdox Integration by using the simpson formula - * @covers phpOMS\Math\Numerics\Integration - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Integration by using the simpson formula')] public function testSimpson() : void { self::assertEqualsWithDelta(0.25, Integration::intSimpson(0.0, 1.0, 100.0, function ($x) { return $x ** 3; }), 0.001); diff --git a/tests/Math/Numerics/Interpolation/CubicSplineInterpolationTest.php b/tests/Math/Numerics/Interpolation/CubicSplineInterpolationTest.php index 5c56eb8c6..5dcefc216 100755 --- a/tests/Math/Numerics/Interpolation/CubicSplineInterpolationTest.php +++ b/tests/Math/Numerics/Interpolation/CubicSplineInterpolationTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,17 +18,14 @@ use phpOMS\Math\Numerics\Interpolation\CubicSplineInterpolation; use phpOMS\Math\Numerics\Interpolation\DerivativeType; /** - * @testdox phpOMS\tests\Math\Numerics\Interpolation\CubicSplineInterpolationTest: Cubic spline interpolation - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Numerics\Interpolation\CubicSplineInterpolation::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Numerics\Interpolation\CubicSplineInterpolationTest: Cubic spline interpolation')] final class CubicSplineInterpolationTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The spline interpolation using the first derivative is correct - * @covers phpOMS\Math\Numerics\Interpolation\CubicSplineInterpolation - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The spline interpolation using the first derivative is correct')] public function testInterpolationFirstDerivative() : void { $interpolation = new CubicSplineInterpolation([ @@ -45,11 +42,8 @@ final class CubicSplineInterpolationTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.947888, $interpolation->interpolate(1.5), 0.1); } - /** - * @testdox The spline interpolation using the second derivative is correct - * @covers phpOMS\Math\Numerics\Interpolation\CubicSplineInterpolation - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The spline interpolation using the second derivative is correct')] public function testInterpolationSecondDerivative() : void { $interpolation = new CubicSplineInterpolation([ @@ -66,11 +60,8 @@ final class CubicSplineInterpolationTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.915345, $interpolation->interpolate(1.5), 0.1); } - /** - * @testdox The spline interpolation for out of bounds values uses linear extrapolation - * @covers phpOMS\Math\Numerics\Interpolation\CubicSplineInterpolation - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The spline interpolation for out of bounds values uses linear extrapolation')] public function testInterpolationUnderOverflow() : void { $interpolation = new CubicSplineInterpolation([ diff --git a/tests/Math/Numerics/Interpolation/LagrangeInterpolationTest.php b/tests/Math/Numerics/Interpolation/LagrangeInterpolationTest.php index f697e7525..614d7554d 100755 --- a/tests/Math/Numerics/Interpolation/LagrangeInterpolationTest.php +++ b/tests/Math/Numerics/Interpolation/LagrangeInterpolationTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Math\Numerics\Interpolation; use phpOMS\Math\Numerics\Interpolation\LagrangeInterpolation; /** - * @testdox phpOMS\tests\Math\Numerics\Interpolation\LagrangeInterpolationTest: Lagrange interpolation - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Numerics\Interpolation\LagrangeInterpolation::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Numerics\Interpolation\LagrangeInterpolationTest: Lagrange interpolation')] final class LagrangeInterpolationTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The lagrange interpolation is correct - * @covers phpOMS\Math\Numerics\Interpolation\LagrangeInterpolation - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The lagrange interpolation is correct')] public function testInterpolation() : void { $interpolation = new LagrangeInterpolation([ diff --git a/tests/Math/Numerics/Interpolation/LinearInterpolationTest.php b/tests/Math/Numerics/Interpolation/LinearInterpolationTest.php index cc6b16e2d..45b76ac51 100755 --- a/tests/Math/Numerics/Interpolation/LinearInterpolationTest.php +++ b/tests/Math/Numerics/Interpolation/LinearInterpolationTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Math\Numerics\Interpolation; use phpOMS\Math\Numerics\Interpolation\LinearInterpolation; /** - * @testdox phpOMS\tests\Math\Numerics\Interpolation\LinearInterpolationTest: Linear interpolation - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Numerics\Interpolation\LinearInterpolation::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Numerics\Interpolation\LinearInterpolationTest: Linear interpolation')] final class LinearInterpolationTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The linear interpolation is correct - * @covers phpOMS\Math\Numerics\Interpolation\LinearInterpolation - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The linear interpolation is correct')] public function testInterpolation() : void { $interpolation = new LinearInterpolation([ diff --git a/tests/Math/Optimization/SimplexTest.php b/tests/Math/Optimization/SimplexTest.php index ca9c1be16..3f4c44a42 100644 --- a/tests/Math/Optimization/SimplexTest.php +++ b/tests/Math/Optimization/SimplexTest.php @@ -3,7 +3,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,12 +18,11 @@ namespace phpOMS\tests\Math\Optimization; use phpOMS\Math\Optimization\Simplex; /** - * @testdox phpOMS\tests\Math\Optimization\SimplexTest: Numeric integration - * * @internal * * Commented out assertions which take a long time with xdebug. without xdebug these are fine! */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Optimization\SimplexTest: Numeric integration')] final class SimplexTest extends \PHPUnit\Framework\TestCase { public function testSimplexBasicInfeasible() : void diff --git a/tests/Math/Parser/EvaluatorTest.php b/tests/Math/Parser/EvaluatorTest.php index fa998aa8a..8115538f2 100755 --- a/tests/Math/Parser/EvaluatorTest.php +++ b/tests/Math/Parser/EvaluatorTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,28 +17,22 @@ namespace phpOMS\tests\Math\Parser; use phpOMS\Math\Parser\Evaluator; /** - * @testdox phpOMS\tests\Math\Parser\EvaluatorTest: Evaluator for simple math formulas - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Parser\Evaluator::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Parser\EvaluatorTest: Evaluator for simple math formulas')] final class EvaluatorTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Basic formulas using +, -, *, /, () and ^ can be evaluated - * @covers phpOMS\Math\Parser\Evaluator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Basic formulas using +, -, *, /, () and ^ can be evaluated')] public function testBasicEvaluation() : void { self::assertEqualsWithDelta(4.5, Evaluator::evaluate('3 + 4 * 2 / ( 1 - 5 ) ^ 2 ^ 3 + 1.5'), 2); self::assertEqualsWithDelta(4.5, Evaluator::evaluate('3+4*2/(1-5)^2^3+1.5'), 2); } - /** - * @testdox Badly formed formulas return null as result - * @covers phpOMS\Math\Parser\Evaluator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Badly formed formulas return null as result')] public function testInvalidEvaluation() : void { self::assertNull(Evaluator::evaluate('invalid')); diff --git a/tests/Math/Solver/Root/BisectionTest.php b/tests/Math/Solver/Root/BisectionTest.php index 830452251..26b702b85 100644 --- a/tests/Math/Solver/Root/BisectionTest.php +++ b/tests/Math/Solver/Root/BisectionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,9 @@ namespace phpOMS\tests\Math\Solver\Root; use phpOMS\Math\Solver\Root\Bisection; /** - * @testdox phpOMS\tests\Math\Solver\Root\BisectionTest: Various math functions - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Solver\Root\BisectionTest: Various math functions')] final class BisectionTest extends \PHPUnit\Framework\TestCase { public function testRoot() : void diff --git a/tests/Math/Solver/Root/IllinoisTest.php b/tests/Math/Solver/Root/IllinoisTest.php index 88bcfae8d..6a132b2aa 100644 --- a/tests/Math/Solver/Root/IllinoisTest.php +++ b/tests/Math/Solver/Root/IllinoisTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,9 @@ namespace phpOMS\tests\Math\Solver\Root; use phpOMS\Math\Solver\Root\Illinois; /** - * @testdox phpOMS\tests\Math\Solver\Root\IllinoisTest: Various math functions - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Solver\Root\IllinoisTest: Various math functions')] final class IllinoisTest extends \PHPUnit\Framework\TestCase { public function testRoot() : void diff --git a/tests/Math/Solver/Root/RegulaFalsiTest.php b/tests/Math/Solver/Root/RegulaFalsiTest.php index 238df173f..395436396 100644 --- a/tests/Math/Solver/Root/RegulaFalsiTest.php +++ b/tests/Math/Solver/Root/RegulaFalsiTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,9 @@ namespace phpOMS\tests\Math\Solver\Root; use phpOMS\Math\Solver\Root\RegulaFalsi; /** - * @testdox phpOMS\tests\Math\Solver\Root\RegulaFalsiTest: Various math functions - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Solver\Root\RegulaFalsiTest: Various math functions')] final class RegulaFalsiTest extends \PHPUnit\Framework\TestCase { public function testRoot() : void diff --git a/tests/Math/Statistic/AverageTest.php b/tests/Math/Statistic/AverageTest.php index 8089c8d1e..fdafb2961 100755 --- a/tests/Math/Statistic/AverageTest.php +++ b/tests/Math/Statistic/AverageTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,27 +17,21 @@ namespace phpOMS\tests\Math\Statistic; use phpOMS\Math\Statistic\Average; /** - * @testdox phpOMS\tests\Math\Statistic\AverageTest: Averages - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Statistic\Average::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Statistic\AverageTest: Averages')] final class AverageTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The average change of a dataset is correctly calculated - * @covers phpOMS\Math\Statistic\Average - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The average change of a dataset is correctly calculated')] public function testAverage() : void { self::assertEquals(-3 / 2, Average::averageDatasetChange([6, 7, 6, 3, 0])); } - /** - * @testdox The average mean of angles is calculated correctly - * @covers phpOMS\Math\Statistic\Average - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The average mean of angles is calculated correctly')] public function testAngleMean() : void { self::assertEqualsWithDelta(-90, Average::angleMean([90.0, 180.0, 270.0, 360.0]), 0.01); @@ -49,22 +43,16 @@ final class AverageTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(9.999999999999977, Average::angleMean2([370.0]), 0.01); } - /** - * @testdox The arithmetic mean is correctly calculated - * @covers phpOMS\Math\Statistic\Average - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The arithmetic mean is correctly calculated')] public function testArithmeticMean() : void { self::assertEqualsWithDelta(4, Average::arithmeticMean([1, 2, 3, 4, 5, 6, 7]), 0.01); self::assertEqualsWithDelta(4, Average::arithmeticMean([1, 2, -4, -6, 8, 9, 3, 4, 5, 6, 7], 2), 0.01); } - /** - * @testdox The weighted mean is correctly calculated - * @covers phpOMS\Math\Statistic\Average - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The weighted mean is correctly calculated')] public function testWeightedAverage() : void { self::assertEqualsWithDelta(69 / 20, Average::weightedAverage( @@ -73,33 +61,24 @@ final class AverageTest extends \PHPUnit\Framework\TestCase ), 0.01); } - /** - * @testdox The geometric mean is correctly calculated - * @covers phpOMS\Math\Statistic\Average - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The geometric mean is correctly calculated')] public function testGeometricMean() : void { self::assertEqualsWithDelta(3.3800151591413, Average::geometricMean([1, 2, 3, 4, 5, 6, 7]), 0.01); self::assertEqualsWithDelta(3.3800151591413, Average::geometricMean([1, 2, -4, -6, 8, 9, 3, 4, 5, 6, 7],2), 0.01); } - /** - * @testdox The harmonic mean is correctly calculated - * @covers phpOMS\Math\Statistic\Average - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The harmonic mean is correctly calculated')] public function testHarmonicMean() : void { self::assertEqualsWithDelta(2.6997245179063, Average::harmonicMean([1, 2, 3, 4, 5, 6, 7]), 0.01); self::assertEqualsWithDelta(2.6997245179063, Average::harmonicMean([1, 2, -4, -6, 8, 9, 3, 4, 5, 6, 7], 2), 0.01); } - /** - * @testdox The moving average is correctly calculated - * @covers phpOMS\Math\Statistic\Average - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The moving average is correctly calculated')] public function testMovingAverage() : void { $data = [ @@ -114,11 +93,8 @@ final class AverageTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta($average, Average::totalMovingAverage($data, 5), 0.1); } - /** - * @testdox The weighted moving average is correctly calculated - * @covers phpOMS\Math\Statistic\Average - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The weighted moving average is correctly calculated')] public function testWeightedMovingAverage() : void { $data = [67.5, 66.5, 66.44, 66.44, 66.25, 65.88, 66.63]; @@ -128,11 +104,8 @@ final class AverageTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta($average, Average::totalMovingAverage($data, 3, $weights), 0.1); } - /** - * @testdox Different weight and dataset dimensions throw a InvalidDimensionException - * @covers phpOMS\Math\Statistic\Average - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different weight and dataset dimensions throw a InvalidDimensionException')] public function testInvalidWeightedAverageDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); @@ -140,11 +113,8 @@ final class AverageTest extends \PHPUnit\Framework\TestCase Average::weightedAverage([1, 2, 3, 4, 5, 6, 7], [0.1, 0.2, 0.3, 0.1, 0.2, 0.05]); } - /** - * @testdox An empty dataset for the arithmetic mean throws a ZeroDivisionException - * @covers phpOMS\Math\Statistic\Average - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An empty dataset for the arithmetic mean throws a ZeroDivisionException')] public function testInvalidArithmeticMeanZeroDivision() : void { $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); @@ -152,11 +122,8 @@ final class AverageTest extends \PHPUnit\Framework\TestCase Average::arithmeticMean([]); } - /** - * @testdox An empty dataset for the moving average throws a Exception - * @covers phpOMS\Math\Statistic\Average - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An empty dataset for the moving average throws a Exception')] public function testInvalidMovingAverageZeroDivision() : void { $this->expectException(\Exception::class); @@ -164,11 +131,8 @@ final class AverageTest extends \PHPUnit\Framework\TestCase Average::movingAverage([], 4, 2); } - /** - * @testdox An empty dataset for the harmonic mean throws a ZeroDivisionException - * @covers phpOMS\Math\Statistic\Average - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An empty dataset for the harmonic mean throws a ZeroDivisionException')] public function testInvalidHarmonicMeanZeroDivision() : void { $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); @@ -176,11 +140,8 @@ final class AverageTest extends \PHPUnit\Framework\TestCase Average::harmonicMean([]); } - /** - * @testdox An empty dataset for the geometric mean throws a ZeroDivisionException - * @covers phpOMS\Math\Statistic\Average - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An empty dataset for the geometric mean throws a ZeroDivisionException')] public function testInvalidGeometricMean() : void { $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); @@ -188,10 +149,7 @@ final class AverageTest extends \PHPUnit\Framework\TestCase Average::geometricMean([]); } - /** - * @covers phpOMS\Math\Statistic\Average - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidAngleMean() : void { $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); @@ -199,10 +157,7 @@ final class AverageTest extends \PHPUnit\Framework\TestCase Average::angleMean([]); } - /** - * @covers phpOMS\Math\Statistic\Average - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidAngleMean2() : void { $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); @@ -210,11 +165,8 @@ final class AverageTest extends \PHPUnit\Framework\TestCase Average::angleMean2([]); } - /** - * @testdox A dataset with a 0 element throws a ZeroDivisionException - * @covers phpOMS\Math\Statistic\Average - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A dataset with a 0 element throws a ZeroDivisionException')] public function testInvalidHarmonicMean() : void { $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); @@ -222,22 +174,16 @@ final class AverageTest extends \PHPUnit\Framework\TestCase Average::harmonicMean([1, 2, 3, 0, 5, 6, 7]); } - /** - * @testdox The mode is correctly calculated - * @covers phpOMS\Math\Statistic\Average - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The mode is correctly calculated')] public function testMode() : void { self::assertEqualsWithDelta(2, Average::mode([1, 2, 2, 3, 4, 4, 2]), 0.01); self::assertEqualsWithDelta(2, Average::mode([1, 2, 2, -1, -5, 3, 4, 4, 5, 9, 2], 2), 0.01); } - /** - * @testdox The median is correctly calculated - * @covers phpOMS\Math\Statistic\Average - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The median is correctly calculated')] public function testMedian() : void { self::assertEqualsWithDelta(4, Average::median([1, 2, 3, 4, 5, 6, 7]), 0.01); diff --git a/tests/Math/Statistic/BasicTest.php b/tests/Math/Statistic/BasicTest.php index dc84997c7..620303ab8 100755 --- a/tests/Math/Statistic/BasicTest.php +++ b/tests/Math/Statistic/BasicTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Math\Statistic\Basic; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Statistic\Basic::class)] final class BasicTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Statistic\Basic - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testFrequency() : void { self::assertEquals( diff --git a/tests/Math/Statistic/CorrelationTest.php b/tests/Math/Statistic/CorrelationTest.php index 0c790d1ce..b063f0959 100755 --- a/tests/Math/Statistic/CorrelationTest.php +++ b/tests/Math/Statistic/CorrelationTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,16 +17,13 @@ namespace phpOMS\tests\Math\Statistic; use phpOMS\Math\Statistic\Correlation; /** - * @testdox phpOMS\tests\Math\Statistic\CorrelationTest: Correlations - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Statistic\CorrelationTest: Correlations')] final class CorrelationTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The correlation coefficient (Bravis Person) is calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The correlation coefficient (Bravis Person) is calculated correctly')] public function testBravisPersonCorrelationCoefficientPopulation() : void { self::assertEqualsWithDelta( @@ -38,10 +35,8 @@ final class CorrelationTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The correlation coefficient (Bravis Person) is calculated correctly on a sample - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The correlation coefficient (Bravis Person) is calculated correctly on a sample')] public function testBravisPersonCorrelationCoefficientSample() : void { self::assertEqualsWithDelta( @@ -53,10 +48,8 @@ final class CorrelationTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The autocorrelation coefficient is calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The autocorrelation coefficient is calculated correctly')] public function testAutocorrelationCoefficient() : void { $data = [ @@ -70,10 +63,8 @@ final class CorrelationTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.098, Correlation::autocorrelationCoefficient($data, 2), 0.01); } - /** - * @testdox The portmanteau test (Box Pierce) is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The portmanteau test (Box Pierce) is correct')] public function testPortmanteauTestBoxPierce() : void { $data = [ @@ -91,10 +82,8 @@ final class CorrelationTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(16.46, Correlation::boxPierceTest($correlations, 24, 48), 0.01); } - /** - * @testdox The portmanteau test (Ljung Box) is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The portmanteau test (Ljung Box) is correct')] public function testPortmanteauTestLjungBox() : void { $data = [ diff --git a/tests/Math/Statistic/Forecast/ErrorTest.php b/tests/Math/Statistic/Forecast/ErrorTest.php index 430c9aafc..ad6601dcd 100755 --- a/tests/Math/Statistic/Forecast/ErrorTest.php +++ b/tests/Math/Statistic/Forecast/ErrorTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,12 +21,10 @@ use phpOMS\Utils\ArrayUtils; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Statistic\Forecast\Error::class)] final class ErrorTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Statistic\Forecast\Error - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testForecastError() : void { self::assertEquals(1000 - 700, Error::getForecastError(1000, 700)); @@ -46,10 +44,7 @@ final class ErrorTest extends \PHPUnit\Framework\TestCase self::assertEquals([Error::getForecastError(1000, 700)], Error::getForecastErrorArray([1000], [700])); } - /** - * @covers phpOMS\Math\Statistic\Forecast\Error - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testErrorPercentage() : void { self::assertEqualsWithDelta(300 / 1000, Error::getPercentageError(300, 1000), 0.01); @@ -70,10 +65,7 @@ final class ErrorTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Statistic\Forecast\Error - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMeanErrors() : void { $errors = [ @@ -88,10 +80,7 @@ final class ErrorTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(406.2019, Error::getRootMeanSquaredError($errors), 0.01); } - /** - * @covers phpOMS\Math\Statistic\Forecast\Error - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMASE() : void { $observed = [ @@ -110,10 +99,7 @@ final class ErrorTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.0983, Error::getMeanAbsoluteScaledError($scaledErrors), 0.01); } - /** - * @covers phpOMS\Math\Statistic\Forecast\Error - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMSSE() : void { $observed = [ @@ -135,10 +121,7 @@ final class ErrorTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Statistic\Forecast\Error - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testScaledError() : void { self::assertEquals( @@ -147,10 +130,7 @@ final class ErrorTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Statistic\Forecast\Error - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSSE() : void { $errors = MeasureOfDispersion::meanDeviationArray([99.0, 98.6, 98.5, 101.1, 98.3, 98.6, 97.9, 98.4, 99.2, 99.1]); @@ -158,10 +138,7 @@ final class ErrorTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(6.921, Error::getSumSquaredError($errors), 0.001); } - /** - * @covers phpOMS\Math\Statistic\Forecast\Error - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCoefficientOfDetermination() : void { self::assertEqualsWithDelta(0.9729, Error::getCoefficientOfDetermination( @@ -172,10 +149,7 @@ final class ErrorTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.922085138, Error::getAdjustedCoefficientOfDetermination(0.944346527, 8, 2), 0.001); } - /** - * @covers phpOMS\Math\Statistic\Forecast\Error - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMAPE() : void { self::assertEqualsWithDelta(0.17551, Error::getMeanAbsolutePercentageError( @@ -184,10 +158,7 @@ final class ErrorTest extends \PHPUnit\Framework\TestCase ), 0.001); } - /** - * @covers phpOMS\Math\Statistic\Forecast\Error - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSMAPE() : void { self::assertEqualsWithDelta(0.049338, Error::getSymmetricMeanAbsolutePercentageError( @@ -196,10 +167,7 @@ final class ErrorTest extends \PHPUnit\Framework\TestCase ), 0.001); } - /** - * @covers phpOMS\Math\Statistic\Forecast\Error - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMAD() : void { self::assertEqualsWithDelta(22.075, Error::getMeanAbsoulteDeviation( diff --git a/tests/Math/Statistic/Forecast/ForecastsTest.php b/tests/Math/Statistic/Forecast/ForecastsTest.php index ccdb4ca65..5bfce9250 100755 --- a/tests/Math/Statistic/Forecast/ForecastsTest.php +++ b/tests/Math/Statistic/Forecast/ForecastsTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Math/Statistic/Forecast/Regression/LevelLevelRegressionTest.php b/tests/Math/Statistic/Forecast/Regression/LevelLevelRegressionTest.php index caa334d5d..eee644404 100755 --- a/tests/Math/Statistic/Forecast/Regression/LevelLevelRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/LevelLevelRegressionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,9 @@ use phpOMS\Math\Statistic\Forecast\Regression\LevelLevelRegression; use phpOMS\Math\Stochastic\Distribution\TDistribution; /** - * @testdox phpOMS\tests\Math\Statistic\Forecast\Regression\LevelLevelRegressionTest: Level level regression - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Statistic\Forecast\Regression\LevelLevelRegressionTest: Level level regression')] final class LevelLevelRegressionTest extends \PHPUnit\Framework\TestCase { protected $reg = null; @@ -39,37 +38,29 @@ final class LevelLevelRegressionTest extends \PHPUnit\Framework\TestCase $this->reg = LevelLevelRegression::getRegression($x, $y); } - /** - * @testdox The regression parameters are calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The regression parameters are calculated correctly')] public function testRegression() : void { self::assertEqualsWithDelta(['b0' => 3, 'b1' => 4], $this->reg, 0.2); } - /** - * @testdox The slope is calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The slope is calculated correctly')] public function testSlope() : void { self::assertEquals(4, LevelLevelRegression::getSlope($this->reg['b1'], 0, 0)); } - /** - * @testdox The elasticity is calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The elasticity is calculated correctly')] public function testElasticity() : void { self::assertEqualsWithDelta(0.7273, LevelLevelRegression::getElasticity($this->reg['b1'], 11, 2), 0.01); } - /** - * @testdox The standard error of the population is calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The standard error of the population is calculated correctly')] public function testStandardErrorOfRegressionPopulation() : void { $x = [1, 2, 3, 4, 5]; @@ -85,10 +76,8 @@ final class LevelLevelRegressionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.747, LevelLevelRegression::getStandardErrorOfRegressionPopulation($errors), 0.001); } - /** - * @testdox The standard error of the sample is calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The standard error of the sample is calculated correctly')] public function testStandardErrorOfRegressionSample() : void { $x = [1, 2, 3, 4, 5]; @@ -104,10 +93,8 @@ final class LevelLevelRegressionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.964, LevelLevelRegression::getStandardErrorOfRegressionSample($errors), 0.001); } - /** - * @testdox The prediction interval is calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The prediction interval is calculated correctly')] public function testPredictionInterval() : void { $x = [1, 2, 3, 4, 5]; @@ -128,10 +115,8 @@ final class LevelLevelRegressionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Different dimension sizes for x and y coordinates throw a InvalidDimensionException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different dimension sizes for x and y coordinates throw a InvalidDimensionException')] public function testInvalidDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); diff --git a/tests/Math/Statistic/Forecast/Regression/LevelLogRegressionTest.php b/tests/Math/Statistic/Forecast/Regression/LevelLogRegressionTest.php index 690e50491..2bd4bc794 100755 --- a/tests/Math/Statistic/Forecast/Regression/LevelLogRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/LevelLogRegressionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,9 @@ namespace phpOMS\tests\Math\Statistic\Forecast\Regression; use phpOMS\Math\Statistic\Forecast\Regression\LevelLogRegression; /** - * @testdox phpOMS\tests\Math\Statistic\Forecast\Regression\LevelLogRegressionTest: Level log regression - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Statistic\Forecast\Regression\LevelLogRegressionTest: Level log regression')] final class LevelLogRegressionTest extends \PHPUnit\Framework\TestCase { protected $reg = null; @@ -37,39 +36,31 @@ final class LevelLogRegressionTest extends \PHPUnit\Framework\TestCase $this->reg = LevelLogRegression::getRegression($x, $y); } - /** - * @testdox The regression parameters are calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The regression parameters are calculated correctly')] public function testRegression() : void { self::assertEqualsWithDelta(['b0' => 1, 'b1' => 1], $this->reg, 0.2); } - /** - * @testdox The slope is calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The slope is calculated correctly')] public function testSlope() : void { $x = 2; self::assertEqualsWithDelta($this->reg['b1'] / $x, LevelLogRegression::getSlope($this->reg['b1'], 0, $x), 0.2); } - /** - * @testdox The elasticity is calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The elasticity is calculated correctly')] public function testElasticity() : void { $y = 3; self::assertEqualsWithDelta($this->reg['b1'] / $y, LevelLogRegression::getElasticity($this->reg['b1'], $y, 0), 0.2); } - /** - * @testdox Different dimension sizes for x and y coordinates throw a InvalidDimensionException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different dimension sizes for x and y coordinates throw a InvalidDimensionException')] public function testInvalidDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); diff --git a/tests/Math/Statistic/Forecast/Regression/LogLevelRegressionTest.php b/tests/Math/Statistic/Forecast/Regression/LogLevelRegressionTest.php index 3826aa99d..31521cbb8 100755 --- a/tests/Math/Statistic/Forecast/Regression/LogLevelRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/LogLevelRegressionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,9 @@ namespace phpOMS\tests\Math\Statistic\Forecast\Regression; use phpOMS\Math\Statistic\Forecast\Regression\LogLevelRegression; /** - * @testdox phpOMS\tests\Math\Statistic\Forecast\Regression\LogLevelRegressionTest: Log level regression - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Statistic\Forecast\Regression\LogLevelRegressionTest: Log level regression')] final class LogLevelRegressionTest extends \PHPUnit\Framework\TestCase { protected $reg = null; @@ -37,39 +36,31 @@ final class LogLevelRegressionTest extends \PHPUnit\Framework\TestCase $this->reg = LogLevelRegression::getRegression($x, $y); } - /** - * @testdox The regression parameters are calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The regression parameters are calculated correctly')] public function testRegression() : void { self::assertEqualsWithDelta(['b0' => -1, 'b1' => 2], $this->reg, 0.2); } - /** - * @testdox The slope is calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The slope is calculated correctly')] public function testSlope() : void { $y = 3; self::assertEqualsWithDelta($this->reg['b1'] * $y, LogLevelRegression::getSlope($this->reg['b1'], $y, 0), 0.2); } - /** - * @testdox The elasticity is calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The elasticity is calculated correctly')] public function testElasticity() : void { $x = 2; self::assertEqualsWithDelta($this->reg['b1'] * $x, LogLevelRegression::getElasticity($this->reg['b1'], 0, $x), 0.2); } - /** - * @testdox Different dimension sizes for x and y coordinates throw a InvalidDimensionException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different dimension sizes for x and y coordinates throw a InvalidDimensionException')] public function testInvalidDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); diff --git a/tests/Math/Statistic/Forecast/Regression/LogLogRegressionTest.php b/tests/Math/Statistic/Forecast/Regression/LogLogRegressionTest.php index 9b7d2b79d..acaf39ea4 100755 --- a/tests/Math/Statistic/Forecast/Regression/LogLogRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/LogLogRegressionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,9 @@ namespace phpOMS\tests\Math\Statistic\Forecast\Regression; use phpOMS\Math\Statistic\Forecast\Regression\LogLogRegression; /** - * @testdox phpOMS\tests\Math\Statistic\Forecast\Regression\LogLogRegressionTest: Log log regression - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Statistic\Forecast\Regression\LogLogRegressionTest: Log log regression')] final class LogLogRegressionTest extends \PHPUnit\Framework\TestCase { protected $reg = null; @@ -37,19 +36,15 @@ final class LogLogRegressionTest extends \PHPUnit\Framework\TestCase $this->reg = LogLogRegression::getRegression($x, $y); } - /** - * @testdox The regression parameters are calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The regression parameters are calculated correctly')] public function testRegression() : void { self::assertEqualsWithDelta(['b0' => 2, 'b1' => 3], $this->reg, 0.2); } - /** - * @testdox The slope is calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The slope is calculated correctly')] public function testSlope() : void { $y = 3; @@ -57,19 +52,15 @@ final class LogLogRegressionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta($this->reg['b1'] * $y / $x, LogLogRegression::getSlope($this->reg['b1'], $y, $x), 0.2); } - /** - * @testdox The elasticity is calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The elasticity is calculated correctly')] public function testElasticity() : void { self::assertEqualsWithDelta($this->reg['b1'], LogLogRegression::getElasticity($this->reg['b1'], 0, 0), 0.2); } - /** - * @testdox Different dimension sizes for x and y coordinates throw a InvalidDimensionException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different dimension sizes for x and y coordinates throw a InvalidDimensionException')] public function testInvalidDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); diff --git a/tests/Math/Statistic/Forecast/Regression/PolynomialRegressionTest.php b/tests/Math/Statistic/Forecast/Regression/PolynomialRegressionTest.php index 69015dbdf..4f341677d 100755 --- a/tests/Math/Statistic/Forecast/Regression/PolynomialRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/PolynomialRegressionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,9 @@ namespace phpOMS\tests\Math\Statistic\Forecast\Regression; use phpOMS\Math\Statistic\Forecast\Regression\PolynomialRegression; /** - * @testdox phpOMS\tests\Math\Statistic\Forecast\Regression\PolynomialRegressionTest: Polynomial regression - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Statistic\Forecast\Regression\PolynomialRegressionTest: Polynomial regression')] final class PolynomialRegressionTest extends \PHPUnit\Framework\TestCase { protected $reg = null; @@ -37,19 +36,15 @@ final class PolynomialRegressionTest extends \PHPUnit\Framework\TestCase $this->reg = PolynomialRegression::getRegression($x, $y); } - /** - * @testdox The regression parameters are calculated correctly - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The regression parameters are calculated correctly')] public function testRegression() : void { self::assertEqualsWithDelta(['a' => 1, 'b' => 2, 'c' => 3], $this->reg, 0.2); } - /** - * @testdox Different dimension sizes for x and y coordinates throw a InvalidDimensionException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different dimension sizes for x and y coordinates throw a InvalidDimensionException')] public function testInvalidDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); diff --git a/tests/Math/Statistic/MeasureOfDispersionTest.php b/tests/Math/Statistic/MeasureOfDispersionTest.php index a59f59cc8..5af75c2cc 100755 --- a/tests/Math/Statistic/MeasureOfDispersionTest.php +++ b/tests/Math/Statistic/MeasureOfDispersionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,37 +17,28 @@ namespace phpOMS\tests\Math\Statistic; use phpOMS\Math\Statistic\MeasureOfDispersion; /** - * @testdox phpOMS\tests\Math\Statistic\MeasureOfDispersionTest: Measure of dispersion - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Statistic\MeasureOfDispersion::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Statistic\MeasureOfDispersionTest: Measure of dispersion')] final class MeasureOfDispersionTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The range of a dataset is correctly calculated - * @covers phpOMS\Math\Statistic\MeasureOfDispersion - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The range of a dataset is correctly calculated')] public function testRange() : void { self::assertEquals((float) (9 - 1), MeasureOfDispersion::range([4, 5, 9, 1, 3])); } - /** - * @testdox The standard deviation is correctly calculated - * @covers phpOMS\Math\Statistic\MeasureOfDispersion - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The standard deviation is correctly calculated')] public function testStandardDeviationSample() : void { self::assertEqualsWithDelta(2.160246, MeasureOfDispersion::standardDeviationSample([1, 2, 3, 4, 5, 6, 7]), 0.01); } - /** - * @testdox The empirical covariance is correctly calculated - * @covers phpOMS\Math\Statistic\MeasureOfDispersion - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The empirical covariance is correctly calculated')] public function testEmpiricalCovariance() : void { self::assertEqualsWithDelta( @@ -59,11 +50,8 @@ final class MeasureOfDispersionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The empirical covariance on a sample is correctly calculated - * @covers phpOMS\Math\Statistic\MeasureOfDispersion - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The empirical covariance on a sample is correctly calculated')] public function testSampleCovariance() : void { self::assertEqualsWithDelta( @@ -75,31 +63,22 @@ final class MeasureOfDispersionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The sample variance is correctly calculated - * @covers phpOMS\Math\Statistic\MeasureOfDispersion - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The sample variance is correctly calculated')] public function testVarianceSample() : void { self::assertEqualsWithDelta(6219.9, MeasureOfDispersion::sampleVariance([3, 21, 98, 203, 17, 9]), 0.01); } - /** - * @testdox The population/empirical variance is correctly calculated - * @covers phpOMS\Math\Statistic\MeasureOfDispersion - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The population/empirical variance is correctly calculated')] public function testVariancePopulation() : void { self::assertEqualsWithDelta(5183.25, MeasureOfDispersion::empiricalVariance([3, 21, 98, 203, 17, 9]), 0.01); } - /** - * @testdox The mean deviations are correctly calculated - * @covers phpOMS\Math\Statistic\MeasureOfDispersion - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The mean deviations are correctly calculated')] public function testDeviation() : void { self::assertEqualsWithDelta(0.0, MeasureOfDispersion::meanDeviation([3, 4, 5, 9, 7, 8, 9]), 0.01); @@ -107,11 +86,8 @@ final class MeasureOfDispersionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta((12.96 + 2.56 + 0.36 + 5.76 + 11.56) / 5, MeasureOfDispersion::squaredMeanDeviation([1, 3, 4, 7, 8]), 0.01); } - /** - * @testdox The mean deviations for every dataset element is correctly calculated - * @covers phpOMS\Math\Statistic\MeasureOfDispersion - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The mean deviations for every dataset element is correctly calculated')] public function testDeviationArray() : void { self::assertEqualsWithDelta( @@ -133,32 +109,23 @@ final class MeasureOfDispersionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The empirical variation coefficient is correctly calculated - * @covers phpOMS\Math\Statistic\MeasureOfDispersion - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The empirical variation coefficient is correctly calculated')] public function testEmpiricalVariationCoefficient() : void { self::assertEqualsWithDelta(0.5400, MeasureOfDispersion::empiricalVariationCoefficient([1, 2, 3, 4, 5, 6, 7]), 0.01); } - /** - * @testdox The interquartile range is correctly calculated - * @covers phpOMS\Math\Statistic\MeasureOfDispersion - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The interquartile range is correctly calculated')] public function testIQR() : void { $x = [7, 7, 31, 31, 47, 75, 87, 115, 116, 119, 119, 155, 177]; self::assertEquals(88, MeasureOfDispersion::getIQR($x)); } - /** - * @testdox The empirical variation coefficient with a mean of 0 throws a ZeroDivisionException - * @covers phpOMS\Math\Statistic\MeasureOfDispersion - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The empirical variation coefficient with a mean of 0 throws a ZeroDivisionException')] public function testInvalidEmpiricalVariationCoefficient() : void { $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); @@ -166,11 +133,8 @@ final class MeasureOfDispersionTest extends \PHPUnit\Framework\TestCase MeasureOfDispersion::empiricalVariationCoefficient([1, 2, 3, 4, 5, 6, 7], 0); } - /** - * @testdox An empty dataset in the empirical covariance throws a ZeroDivisionException - * @covers phpOMS\Math\Statistic\MeasureOfDispersion - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An empty dataset in the empirical covariance throws a ZeroDivisionException')] public function testInvalidEmpiricalCovariance() : void { $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); @@ -178,11 +142,8 @@ final class MeasureOfDispersionTest extends \PHPUnit\Framework\TestCase MeasureOfDispersion::empiricalCovariance([], []); } - /** - * @testdox Different dataset sizes in the empirical covariance throw a InvalidDimensionException - * @covers phpOMS\Math\Statistic\MeasureOfDispersion - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different dataset sizes in the empirical covariance throw a InvalidDimensionException')] public function testInvalidEmpiricalCovarianceDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); @@ -190,11 +151,8 @@ final class MeasureOfDispersionTest extends \PHPUnit\Framework\TestCase MeasureOfDispersion::empiricalCovariance([1, 2, 3, 4], [1, 2, 3]); } - /** - * @testdox An empty dataset in the sample variance throws a ZeroDivisionException - * @covers phpOMS\Math\Statistic\MeasureOfDispersion - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An empty dataset in the sample variance throws a ZeroDivisionException')] public function testInvalidSampleVariance() : void { $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); @@ -202,11 +160,8 @@ final class MeasureOfDispersionTest extends \PHPUnit\Framework\TestCase MeasureOfDispersion::sampleVariance([]); } - /** - * @testdox An empty dataset in the empirical/population variance throws a ZeroDivisionException - * @covers phpOMS\Math\Statistic\MeasureOfDispersion - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An empty dataset in the empirical/population variance throws a ZeroDivisionException')] public function testInvalidEmpiricalVariance() : void { $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); @@ -214,10 +169,7 @@ final class MeasureOfDispersionTest extends \PHPUnit\Framework\TestCase MeasureOfDispersion::empiricalVariance([]); } - /** - * @covers phpOMS\Math\Statistic\MeasureOfDispersion - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidSampleCovarianceDimension() : void { $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); diff --git a/tests/Math/Stochastic/Distribution/BernoulliDistributionTest.php b/tests/Math/Stochastic/Distribution/BernoulliDistributionTest.php index dfb1038a8..151abc005 100755 --- a/tests/Math/Stochastic/Distribution/BernoulliDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/BernoulliDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,22 +19,17 @@ use phpOMS\Math\Stochastic\Distribution\BernoulliDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\BernoulliDistribution::class)] final class BernoulliDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\BernoulliDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPmf() : void { self::assertEqualsWithDelta(0.3, BernoulliDistribution::getPmf(0.7, 0), 0.01); self::assertEqualsWithDelta(0.7, BernoulliDistribution::getPmf(0.7, 1), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BernoulliDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMode() : void { self::assertEqualsWithDelta(1, BernoulliDistribution::getMode(0.7), 0.01); @@ -42,19 +37,13 @@ final class BernoulliDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0, BernoulliDistribution::getMode(0.3), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BernoulliDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { self::assertEqualsWithDelta(0.4, BernoulliDistribution::getMean(0.4), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BernoulliDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { self::assertEqualsWithDelta(0, BernoulliDistribution::getCdf(0.4, -2), 0.01); @@ -62,10 +51,7 @@ final class BernoulliDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.3, BernoulliDistribution::getCdf(0.7, 0.4), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BernoulliDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMedian() : void { self::assertEqualsWithDelta(0.5, BernoulliDistribution::getMedian(0.5), 0.01); @@ -73,10 +59,7 @@ final class BernoulliDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0, BernoulliDistribution::getMedian(0.3), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BernoulliDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { $p = 0.3; @@ -85,10 +68,7 @@ final class BernoulliDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta($p * $q, BernoulliDistribution::getVariance($p), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BernoulliDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviation() : void { $p = 0.3; @@ -97,10 +77,7 @@ final class BernoulliDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(\sqrt($p * $q), BernoulliDistribution::getStandardDeviation($p), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BernoulliDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { $p = 0.3; @@ -109,10 +86,7 @@ final class BernoulliDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta((1 - 2 * $p) / \sqrt($p * $q), BernoulliDistribution::getSkewness($p), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BernoulliDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testExKurtosis() : void { $p = 0.3; @@ -121,10 +95,7 @@ final class BernoulliDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta((1 - 6 * $p * $q) / ($p * $q), BernoulliDistribution::getExKurtosis($p), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BernoulliDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testEntropy() : void { $p = 0.3; @@ -133,10 +104,7 @@ final class BernoulliDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(-$q * \log($q) - $p * \log($p), BernoulliDistribution::getEntropy($p), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BernoulliDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMgf() : void { $p = 0.3; @@ -146,10 +114,7 @@ final class BernoulliDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta($q + $p * \exp($t), BernoulliDistribution::getMgf($p, $t), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BernoulliDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testFisherInformation() : void { $p = 0.3; @@ -158,10 +123,7 @@ final class BernoulliDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(1 / ($p * $q), BernoulliDistribution::getFisherInformation($p), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BernoulliDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidPmfParameter() : void { $this->expectException(\InvalidArgumentException::class); diff --git a/tests/Math/Stochastic/Distribution/BetaDistributionTest.php b/tests/Math/Stochastic/Distribution/BetaDistributionTest.php index 9bb745fed..5872c0838 100755 --- a/tests/Math/Stochastic/Distribution/BetaDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/BetaDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,21 +19,16 @@ use phpOMS\Math\Stochastic\Distribution\BetaDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\BetaDistribution::class)] final class BetaDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\BetaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { self::assertEquals(1 / 2, BetaDistribution::getMean(2.0, 2.0)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BetaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMode() : void { self::assertEquals(1 / 2, BetaDistribution::getMode(2.0, 2.0)); @@ -42,28 +37,19 @@ final class BetaDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(1.0, BetaDistribution::getMode(1.0, 1.0)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BetaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { self::assertEqualsWithDelta(1 / 20, BetaDistribution::getVariance(2.0, 2.0), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BetaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviation() : void { self::assertEqualsWithDelta(\sqrt(1 / 20), BetaDistribution::getStandardDeviation(2.0, 2.0), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BetaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { self::assertEqualsWithDelta(0, BetaDistribution::getSkewness(2.0, 2.0), 0.001); @@ -71,37 +57,25 @@ final class BetaDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(-0.565685, BetaDistribution::getSkewness(2.0, 1.0), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BetaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testExKurtosis() : void { self::assertEqualsWithDelta(-6 / 7, BetaDistribution::getExKurtosis(2.0, 2.0), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BetaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPdf() : void { self::assertEqualsWithDelta(0.9375, BetaDistribution::getPdf(0.5, 2, 5), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BetaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { self::assertEqualsWithDelta(0.890625, BetaDistribution::getCdf(0.5, 2, 5), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BetaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMgf() : void { self::assertEqualsWithDelta(1.0, BetaDistribution::getMgf(0, 2, 5), 0.001); diff --git a/tests/Math/Stochastic/Distribution/BinomialDistributionTest.php b/tests/Math/Stochastic/Distribution/BinomialDistributionTest.php index 6c1f43ee3..23d169b76 100755 --- a/tests/Math/Stochastic/Distribution/BinomialDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/BinomialDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Math\Stochastic\Distribution\BinomialDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\BinomialDistribution::class)] final class BinomialDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\BinomialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPmf() : void { $p = 0.4; @@ -34,10 +32,7 @@ final class BinomialDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.1659, BinomialDistribution::getPmf($n, $k, $p), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BinomialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { $p = 0.4; @@ -47,10 +42,7 @@ final class BinomialDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.25, BinomialDistribution::getCdf($n, $k, $p), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BinomialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { $n = 20; @@ -59,10 +51,7 @@ final class BinomialDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta($n * $p, BinomialDistribution::getMean($n, $p), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BinomialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMedian() : void { $n = 20; @@ -71,10 +60,7 @@ final class BinomialDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(\floor($n * $p), BinomialDistribution::getMedian($n, $p), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BinomialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMode() : void { $n = 20; @@ -83,10 +69,7 @@ final class BinomialDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(\floor(($n + 1) * $p), BinomialDistribution::getMode($n, $p), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BinomialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { $n = 20; @@ -95,10 +78,7 @@ final class BinomialDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta($n * $p * (1 - $p), BinomialDistribution::getVariance($n, $p), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BinomialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviation() : void { $n = 20; @@ -107,10 +87,7 @@ final class BinomialDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(\sqrt($n * $p * (1 - $p)), BinomialDistribution::getStandardDeviation($n, $p), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BinomialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { $n = 20; @@ -119,10 +96,7 @@ final class BinomialDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta((1 - 2 * $p) / \sqrt($n * $p * (1 - $p)), BinomialDistribution::getSkewness($n, $p), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BinomialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testExKurtosis() : void { $n = 20; @@ -131,10 +105,7 @@ final class BinomialDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta((1 - 6 * $p * (1 - $p)) / ($n * $p * (1 - $p)), BinomialDistribution::getExKurtosis($n, $p), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BinomialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMgf() : void { $n = 20; @@ -144,10 +115,7 @@ final class BinomialDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta((1 - $p + $p * \exp($t)) ** $n, BinomialDistribution::getMgf($n, $t, $p), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\BinomialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testFisherInformation() : void { $n = 20; diff --git a/tests/Math/Stochastic/Distribution/CauchyDistributionTest.php b/tests/Math/Stochastic/Distribution/CauchyDistributionTest.php index 4f31ccab7..1fb66ce13 100755 --- a/tests/Math/Stochastic/Distribution/CauchyDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/CauchyDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,22 +19,17 @@ use phpOMS\Math\Stochastic\Distribution\CauchyDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\CauchyDistribution::class)] final class CauchyDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\CauchyDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMedianMode() : void { self::assertEquals(3.2, CauchyDistribution::getMedian(3.2)); self::assertEquals(3.2, CauchyDistribution::getMode(3.2)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\CauchyDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPdf() : void { $x = 1; @@ -44,10 +39,7 @@ final class CauchyDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.14979, CauchyDistribution::getPdf($x, $x0, $gamma), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\CauchyDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { $x = 1; @@ -57,10 +49,7 @@ final class CauchyDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.57798, CauchyDistribution::getCdf($x, $x0, $gamma), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\CauchyDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testEntropy() : void { $gamma = 1.5; diff --git a/tests/Math/Stochastic/Distribution/ChiSquaredDistributionTest.php b/tests/Math/Stochastic/Distribution/ChiSquaredDistributionTest.php index 889eb3bd3..df9e6c565 100755 --- a/tests/Math/Stochastic/Distribution/ChiSquaredDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/ChiSquaredDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Math\Stochastic\Distribution\ChiSquaredDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\ChiSquaredDistribution::class)] final class ChiSquaredDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\ChiSquaredDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testHypothesisFalse() : void { $p = [0.6, 0.25, 0.15]; @@ -42,10 +40,7 @@ final class ChiSquaredDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(2, $test['df']); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ChiSquaredDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDegreesOfFreedom() : void { self::assertEquals(2, ChiSquaredDistribution::getDegreesOfFreedom([1, 2, 3])); @@ -56,19 +51,13 @@ final class ChiSquaredDistributionTest extends \PHPUnit\Framework\TestCase ])); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ChiSquaredDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMode() : void { self::assertEquals(\max(5 - 2, 0), ChiSquaredDistribution::getMode(5)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ChiSquaredDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { $df = 5; @@ -76,10 +65,7 @@ final class ChiSquaredDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals($df, ChiSquaredDistribution::getMean($df)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ChiSquaredDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { $df = 5; @@ -87,10 +73,7 @@ final class ChiSquaredDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(2 * $df, ChiSquaredDistribution::getVariance($df)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ChiSquaredDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviation() : void { $df = 5; @@ -98,10 +81,7 @@ final class ChiSquaredDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(\sqrt(2 * $df), ChiSquaredDistribution::getStandardDeviation($df)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ChiSquaredDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMedian() : void { $df = 5; @@ -109,10 +89,7 @@ final class ChiSquaredDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals($df * (1 - 2 / (9 * $df)) ** 3, ChiSquaredDistribution::getMedian($df)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ChiSquaredDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { $df = 5; @@ -120,10 +97,7 @@ final class ChiSquaredDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(\sqrt(8 / $df), ChiSquaredDistribution::getSkewness($df)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ChiSquaredDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testExKurtosis() : void { $df = 5; @@ -131,10 +105,7 @@ final class ChiSquaredDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(12 / $df, ChiSquaredDistribution::getExKurtosis($df)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ChiSquaredDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMgdf() : void { $df = 5; @@ -143,28 +114,19 @@ final class ChiSquaredDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals((1 - 2 * $t) ** (-$df / 2), ChiSquaredDistribution::getMgf($df, $t)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ChiSquaredDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPdf() : void { self::assertEqualsWithDelta(0.20755, ChiSquaredDistribution::getPdf(2, 3), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ChiSquaredDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { self::assertEqualsWithDelta(0.42759, ChiSquaredDistribution::getCdf(2, 3), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ChiSquaredDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testHypothesisSizeException() : void { $this->expectException(\Exception::class); @@ -172,10 +134,7 @@ final class ChiSquaredDistributionTest extends \PHPUnit\Framework\TestCase ChiSquaredDistribution::testHypothesis([1, 2], [2]); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ChiSquaredDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testHypothesisDegreesOfFreedomException() : void { $this->expectException(\Exception::class); @@ -183,10 +142,7 @@ final class ChiSquaredDistributionTest extends \PHPUnit\Framework\TestCase ChiSquaredDistribution::testHypothesis([], []); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ChiSquaredDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPdfOutOfBoundsException() : void { $this->expectException(\OutOfBoundsException::class); @@ -194,10 +150,7 @@ final class ChiSquaredDistributionTest extends \PHPUnit\Framework\TestCase ChiSquaredDistribution::getPdf(-1, 0); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ChiSquaredDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMgfOutOfBoundsException() : void { $this->expectException(\OutOfBoundsException::class); diff --git a/tests/Math/Stochastic/Distribution/ExponentialDistributionTest.php b/tests/Math/Stochastic/Distribution/ExponentialDistributionTest.php index 9dc888d8b..a7cf9c147 100755 --- a/tests/Math/Stochastic/Distribution/ExponentialDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/ExponentialDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Math\Stochastic\Distribution\ExponentialDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\ExponentialDistribution::class)] final class ExponentialDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\ExponentialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPdf() : void { $lambda = 0.1; @@ -33,10 +31,7 @@ final class ExponentialDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.049659, ExponentialDistribution::getPdf($x, $lambda), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ExponentialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { $lambda = 0.1; @@ -45,37 +40,25 @@ final class ExponentialDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.5034, ExponentialDistribution::getCdf($x, $lambda), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ExponentialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { self::assertEquals(1 / 3, ExponentialDistribution::getMean(3)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ExponentialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMode() : void { self::assertEquals(0, ExponentialDistribution::getMode()); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ExponentialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMedian() : void { self::assertEquals(1 / 3 * \log(2), ExponentialDistribution::getMedian(3)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ExponentialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMgf() : void { $lambda = 3; @@ -84,46 +67,31 @@ final class ExponentialDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals($lambda / ($lambda - $t), ExponentialDistribution::getMgf($t, $lambda)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ExponentialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { self::assertEquals(1 / (3 ** 2), ExponentialDistribution::getVariance(3)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ExponentialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviation() : void { self::assertEquals(\sqrt(1 / (3 ** 2)), ExponentialDistribution::getStandardDeviation(3)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ExponentialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testExKurtosis() : void { self::assertEquals(6, ExponentialDistribution::getExKurtosis()); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ExponentialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { self::assertEquals(2, ExponentialDistribution::getSkewness()); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ExponentialDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMgfException() : void { $this->expectException(\OutOfBoundsException::class); diff --git a/tests/Math/Stochastic/Distribution/FDistributionTest.php b/tests/Math/Stochastic/Distribution/FDistributionTest.php index dc7a34347..995612e72 100755 --- a/tests/Math/Stochastic/Distribution/FDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/FDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,22 +19,17 @@ use phpOMS\Math\Stochastic\Distribution\FDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\FDistribution::class)] final class FDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\FDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { self::assertEquals(0.0, FDistribution::getMean(2)); self::assertEquals(2, FDistribution::getMean(4)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\FDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMode() : void { self::assertEquals(0.0, FDistribution::getMode(0, 0)); @@ -42,10 +37,7 @@ final class FDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(1 / 3 * 2 / 3, FDistribution::getMode(3, 4), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\FDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { self::assertEquals(0.0, FDistribution::getVariance(1, 2)); @@ -53,10 +45,7 @@ final class FDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(11.1111, FDistribution::getVariance(3, 5), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\FDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviation() : void { self::assertEquals(0.0, FDistribution::getStandardDeviation(1, 2)); @@ -64,29 +53,20 @@ final class FDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(\sqrt(11.1111), FDistribution::getStandardDeviation(3, 5), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\FDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { self::assertEquals(0.0, FDistribution::getSkewness(1, 6)); self::assertEquals(2 * (2 * 4 + 7 - 2) / (7 - 6) * \sqrt(2 * (7 - 4) / (4 * (7 + 4 - 2))), FDistribution::getSkewness(4, 7)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\FDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPdf() : void { self::assertEqualsWithDelta(0.2788548, FDistribution::getPdf(1, 2, 3), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\FDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { self::assertEqualsWithDelta(0.5352419, FDistribution::getCdf(1, 2, 3), 0.001); diff --git a/tests/Math/Stochastic/Distribution/GammaDistributionTest.php b/tests/Math/Stochastic/Distribution/GammaDistributionTest.php index 0350dc45d..a7bcea679 100755 --- a/tests/Math/Stochastic/Distribution/GammaDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/GammaDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,76 +19,53 @@ use phpOMS\Math\Stochastic\Distribution\GammaDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\GammaDistribution::class)] final class GammaDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\GammaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPdfScale() : void { self::assertEqualsWithDelta(0.0734, GammaDistribution::getPdfScale(10, 4, 3), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GammaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPdfAlphaBete() : void { self::assertEqualsWithDelta(0.180447, GammaDistribution::getPdfRate(2, 4, 1), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GammaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdfScale() : void { self::assertEqualsWithDelta(0.42701, GammaDistribution::getCdfScale(10, 4, 3), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GammaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdfAlphaBete() : void { self::assertEqualsWithDelta(0.142876, GammaDistribution::getCdfRate(2, 4, 1), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GammaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPdfIntegerScale() : void { self::assertEqualsWithDelta(\exp(-1), GammaDistribution::getPdfIntegerScale(1, 1, 1), 0.001); self::assertEqualsWithDelta(3 * \exp(-3 / 4) / 16, GammaDistribution::getPdfIntegerScale(3, 2, 4), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GammaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPdfIntegerRate() : void { self::assertEqualsWithDelta(0.180447, GammaDistribution::getPdfIntegerRate(2, 4, 1), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GammaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMeanScale() : void { self::assertEqualsWithDelta(8, GammaDistribution::getMeanScale(2, 4), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GammaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMeanRate() : void { $alpha = 4; @@ -96,19 +73,13 @@ final class GammaDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals($alpha / $beta, GammaDistribution::getMeanRate($alpha, $beta)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GammaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVarianceScale() : void { self::assertEqualsWithDelta(32, GammaDistribution::getVarianceScale(2, 4), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GammaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVarianceRate() : void { $alpha = 4; @@ -116,19 +87,13 @@ final class GammaDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals($alpha / \pow($beta, 2), GammaDistribution::getVarianceRate($alpha, $beta)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GammaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviationScale() : void { self::assertEqualsWithDelta(\sqrt(32), GammaDistribution::getStandardDeviationScale(2, 4), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GammaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviationRate() : void { $alpha = 4; @@ -136,28 +101,19 @@ final class GammaDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(\sqrt($alpha / \pow($beta, 2)), GammaDistribution::getStandardDeviationRate($alpha, $beta)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GammaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testExKurtosis() : void { self::assertEqualsWithDelta(3, GammaDistribution::getExKurtosis(2), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GammaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { self::assertEqualsWithDelta(\sqrt(2), GammaDistribution::getSkewness(2), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GammaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMgfScale() : void { $theta = 2; @@ -166,10 +122,7 @@ final class GammaDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(\pow(1 - $theta * $t, -$k), GammaDistribution::getMgfScale($k, $t, $theta)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GammaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMgfRate() : void { $alpha = 4; @@ -178,19 +131,13 @@ final class GammaDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(\pow(1 - $t / $beta, -$alpha), GammaDistribution::getMgfRate($t, $alpha, $beta)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GammaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testModeScale() : void { self::assertEquals((3 - 1) * 2, GammaDistribution::getModeScale(3, 2)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GammaDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testModeRate() : void { self::assertEquals((3 - 1) / 2, GammaDistribution::getModeRate(3, 2)); diff --git a/tests/Math/Stochastic/Distribution/GeometricDistributionTest.php b/tests/Math/Stochastic/Distribution/GeometricDistributionTest.php index b5bda969a..cc6b43bb0 100755 --- a/tests/Math/Stochastic/Distribution/GeometricDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/GeometricDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Math\Stochastic\Distribution\GeometricDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\GeometricDistribution::class)] final class GeometricDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\GeometricDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPmf() : void { $p = 0.2; @@ -33,10 +31,7 @@ final class GeometricDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.1024, GeometricDistribution::getPmf($p, $k), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GeometricDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { $p = 0.2; @@ -46,29 +41,20 @@ final class GeometricDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.262, 1 - GeometricDistribution::getCdf($p, $k), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GeometricDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMode() : void { self::assertEquals(1, GeometricDistribution::getMode()); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GeometricDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { $p = 0.3; self::assertEquals(1 / $p, GeometricDistribution::getMean($p)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GeometricDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { $p = 0.3; @@ -76,10 +62,7 @@ final class GeometricDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals((1 - $p) / $p ** 2, GeometricDistribution::getVariance($p)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GeometricDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testgetStandardDeviation() : void { $p = 0.3; @@ -87,10 +70,7 @@ final class GeometricDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(\sqrt((1 - $p) / $p ** 2), GeometricDistribution::getStandardDeviation($p)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GeometricDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { $p = 0.3; @@ -98,10 +78,7 @@ final class GeometricDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals((2 - $p) / \sqrt(1 - $p), GeometricDistribution::getSkewness($p)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GeometricDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testExKurtosis() : void { $p = 0.3; @@ -109,10 +86,7 @@ final class GeometricDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(6 + ($p ** 2) / (1 - $p), GeometricDistribution::getExKurtosis($p)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GeometricDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMedian() : void { $p = 0.3; @@ -120,10 +94,7 @@ final class GeometricDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(\ceil(-1 / \log(1 - $p, 2)), GeometricDistribution::getMedian($p)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\GeometricDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMgf() : void { $p = 0.3; diff --git a/tests/Math/Stochastic/Distribution/HypergeometricDistributionTest.php b/tests/Math/Stochastic/Distribution/HypergeometricDistributionTest.php index 32814d049..c84920593 100755 --- a/tests/Math/Stochastic/Distribution/HypergeometricDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/HypergeometricDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,57 +19,40 @@ use phpOMS\Math\Stochastic\Distribution\HypergeometricDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\HypergeometricDistribution::class)] final class HypergeometricDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\HypergeometricDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { self::assertEquals(9, HypergeometricDistribution::getMean(15, 20, 12)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\HypergeometricDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { self::assertEqualsWithDelta(0.973328526784575 ** 2, HypergeometricDistribution::getVariance(15, 20, 12), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\HypergeometricDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviation() : void { self::assertEqualsWithDelta(0.973328526784575, HypergeometricDistribution::getStandardDeviation(15, 20, 12), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\HypergeometricDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { self::assertEqualsWithDelta(0.114156, HypergeometricDistribution::getSkewness(15, 20, 12), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\HypergeometricDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testExKurtosis() : void { self::assertEqualsWithDelta(-0.247277, HypergeometricDistribution::getExKurtosis(15, 20, 12), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\HypergeometricDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMode() : void { $N = 8; @@ -79,19 +62,13 @@ final class HypergeometricDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(3, HypergeometricDistribution::getMode($K, $N, $n)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\HypergeometricDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPmf() : void { self::assertEqualsWithDelta(0.146284, HypergeometricDistribution::getPmf(7, 20, 5, 10), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\HypergeometricDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { self::assertEqualsWithDelta(0.97136, HypergeometricDistribution::getCdf(7, 20, 5, 10), 0.001); diff --git a/tests/Math/Stochastic/Distribution/LaplaceDistributionTest.php b/tests/Math/Stochastic/Distribution/LaplaceDistributionTest.php index 7ba31d441..d7427b1ee 100755 --- a/tests/Math/Stochastic/Distribution/LaplaceDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/LaplaceDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Math\Stochastic\Distribution\LaplaceDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\LaplaceDistribution::class)] final class LaplaceDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\LaplaceDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPdf() : void { $x = 2; @@ -34,10 +32,7 @@ final class LaplaceDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.17118, LaplaceDistribution::getPdf($x, $m, $b), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LaplaceDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { $x = 2; @@ -47,55 +42,37 @@ final class LaplaceDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.88017, LaplaceDistribution::getCdf($x, $m, $b), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LaplaceDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMode() : void { self::assertEquals(2, LaplaceDistribution::getMode(2)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LaplaceDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { self::assertEquals(2, LaplaceDistribution::getMean(2)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LaplaceDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMedian() : void { self::assertEquals(2, LaplaceDistribution::getMedian(2)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LaplaceDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testExKurtosis() : void { self::assertEquals(3, LaplaceDistribution::getExKurtosis()); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LaplaceDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { self::assertEquals(0, LaplaceDistribution::getSkewness()); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LaplaceDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { $b = 3; @@ -103,10 +80,7 @@ final class LaplaceDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(2 * $b ** 2, LaplaceDistribution::getVariance($b)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LaplaceDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviation() : void { $b = 3; @@ -114,10 +88,7 @@ final class LaplaceDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(\sqrt(2 * $b ** 2), LaplaceDistribution::getStandardDeviation($b)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LaplaceDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMgf() : void { $t = 2; @@ -127,10 +98,7 @@ final class LaplaceDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(\exp($m * $t) / (1 - $b ** 2 * $t ** 2), LaplaceDistribution::getMgf($t, $m, $b)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LaplaceDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMgfException() : void { $this->expectException(\OutOfBoundsException::class); diff --git a/tests/Math/Stochastic/Distribution/LogDistributionTest.php b/tests/Math/Stochastic/Distribution/LogDistributionTest.php index 21ececde1..7ad193d60 100755 --- a/tests/Math/Stochastic/Distribution/LogDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/LogDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Math\Stochastic\Distribution\LogDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\LogDistribution::class)] final class LogDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPmf() : void { $p = 0.3; @@ -36,10 +34,7 @@ final class LogDistributionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { $p = 6 / 9; @@ -51,10 +46,7 @@ final class LogDistributionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { $p = 0.3; @@ -62,19 +54,13 @@ final class LogDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(-1 / \log(1 - $p) * $p / (1 - $p), LogDistribution::getMean($p)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMode() : void { self::assertEquals(1, LogDistribution::getMode()); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { $p = 0.3; @@ -85,10 +71,7 @@ final class LogDistributionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviation() : void { $p = 0.3; @@ -99,10 +82,7 @@ final class LogDistributionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMgf() : void { $p = 0.3; diff --git a/tests/Math/Stochastic/Distribution/LogNormalDistributionTest.php b/tests/Math/Stochastic/Distribution/LogNormalDistributionTest.php index 0dd9d6a21..a9e537b65 100755 --- a/tests/Math/Stochastic/Distribution/LogNormalDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/LogNormalDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,39 +19,28 @@ use phpOMS\Math\Stochastic\Distribution\LogNormalDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\LogNormalDistribution::class)] final class LogNormalDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogNormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPdf() : void { self::assertEqualsWithDelta(0.060069054, LogNormalDistribution::getPdf(3, 2, 2), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogNormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { self::assertEqualsWithDelta(0.32610510, LogNormalDistribution::getCdf(3, 2, 2), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogNormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { self::assertEqualsWithDelta(\exp(13 / 2), LogNormalDistribution::getMean(2, 3), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogNormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { self::assertEqualsWithDelta( @@ -60,10 +49,7 @@ final class LogNormalDistributionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogNormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviation() : void { self::assertEqualsWithDelta( @@ -77,10 +63,7 @@ final class LogNormalDistributionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogNormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { self::assertEqualsWithDelta( @@ -89,10 +72,7 @@ final class LogNormalDistributionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogNormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testExKurtosis() : void { self::assertEqualsWithDelta( @@ -101,28 +81,19 @@ final class LogNormalDistributionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogNormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMedian() : void { self::assertEquals(\exp(3), LogNormalDistribution::getMedian(3)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogNormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMode() : void { self::assertEquals(\exp(3 - 4 ** 2), LogNormalDistribution::getMode(3, 4)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogNormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testEntropy() : void { self::assertEqualsWithDelta( @@ -131,10 +102,7 @@ final class LogNormalDistributionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogNormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testFisherInformation() : void { self::assertEquals( diff --git a/tests/Math/Stochastic/Distribution/LogisticDistributionTest.php b/tests/Math/Stochastic/Distribution/LogisticDistributionTest.php index 7b504ba6c..d7fc916d8 100755 --- a/tests/Math/Stochastic/Distribution/LogisticDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/LogisticDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Math\Stochastic\Distribution\LogisticDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\LogisticDistribution::class)] final class LogisticDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogisticDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPdf() : void { $x = 3; @@ -37,10 +35,7 @@ final class LogisticDistributionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogisticDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { $x = 3; @@ -53,37 +48,25 @@ final class LogisticDistributionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogisticDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMode() : void { self::assertEquals(3, LogisticDistribution::getMode(3)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogisticDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { self::assertEquals(3, LogisticDistribution::getMean(3)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogisticDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMedian() : void { self::assertEquals(3, LogisticDistribution::getMedian(3)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogisticDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { $s = 3; @@ -93,10 +76,7 @@ final class LogisticDistributionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogisticDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviation() : void { $s = 3; @@ -106,28 +86,19 @@ final class LogisticDistributionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogisticDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { self::assertEquals(0, LogisticDistribution::getSkewness()); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogisticDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testExKurtosis() : void { self::assertEquals(6 / 5, LogisticDistribution::getExKurtosis()); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\LogisticDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testEntropy() : void { $s = 3; diff --git a/tests/Math/Stochastic/Distribution/NormalDistributionTest.php b/tests/Math/Stochastic/Distribution/NormalDistributionTest.php index 3ea507ceb..97f0183fd 100755 --- a/tests/Math/Stochastic/Distribution/NormalDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/NormalDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,12 +21,10 @@ use phpOMS\Math\Stochastic\Distribution\NormalDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\NormalDistribution::class)] final class NormalDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\NormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPdf() : void { $mean = 2; @@ -36,10 +34,7 @@ final class NormalDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.24197, NormalDistribution::getPdf($x, $mean, $sig), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\NormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { $mean = 2; @@ -49,10 +44,7 @@ final class NormalDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.84134, NormalDistribution::getCdf($x, $mean, $sig), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\NormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { $mu = 4; @@ -60,10 +52,7 @@ final class NormalDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals($mu, NormalDistribution::getMean($mu)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\NormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMedian() : void { $mu = 4; @@ -71,10 +60,7 @@ final class NormalDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals($mu, NormalDistribution::getMedian($mu)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\NormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMode() : void { $mu = 4; @@ -82,28 +68,19 @@ final class NormalDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals($mu, NormalDistribution::getMode($mu)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\NormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { self::assertEquals(0, NormalDistribution::getSkewness()); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\NormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testExKurtosis() : void { self::assertEquals(0, NormalDistribution::getExKurtosis()); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\NormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { $sig = 0.8; @@ -111,10 +88,7 @@ final class NormalDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals($sig ** 2, NormalDistribution::getVariance($sig)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\NormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviation() : void { $sig = 0.8; @@ -122,28 +96,19 @@ final class NormalDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals($sig, NormalDistribution::getStandardDeviation($sig)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\NormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSampleSizeCalculation() : void { self::assertEqualsWithDelta(277.54, NormalDistribution::getSampleSizeFromPopulation(NormalDistribution::TABLE['0.95'], 0.05, 1000, 0.5), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\NormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSampleSizeInfiniteCalculation() : void { self::assertEqualsWithDelta(384.16, NormalDistribution::getSampleSizeFromInfinitePopulation(NormalDistribution::TABLE['0.95'], 0.05, 0.5), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\NormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMgf() : void { $t = 3; @@ -156,10 +121,7 @@ final class NormalDistributionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\NormalDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testFisherInformation() : void { self::assertEquals( diff --git a/tests/Math/Stochastic/Distribution/ParetoDistributionTest.php b/tests/Math/Stochastic/Distribution/ParetoDistributionTest.php index 6fea733c0..40f20fe46 100755 --- a/tests/Math/Stochastic/Distribution/ParetoDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/ParetoDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,97 +19,68 @@ use phpOMS\Math\Stochastic\Distribution\ParetoDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\ParetoDistribution::class)] final class ParetoDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\ParetoDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPdf() : void { self::assertEqualsWithDelta(0.263374485596, ParetoDistribution::getPdf(3, 2, 4), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ParetoDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { self::assertEqualsWithDelta(0.8024691358, ParetoDistribution::getCdf(3, 2, 4), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ParetoDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { self::assertEqualsWithDelta(8 / 3, ParetoDistribution::getMean(2, 4), 0.001); self::assertEquals(\PHP_FLOAT_MAX, ParetoDistribution::getMean(2, 1)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ParetoDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { self::assertEqualsWithDelta(2, ParetoDistribution::getVariance(3, 4), 0.001); self::assertEqualsWithDelta(\PHP_FLOAT_MAX, ParetoDistribution::getVariance(3, 2), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ParetoDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviation() : void { self::assertEqualsWithDelta(\sqrt(2), ParetoDistribution::getStandardDeviation(3, 4), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ParetoDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testExKurtosis() : void { self::assertEqualsWithDelta(35.666666666666664, ParetoDistribution::getExKurtosis(6), 0.001); self::assertEquals(0.0, ParetoDistribution::getExKurtosis(4)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ParetoDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { self::assertEqualsWithDelta(3.810317377662722, ParetoDistribution::getSkewness(6), 0.001); self::assertEquals(0.0, ParetoDistribution::getSkewness(3)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ParetoDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMedian() : void { self::assertEquals(3 * \pow(2, 1 / 4), ParetoDistribution::getMedian(3, 4)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ParetoDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMode() : void { self::assertEquals(3, ParetoDistribution::getMode(3)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ParetoDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testEntropy() : void { self::assertEquals( @@ -118,10 +89,7 @@ final class ParetoDistributionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ParetoDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testFisherInformation() : void { self::assertEquals( diff --git a/tests/Math/Stochastic/Distribution/PoissonDistributionTest.php b/tests/Math/Stochastic/Distribution/PoissonDistributionTest.php index b45992c4c..45a25c4b1 100755 --- a/tests/Math/Stochastic/Distribution/PoissonDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/PoissonDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Math\Stochastic\Distribution\PoissonDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\PoissonDistribution::class)] final class PoissonDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\PoissonDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPmf() : void { $k = 4; @@ -33,10 +31,7 @@ final class PoissonDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.16803, PoissonDistribution::getPmf(4, 3), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\PoissonDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { $k = 4; @@ -45,10 +40,7 @@ final class PoissonDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.81526, PoissonDistribution::getCdf(4, 3), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\PoissonDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMode() : void { $l = 4.6; @@ -56,10 +48,7 @@ final class PoissonDistributionTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(4, PoissonDistribution::getMode($l), 0.01); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\PoissonDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { $l = 4.6; @@ -67,10 +56,7 @@ final class PoissonDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals($l, PoissonDistribution::getMean($l)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\PoissonDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { $l = 4.6; @@ -78,10 +64,7 @@ final class PoissonDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals($l, PoissonDistribution::getVariance($l)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\PoissonDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviation() : void { $l = 4.6; @@ -89,10 +72,7 @@ final class PoissonDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(\sqrt($l), PoissonDistribution::getStandardDeviation($l)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\PoissonDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { $l = 4.6; @@ -100,10 +80,7 @@ final class PoissonDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(1 / \sqrt($l), PoissonDistribution::getSkewness($l)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\PoissonDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testExKurtosis() : void { $l = 4.6; @@ -111,10 +88,7 @@ final class PoissonDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(1 / $l, PoissonDistribution::getExKurtosis($l)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\PoissonDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMedian() : void { $l = 4.6; @@ -122,10 +96,7 @@ final class PoissonDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(\floor($l + 1 / 3 - 0.02 / $l), PoissonDistribution::getMedian($l)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\PoissonDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testFisherInformation() : void { $l = 4.6; @@ -133,10 +104,7 @@ final class PoissonDistributionTest extends \PHPUnit\Framework\TestCase self::assertEquals(1 / $l, PoissonDistribution::getFisherInformation($l)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\PoissonDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMgf() : void { $l = 4.6; diff --git a/tests/Math/Stochastic/Distribution/TDistributionTest.php b/tests/Math/Stochastic/Distribution/TDistributionTest.php index 944179da6..60038dfc0 100755 --- a/tests/Math/Stochastic/Distribution/TDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/TDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,78 +19,55 @@ use phpOMS\Math\Stochastic\Distribution\TDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\TDistribution::class)] final class TDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\TDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { self::assertEquals(0, TDistribution::getMean()); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\TDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMedian() : void { self::assertEquals(0, TDistribution::getMedian()); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\TDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMode() : void { self::assertEquals(0, TDistribution::getMode()); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\TDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { self::assertEqualsWithDelta(5 / 3, TDistribution::getVariance(5), 0.001); self::assertEqualsWithDelta(\PHP_FLOAT_MAX, TDistribution::getVariance(2), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\TDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviation() : void { self::assertEqualsWithDelta(\sqrt(5 / 3), TDistribution::getStandardDeviation(5), 0.001); self::assertEqualsWithDelta(\PHP_FLOAT_MAX, TDistribution::getStandardDeviation(2), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\TDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testExKurtosis() : void { self::assertEqualsWithDelta(6, TDistribution::getExKurtosis(5), 0.001); self::assertEqualsWithDelta(\PHP_FLOAT_MAX, TDistribution::getExKurtosis(3), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\TDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { self::assertEquals(0, TDistribution::getSkewness()); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\TDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { self::assertEqualsWithDelta(0.0, TDistribution::getCdf(1.25, 5, 0), 0.001); diff --git a/tests/Math/Stochastic/Distribution/UniformDistributionContinuousTest.php b/tests/Math/Stochastic/Distribution/UniformDistributionContinuousTest.php index 9c767282e..ea4412a0f 100755 --- a/tests/Math/Stochastic/Distribution/UniformDistributionContinuousTest.php +++ b/tests/Math/Stochastic/Distribution/UniformDistributionContinuousTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Math\Stochastic\Distribution\UniformDistributionContinuous; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\UniformDistributionContinuous::class)] final class UniformDistributionContinuousTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionContinuous - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPdf() : void { $a = 1; @@ -35,10 +33,7 @@ final class UniformDistributionContinuousTest extends \PHPUnit\Framework\TestCas self::assertEquals(0, UniformDistributionContinuous::getPdf(5, $a, $b)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionContinuous - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { $a = 1; @@ -50,10 +45,7 @@ final class UniformDistributionContinuousTest extends \PHPUnit\Framework\TestCas self::assertEquals(1, UniformDistributionContinuous::getCdf(5, $a, $b)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionContinuous - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMode() : void { $a = 1; @@ -68,10 +60,7 @@ final class UniformDistributionContinuousTest extends \PHPUnit\Framework\TestCas ); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionContinuous - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { $a = 1; @@ -80,10 +69,7 @@ final class UniformDistributionContinuousTest extends \PHPUnit\Framework\TestCas self::assertEquals(1 / 2 * ($b + $a), UniformDistributionContinuous::getMean($a, $b)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionContinuous - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMedian() : void { $a = 1; @@ -92,10 +78,7 @@ final class UniformDistributionContinuousTest extends \PHPUnit\Framework\TestCas self::assertEquals(1 / 2 * ($b + $a), UniformDistributionContinuous::getMedian($a, $b)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionContinuous - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { $a = 1; @@ -104,10 +87,7 @@ final class UniformDistributionContinuousTest extends \PHPUnit\Framework\TestCas self::assertEquals(1 / 12 * ($b - $a) ** 2, UniformDistributionContinuous::getVariance($a, $b)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionContinuous - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviation() : void { $a = 1; @@ -116,28 +96,19 @@ final class UniformDistributionContinuousTest extends \PHPUnit\Framework\TestCas self::assertEquals(\sqrt(1 / 12 * ($b - $a) ** 2), UniformDistributionContinuous::getStandardDeviation($a, $b)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionContinuous - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { self::assertEquals(0, UniformDistributionContinuous::getSkewness()); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionContinuous - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testExKurtosis() : void { self::assertEquals(-6 / 5, UniformDistributionContinuous::getExKurtosis()); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionContinuous - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMgf() : void { self::assertEquals(1, UniformDistributionContinuous::getMgf(0, 2, 3)); diff --git a/tests/Math/Stochastic/Distribution/UniformDistributionDiscreteTest.php b/tests/Math/Stochastic/Distribution/UniformDistributionDiscreteTest.php index d0548ce3e..f97fb3343 100755 --- a/tests/Math/Stochastic/Distribution/UniformDistributionDiscreteTest.php +++ b/tests/Math/Stochastic/Distribution/UniformDistributionDiscreteTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Math\Stochastic\Distribution\UniformDistributionDiscrete; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\UniformDistributionDiscrete::class)] final class UniformDistributionDiscreteTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionDiscrete - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPmf() : void { $a = 1; @@ -33,10 +31,7 @@ final class UniformDistributionDiscreteTest extends \PHPUnit\Framework\TestCase self::assertEquals(1 / ($b - $a + 1), UniformDistributionDiscrete::getPmf($a, $b)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionDiscrete - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { $a = 1; @@ -46,19 +41,13 @@ final class UniformDistributionDiscreteTest extends \PHPUnit\Framework\TestCase self::assertEquals(($k - $a + 1) / ($b - $a + 1), UniformDistributionDiscrete::getCdf($k, $a, $b)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionDiscrete - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { self::assertEquals(0, UniformDistributionDiscrete::getSkewness()); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionDiscrete - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { $a = 1; @@ -67,10 +56,7 @@ final class UniformDistributionDiscreteTest extends \PHPUnit\Framework\TestCase self::assertEquals(1 / 2 * ($a + $b), UniformDistributionDiscrete::getMean($a, $b)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionDiscrete - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMedian() : void { $a = 1; @@ -79,10 +65,7 @@ final class UniformDistributionDiscreteTest extends \PHPUnit\Framework\TestCase self::assertEquals(1 / 2 * ($a + $b), UniformDistributionDiscrete::getMedian($a, $b)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionDiscrete - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { $a = 1; @@ -91,10 +74,7 @@ final class UniformDistributionDiscreteTest extends \PHPUnit\Framework\TestCase self::assertEquals((($b - $a + 1) ** 2 - 1) / 12, UniformDistributionDiscrete::getVariance($a, $b)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionDiscrete - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviation() : void { $a = 1; @@ -103,10 +83,7 @@ final class UniformDistributionDiscreteTest extends \PHPUnit\Framework\TestCase self::assertEquals(\sqrt((($b - $a + 1) ** 2 - 1) / 12), UniformDistributionDiscrete::getStandardDeviation($a, $b)); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionDiscrete - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testExKurtosis() : void { $a = 1; @@ -119,10 +96,7 @@ final class UniformDistributionDiscreteTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionDiscrete - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMgf() : void { self::assertEquals( @@ -131,10 +105,7 @@ final class UniformDistributionDiscreteTest extends \PHPUnit\Framework\TestCase ); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionDiscrete - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdfExceptionUpper() : void { $this->expectException(\OutOfBoundsException::class); @@ -142,10 +113,7 @@ final class UniformDistributionDiscreteTest extends \PHPUnit\Framework\TestCase UniformDistributionDiscrete::getCdf(5, 2, 4); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\UniformDistributionDiscrete - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdfExceptionLower() : void { $this->expectException(\OutOfBoundsException::class); diff --git a/tests/Math/Stochastic/Distribution/WeibullDistributionTest.php b/tests/Math/Stochastic/Distribution/WeibullDistributionTest.php index 635e42fa5..c4fbd375a 100755 --- a/tests/Math/Stochastic/Distribution/WeibullDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/WeibullDistributionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,86 +19,60 @@ use phpOMS\Math\Stochastic\Distribution\WeibullDistribution; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\WeibullDistribution::class)] final class WeibullDistributionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Math\Stochastic\Distribution\WeibullDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPdf() : void { self::assertEqualsWithDelta(0.213668559, WeibullDistribution::getPdf(3, 4, 2), 0.001); self::assertEqualsWithDelta(0.0, WeibullDistribution::getPdf(-1, 4, 2), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\WeibullDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCdf() : void { self::assertEqualsWithDelta(0.430217175, WeibullDistribution::getCdf(3, 4, 2), 0.001); self::assertEqualsWithDelta(0.0, WeibullDistribution::getCdf(-1, 4, 2), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\WeibullDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMean() : void { self::assertEqualsWithDelta(3.54490771, WeibullDistribution::getMean(4, 2), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\WeibullDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMedian() : void { self::assertEqualsWithDelta(3.33021844, WeibullDistribution::getMedian(4, 2), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\WeibullDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMode() : void { self::assertEqualsWithDelta(2.82842712, WeibullDistribution::getMode(4, 2), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\WeibullDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testVariance() : void { self::assertEqualsWithDelta(3.43362932, WeibullDistribution::getVariance(4, 2), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\WeibullDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStandardDeviation() : void { self::assertEqualsWithDelta(\sqrt(3.43362932), WeibullDistribution::getStandardDeviation(4, 2), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\WeibullDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testEntropy() : void { self::assertEqualsWithDelta(1.981755, WeibullDistribution::getEntropy(4, 2), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\WeibullDistribution - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSkewness() : void { self::assertEqualsWithDelta(0.631110, WeibullDistribution::getSkewness(4, 2), 0.001); diff --git a/tests/Math/Stochastic/Distribution/ZTestingTest.php b/tests/Math/Stochastic/Distribution/ZTestingTest.php index 9ccd107f4..e25472853 100644 --- a/tests/Math/Stochastic/Distribution/ZTestingTest.php +++ b/tests/Math/Stochastic/Distribution/ZTestingTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -23,14 +23,11 @@ use phpOMS\Math\Stochastic\Distribution\ZTesting; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Stochastic\Distribution\ZTesting::class)] final class ZTestingTest extends \PHPUnit\Framework\TestCase { // http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/BS704_HypothesisTesting-ChiSquare/BS704_HypothesisTesting-ChiSquare_print.html - - /** - * @covers phpOMS\Math\Stochastic\Distribution\ZTesting - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testHypothesisFalse() : void { $a = 0.95; @@ -42,20 +39,13 @@ final class ZTestingTest extends \PHPUnit\Framework\TestCase } // https://support.microsoft.com/en-us/office/z-test-function-d633d5a3-2031-4614-a016-92180ad82bee?ui=en-us&rs=en-us&ad=us - - /** - * @covers phpOMS\Math\Stochastic\Distribution\ZTesting - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testZTest() : void { self::assertEqualsWithDelta(0.090574, ZTesting::zTest(4, [3, 6, 7, 8, 6, 5, 4, 2, 1, 9]), 0.001); } - /** - * @covers phpOMS\Math\Stochastic\Distribution\ZTesting - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testZTestValues() : void { $data = [3, 6, 7, 8, 6, 5, 4, 2, 1, 9]; diff --git a/tests/Math/Stochastic/NaiveBayesClassifierTest.php b/tests/Math/Stochastic/NaiveBayesClassifierTest.php index 9facceb06..73fde9b0a 100755 --- a/tests/Math/Stochastic/NaiveBayesClassifierTest.php +++ b/tests/Math/Stochastic/NaiveBayesClassifierTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,9 @@ namespace phpOMS\tests\Math\Stochastic; use phpOMS\Math\Stochastic\NaiveBayesClassifier; /** - * @testdox phpOMS\tests\Math\Stochastic\NaiveBayesClassifierTest: Naive bayes classifier for numeric values and strings/attributes - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Stochastic\NaiveBayesClassifierTest: Naive bayes classifier for numeric values and strings/attributes')] final class NaiveBayesClassifierTest extends \PHPUnit\Framework\TestCase { public const PLAY = [ @@ -57,10 +56,8 @@ final class NaiveBayesClassifierTest extends \PHPUnit\Framework\TestCase ['height' => 5.75, 'weight' => 150, 'foot' => 9], ]; - /** - * @testdox The classification of strings/attributes is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The classification of strings/attributes is correct')] public function testTextClassifier() : void { $filter = new NaiveBayesClassifier(); @@ -74,10 +71,8 @@ final class NaiveBayesClassifierTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The classification of numeric values is correct - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The classification of numeric values is correct')] public function testNumericClassifier() : void { $filter = new NaiveBayesClassifier(); diff --git a/tests/Math/Topology/Kernel2DTest.php b/tests/Math/Topology/Kernel2DTest.php index 75898fe6a..4358063bb 100644 --- a/tests/Math/Topology/Kernel2DTest.php +++ b/tests/Math/Topology/Kernel2DTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,9 @@ namespace phpOMS\tests\Math\Topology; use phpOMS\Math\Topology\Kernel2D; /** - * @testdox phpOMS\tests\Math\Topology\Kernel2DTest: Metric/distance calculations - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Topology\Kernel2DTest: Metric/distance calculations')] final class Kernel2DTest extends \PHPUnit\Framework\TestCase { public function testUniform() : void diff --git a/tests/Math/Topology/Metrics2DTest.php b/tests/Math/Topology/Metrics2DTest.php index 1cd66fecc..baaa7d8f4 100755 --- a/tests/Math/Topology/Metrics2DTest.php +++ b/tests/Math/Topology/Metrics2DTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Math\Topology; use phpOMS\Math\Topology\Metrics2D; /** - * @testdox phpOMS\tests\Math\Topology\Metrics2DTest: Metric/distance calculations - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Topology\Metrics2D::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Topology\Metrics2DTest: Metric/distance calculations')] final class Metrics2DTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The manhattan distance can be calculated - * @covers phpOMS\Math\Topology\Metrics2D - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The manhattan distance can be calculated')] public function testManhattan() : void { self::assertEquals( @@ -36,11 +33,8 @@ final class Metrics2DTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The euclidean distance can be calculated - * @covers phpOMS\Math\Topology\Metrics2D - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The euclidean distance can be calculated')] public function testEuclidean() : void { self::assertEqualsWithDelta( @@ -50,11 +44,8 @@ final class Metrics2DTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The chebyshev distance can be calculated - * @covers phpOMS\Math\Topology\Metrics2D - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The chebyshev distance can be calculated')] public function testChebyshev() : void { self::assertEquals( @@ -63,11 +54,8 @@ final class Metrics2DTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The octile distance can be calculated - * @covers phpOMS\Math\Topology\Metrics2D - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The octile distance can be calculated')] public function testOctile() : void { self::assertEqualsWithDelta( @@ -77,11 +65,8 @@ final class Metrics2DTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The minkowski distance can be calculated - * @covers phpOMS\Math\Topology\Metrics2D - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The minkowski distance can be calculated')] public function testMinkowski() : void { self::assertEqualsWithDelta( @@ -91,11 +76,8 @@ final class Metrics2DTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The canberra distance can be calculated - * @covers phpOMS\Math\Topology\Metrics2D - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The canberra distance can be calculated')] public function testCanberra() : void { self::assertEqualsWithDelta( @@ -105,11 +87,8 @@ final class Metrics2DTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The bray-curtis distance can be calculated - * @covers phpOMS\Math\Topology\Metrics2D - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The bray-curtis distance can be calculated')] public function testBrayCurtis() : void { self::assertEqualsWithDelta( @@ -119,11 +98,8 @@ final class Metrics2DTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The angular distance can be calculated - * @covers phpOMS\Math\Topology\Metrics2D - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The angular distance can be calculated')] public function testAngularSeparation() : void { self::assertEqualsWithDelta( @@ -133,11 +109,8 @@ final class Metrics2DTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The hamming distance can be calculated - * @covers phpOMS\Math\Topology\Metrics2D - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The hamming distance can be calculated')] public function testHammingDistance() : void { self::assertEquals( @@ -146,11 +119,8 @@ final class Metrics2DTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The ulam distance can be calculated - * @covers phpOMS\Math\Topology\Metrics2D - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The ulam distance can be calculated')] public function testUlam() : void { self::assertEquals( @@ -159,11 +129,8 @@ final class Metrics2DTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Different dimension sizes for the coordinates in the hamming metric throw a InvalidDimensionException - * @covers phpOMS\Math\Topology\Metrics2D - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different dimension sizes for the coordinates in the hamming metric throw a InvalidDimensionException')] public function testInvalidHammingDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); @@ -171,11 +138,8 @@ final class Metrics2DTest extends \PHPUnit\Framework\TestCase Metrics2D::hamming([1, 1, 1, 1], [0, 1, 0]); } - /** - * @testdox Different dimension sizes for the coordinates in the ulam metric throw a InvalidDimensionException - * @covers phpOMS\Math\Topology\Metrics2D - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different dimension sizes for the coordinates in the ulam metric throw a InvalidDimensionException')] public function testInvalidUlamDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); diff --git a/tests/Math/Topology/MetricsNDTest.php b/tests/Math/Topology/MetricsNDTest.php index 5150ad384..0b6bb4cdb 100755 --- a/tests/Math/Topology/MetricsNDTest.php +++ b/tests/Math/Topology/MetricsNDTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,17 +18,14 @@ use phpOMS\Math\Topology\Metrics2D; use phpOMS\Math\Topology\MetricsND; /** - * @testdox phpOMS\tests\Math\Topology\MetricsNDTest: Metric/distance calculations - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Math\Topology\MetricsND::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Math\Topology\MetricsNDTest: Metric/distance calculations')] final class MetricsNDTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The manhattan distance can be calculated - * @covers phpOMS\Math\Topology\MetricsND - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The manhattan distance can be calculated')] public function testManhattan() : void { self::assertEquals( @@ -37,11 +34,8 @@ final class MetricsNDTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The euclidean distance can be calculated - * @covers phpOMS\Math\Topology\MetricsND - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The euclidean distance can be calculated')] public function testEuclidean() : void { self::assertEqualsWithDelta( @@ -51,11 +45,8 @@ final class MetricsNDTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The chebyshev distance can be calculated - * @covers phpOMS\Math\Topology\MetricsND - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The chebyshev distance can be calculated')] public function testChebyshev() : void { self::assertEquals( @@ -64,11 +55,8 @@ final class MetricsNDTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The minkowski distance can be calculated - * @covers phpOMS\Math\Topology\MetricsND - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The minkowski distance can be calculated')] public function testMinkowski() : void { self::assertEqualsWithDelta( @@ -78,11 +66,8 @@ final class MetricsNDTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The canberra distance can be calculated - * @covers phpOMS\Math\Topology\MetricsND - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The canberra distance can be calculated')] public function testCanberra() : void { self::assertEqualsWithDelta( @@ -92,11 +77,8 @@ final class MetricsNDTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The cosine distance can be calculated - * @covers phpOMS\Math\Topology\MetricsND - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The cosine distance can be calculated')] public function testCosine() : void { self::assertEqualsWithDelta( @@ -106,11 +88,8 @@ final class MetricsNDTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The bray-curtis distance can be calculated - * @covers phpOMS\Math\Topology\MetricsND - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The bray-curtis distance can be calculated')] public function testBrayCurtis() : void { self::assertEqualsWithDelta( @@ -120,11 +99,8 @@ final class MetricsNDTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The angular distance can be calculated - * @covers phpOMS\Math\Topology\MetricsND - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The angular distance can be calculated')] public function testAngularSeparation() : void { self::assertEqualsWithDelta( @@ -134,11 +110,8 @@ final class MetricsNDTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The hamming distance can be calculated - * @covers phpOMS\Math\Topology\MetricsND - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The hamming distance can be calculated')] public function testHammingDistance() : void { self::assertEquals( @@ -147,111 +120,84 @@ final class MetricsNDTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Different dimension sizes for the coordinates in the manhattan metric throw a InvalidDimensionException - * @covers phpOMS\Math\Topology\MetricsND - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different dimension sizes for the coordinates in the manhattan metric throw a InvalidDimensionException')] public function testInvalidManhattanDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); - MetricsND::manhattan([3, 6, 4], [4, 6, 8, 3]); + MetricsND::manhattan([4, 6, 8, 3], [3, 6, 4]); } - /** - * @testdox Different dimension sizes for the coordinates in the euclidean metric throw a InvalidDimensionException - * @covers phpOMS\Math\Topology\MetricsND - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different dimension sizes for the coordinates in the euclidean metric throw a InvalidDimensionException')] public function testInvalidEuclideanDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); - MetricsND::euclidean([3, 6, 4], [4, 6, 8, 3]); + MetricsND::euclidean([4, 6, 8, 3], [3, 6, 4]); } - /** - * @testdox Different dimension sizes for the coordinates in the chebyshev metric throw a InvalidDimensionException - * @covers phpOMS\Math\Topology\MetricsND - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different dimension sizes for the coordinates in the chebyshev metric throw a InvalidDimensionException')] public function testInvalidChebyshevDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); - MetricsND::chebyshev([3, 6, 4], [4, 6, 8, 3]); + MetricsND::chebyshev([4, 6, 8, 3], [3, 6, 4]); } - /** - * @testdox Different dimension sizes for the coordinates in the minkowski metric throw a InvalidDimensionException - * @covers phpOMS\Math\Topology\MetricsND - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different dimension sizes for the coordinates in the minkowski metric throw a InvalidDimensionException')] public function testInvalidMinkowskiDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); - MetricsND::minkowski([3, 6, 4], [4, 6, 8, 3], 2); + MetricsND::minkowski([4, 6, 8, 3], [3, 6, 4], 2); } - /** - * @testdox Different dimension sizes for the coordinates in the canberra metric throw a InvalidDimensionException - * @covers phpOMS\Math\Topology\MetricsND - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different dimension sizes for the coordinates in the canberra metric throw a InvalidDimensionException')] public function testInvalidCanberraDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); - MetricsND::canberra([3, 6, 4], [4, 6, 8, 3]); + MetricsND::canberra([4, 6, 8, 3], [3, 6, 4]); } - /** - * @testdox Different dimension sizes for the coordinates in the cosine metric throw a InvalidDimensionException - * @covers phpOMS\Math\Topology\MetricsND - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different dimension sizes for the coordinates in the cosine metric throw a InvalidDimensionException')] public function testInvalidCosineDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); - MetricsND::cosine([3, 6, 4], [4, 6, 8, 3]); + MetricsND::cosine([4, 6, 8, 3], [3, 6, 4]); } - /** - * @testdox Different dimension sizes for the coordinates in the Bray Curtis metric throw a InvalidDimensionException - * @covers phpOMS\Math\Topology\MetricsND - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different dimension sizes for the coordinates in the Bray Curtis metric throw a InvalidDimensionException')] public function testInvalidBrayCurtisDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); - MetricsND::brayCurtis([3, 6, 4], [4, 6, 8, 3]); + MetricsND::brayCurtis([4, 6, 8, 3], [3, 6, 4]); } - /** - * @testdox Different dimension sizes for the coordinates in the angular separation metric throw a InvalidDimensionException - * @covers phpOMS\Math\Topology\MetricsND - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different dimension sizes for the coordinates in the angular separation metric throw a InvalidDimensionException')] public function testInvalidAngularSeparationDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); - MetricsND::angularSeparation([3, 6, 4], [4, 6, 8, 3]); + MetricsND::angularSeparation([4, 6, 8, 3], [3, 6, 4]); } - /** - * @testdox Different dimension sizes for the coordinates in the hamming metric throw a InvalidDimensionException - * @covers phpOMS\Math\Topology\MetricsND - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different dimension sizes for the coordinates in the hamming metric throw a InvalidDimensionException')] public function testInvalidHammingDimension() : void { $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); - MetricsND::hamming([3, 6, 4], [4, 6, 8, 3]); + MetricsND::hamming([4, 6, 8, 3], [3, 6, 4]); } } diff --git a/tests/Message/Cli/CliHeaderTest.php b/tests/Message/Cli/CliHeaderTest.php index a214870e6..b80ad2cce 100755 --- a/tests/Message/Cli/CliHeaderTest.php +++ b/tests/Message/Cli/CliHeaderTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,6 +21,8 @@ use phpOMS\Message\Http\RequestStatusCode; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Message\Cli\CliHeader::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Message\Cli\CliHeader::class)] final class CliHeaderTest extends \PHPUnit\Framework\TestCase { private CliHeader $header; @@ -33,10 +35,7 @@ final class CliHeaderTest extends \PHPUnit\Framework\TestCase $this->header = new CliHeader(); } - /** - * @covers phpOMS\Message\Cli\CliHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDefaults() : void { self::assertFalse($this->header->isLocked()); @@ -50,30 +49,21 @@ final class CliHeaderTest extends \PHPUnit\Framework\TestCase self::assertEquals(0, $this->header->account); } - /** - * @covers phpOMS\Message\Cli\CliHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testValueInputOutput() : void { self::assertTrue($this->header->set('key', 'header')); self::assertEquals(['header'], $this->header->get('key')); } - /** - * @covers phpOMS\Message\Cli\CliHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testHasKey() : void { self::assertTrue($this->header->set('key', 'header')); self::assertTrue($this->header->has('key')); } - /** - * @covers phpOMS\Message\Cli\CliHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidOverwrite() : void { self::assertTrue($this->header->set('key', 'header')); @@ -81,10 +71,7 @@ final class CliHeaderTest extends \PHPUnit\Framework\TestCase self::assertEquals(['header'], $this->header->get('key')); } - /** - * @covers phpOMS\Message\Cli\CliHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testOverwrite() : void { self::assertTrue($this->header->set('key', 'header')); @@ -92,10 +79,7 @@ final class CliHeaderTest extends \PHPUnit\Framework\TestCase self::assertEquals(['header3'], $this->header->get('key')); } - /** - * @covers phpOMS\Message\Cli\CliHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testRemove() : void { self::assertTrue($this->header->set('key', 'header')); @@ -104,31 +88,22 @@ final class CliHeaderTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->header->remove('key')); } - /** - * @testdox The header can generate default http headers based on status codes - * @covers phpOMS\Message\Cli\CliHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The header can generate default http headers based on status codes')] public function testHeaderGeneration() : void { self::markTestIncomplete(); $this->header->generate(RequestStatusCode::R_500); } - /** - * @covers phpOMS\Message\Cli\CliHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testAccount() : void { $this->header->account = 2; self::assertEquals(2, $this->header->account); } - /** - * @covers phpOMS\Message\Cli\CliHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testLockedHeaderSet() : void { $this->header->lock(); @@ -136,10 +111,7 @@ final class CliHeaderTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->header->set('key', 'value')); } - /** - * @covers phpOMS\Message\Cli\CliHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testLockedHeaderRemove() : void { $this->header->lock(); diff --git a/tests/Message/Cli/CliRequestTest.php b/tests/Message/Cli/CliRequestTest.php index 6f78a5c7d..0be20c8fe 100755 --- a/tests/Message/Cli/CliRequestTest.php +++ b/tests/Message/Cli/CliRequestTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -23,6 +23,7 @@ use phpOMS\Uri\Argument; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Message\Cli\CliRequest::class)] final class CliRequestTest extends \PHPUnit\Framework\TestCase { private CliRequest $request; @@ -35,10 +36,7 @@ final class CliRequestTest extends \PHPUnit\Framework\TestCase $this->request = new CliRequest(new Argument('get:some/test/path'), $l11n = new Localization()); } - /** - * @covers phpOMS\Message\Cli\CliRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDefault() : void { $request = new CliRequest(); @@ -52,40 +50,28 @@ final class CliRequestTest extends \PHPUnit\Framework\TestCase self::assertNull($request->getData('key')); } - /** - * @covers phpOMS\Message\Cli\CliRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testOSInputOutput() : void { $this->request->setOS(OSType::WINDOWS_XP); self::assertEquals(OSType::WINDOWS_XP, $this->request->getOS()); } - /** - * @covers phpOMS\Message\Cli\CliRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMethodInputOutput() : void { $this->request->setMethod(RequestMethod::POST); self::assertEquals(RequestMethod::POST, $this->request->getMethod()); } - /** - * @covers phpOMS\Message\Cli\CliRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInputOutputUriString() : void { self::assertEquals('get:some/test/path', $this->request->uri->__toString()); } - /** - * @testdox The url hashes for the different paths get correctly generated - * @covers phpOMS\Message\Cli\CliRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The url hashes for the different paths get correctly generated')] public function testHashingInputOutput() : void { $request = new CliRequest(new Argument(':test/path ?para1=abc ?para2=2 #frag'), $l11n = new Localization()); @@ -99,20 +85,14 @@ final class CliRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals($l11n, $request->header->l11n); } - /** - * @covers phpOMS\Message\Cli\CliRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInputOutputL11n() : void { $l11n = new Localization(); self::assertEquals($l11n, $this->request->header->l11n); } - /** - * @covers phpOMS\Message\Cli\CliRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDataInputOutput() : void { self::assertTrue($this->request->setData('key', 'value')); @@ -120,20 +100,14 @@ final class CliRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals(['key', 'value'], $this->request->getData()); } - /** - * @covers phpOMS\Message\Cli\CliRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testHasData() : void { self::assertTrue($this->request->setData('key', 'value')); self::assertTrue($this->request->hasData('key')); } - /** - * @covers phpOMS\Message\Cli\CliRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidOverwrite() : void { self::assertTrue($this->request->setData('key', 'value')); @@ -141,10 +115,7 @@ final class CliRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals('value', $this->request->getData('key')); } - /** - * @covers phpOMS\Message\Cli\CliRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testOverwrite() : void { self::assertTrue($this->request->setData('key', 'value')); @@ -153,10 +124,7 @@ final class CliRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals(['key', 'value2'], $this->request->getData()); } - /** - * @covers phpOMS\Message\Cli\CliRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testToString() : void { $request = new CliRequest(new Argument('get:some/test/path')); diff --git a/tests/Message/Cli/CliResponseTest.php b/tests/Message/Cli/CliResponseTest.php index d4069bb65..2a9b8a146 100755 --- a/tests/Message/Cli/CliResponseTest.php +++ b/tests/Message/Cli/CliResponseTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,6 +21,8 @@ use phpOMS\System\MimeType; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Message\Cli\CliResponse::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Message\Cli\CliResponse::class)] final class CliResponseTest extends \PHPUnit\Framework\TestCase { protected CliResponse $response; @@ -33,10 +35,7 @@ final class CliResponseTest extends \PHPUnit\Framework\TestCase $this->response = new CliResponse(); } - /** - * @covers phpOMS\Message\Cli\CliResponse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDefault() : void { $this->response = new CliResponse(new Localization()); @@ -47,10 +46,7 @@ final class CliResponseTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\phpOMS\Message\Cli\CliHeader', $this->response->header); } - /** - * @covers phpOMS\Message\Cli\CliResponse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSetGet() : void { $this->response = new CliResponse(new Localization()); @@ -60,11 +56,8 @@ final class CliResponseTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->response->remove('a')); } - /** - * @testdox Response data can be turned into an array - * @covers phpOMS\Message\Cli\CliResponse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Response data can be turned into an array')] public function testToArray() : void { $data = [ @@ -99,11 +92,8 @@ final class CliResponseTest extends \PHPUnit\Framework\TestCase self::assertEquals($data, $this->response->toArray()); } - /** - * @testdox A response with json as content-type is automatically rendered as json data - * @covers phpOMS\Message\Cli\CliResponse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A response with json as content-type is automatically rendered as json data')] public function testJsonRender() : void { $data = [ @@ -139,22 +129,16 @@ final class CliResponseTest extends \PHPUnit\Framework\TestCase self::assertEquals(\json_encode($data), $this->response->render()); } - /** - * @testdox Invalid response data results in an empty array - * @covers phpOMS\Message\Cli\CliResponse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid response data results in an empty array')] public function testInvalidResponseDataToArray() : void { $this->response->set('invalid', new class() {}); self::assertEquals([], $this->response->toArray()); } - /** - * @testdox Invalid response data results in an empty render - * @covers phpOMS\Message\Cli\CliResponse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid response data results in an empty render')] public function testInvalidResponseDataRender() : void { $this->response->set('invalid', new class() {}); diff --git a/tests/Message/HeaderAbstractTest.php b/tests/Message/HeaderAbstractTest.php index c303e4100..30e715133 100755 --- a/tests/Message/HeaderAbstractTest.php +++ b/tests/Message/HeaderAbstractTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,10 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Message\HeaderAbstract; /** - * @testdox phpOMS\tests\Message\HeaderAbstractTest: Abstract header for requests/responses - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Message\HeaderAbstract::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Message\HeaderAbstractTest: Abstract header for requests/responses')] final class HeaderAbstractTest extends \PHPUnit\Framework\TestCase { protected $header = null; @@ -65,11 +65,8 @@ final class HeaderAbstractTest extends \PHPUnit\Framework\TestCase }; } - /** - * @testdox The the status code can be set and returned - * @covers phpOMS\Message\HeaderAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The the status code can be set and returned')] public function testStatusCodeInputOutput() : void { $this->header->status = 2; diff --git a/tests/Message/Http/BrowserTypeTest.php b/tests/Message/Http/BrowserTypeTest.php index e90f85ba7..1d7eb1f3f 100755 --- a/tests/Message/Http/BrowserTypeTest.php +++ b/tests/Message/Http/BrowserTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Message\Http\BrowserType; */ final class BrowserTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(12, BrowserType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(BrowserType::getConstants(), \array_unique(BrowserType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('msie', BrowserType::IE); diff --git a/tests/Message/Http/HttpHeaderTest.php b/tests/Message/Http/HttpHeaderTest.php index 90fac841d..4376b4339 100755 --- a/tests/Message/Http/HttpHeaderTest.php +++ b/tests/Message/Http/HttpHeaderTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -22,10 +22,10 @@ use phpOMS\Message\Http\RequestStatusCode; use phpOMS\System\MimeType; /** - * @testdox phpOMS\tests\Message\Http\HttpHeaderTest: Header for http requests/responses - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Message\Http\HttpHeader::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Message\Http\HttpHeaderTest: Header for http requests/responses')] final class HttpHeaderTest extends \PHPUnit\Framework\TestCase { protected HttpHeader $header; @@ -38,11 +38,8 @@ final class HttpHeaderTest extends \PHPUnit\Framework\TestCase $this->header = new HttpHeader(); } - /** - * @testdox The header has the expected default values after initialization - * @covers phpOMS\Message\Http\HttpHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The header has the expected default values after initialization')] public function testDefaults() : void { self::assertFalse($this->header->isLocked()); @@ -57,11 +54,8 @@ final class HttpHeaderTest extends \PHPUnit\Framework\TestCase self::assertEquals(0, $this->header->account); } - /** - * @testdox Security policy headers get correctly identified - * @covers phpOMS\Message\Http\HttpHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Security policy headers get correctly identified')] public function testSecurityHeader() : void { self::assertTrue(HttpHeader::isSecurityHeader('content-security-policy')); @@ -71,11 +65,8 @@ final class HttpHeaderTest extends \PHPUnit\Framework\TestCase self::assertFalse(HttpHeader::isSecurityHeader('x-frame-optionss')); } - /** - * @testdox Header data can be set, checked for existence and returned - * @covers phpOMS\Message\Http\HttpHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Header data can be set, checked for existence and returned')] public function testDataInputOutput() : void { self::assertTrue($this->header->set('key', 'header')); @@ -83,11 +74,8 @@ final class HttpHeaderTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->header->has('key')); } - /** - * @testdox Header data can be forced to get overwritten - * @covers phpOMS\Message\Http\HttpHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Header data can be forced to get overwritten')] public function testOverwrite() : void { self::assertTrue($this->header->set('key', 'header')); @@ -95,11 +83,8 @@ final class HttpHeaderTest extends \PHPUnit\Framework\TestCase self::assertEquals(['header3'], $this->header->get('key')); } - /** - * @testdox By default header data doesn't get overwritten - * @covers phpOMS\Message\Http\HttpHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("By default header data doesn't get overwritten")] public function testInvalidOverwrite() : void { self::assertTrue($this->header->set('key', 'header')); @@ -107,11 +92,8 @@ final class HttpHeaderTest extends \PHPUnit\Framework\TestCase self::assertEquals(['header', 'header2'], $this->header->get('key')); } - /** - * @testdox Header data can be removed - * @covers phpOMS\Message\Http\HttpHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Header data can be removed')] public function testRemove() : void { self::assertTrue($this->header->set('key', 'header')); @@ -119,76 +101,55 @@ final class HttpHeaderTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->header->has('key')); } - /** - * @testdox None-existing header data cannot be removed - * @covers phpOMS\Message\Http\HttpHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('None-existing header data cannot be removed')] public function testInvalidRemove() : void { self::assertFalse($this->header->remove('key')); } - /** - * @testdox Account data can be set and returned - * @covers phpOMS\Message\Http\HttpHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Account data can be set and returned')] public function testAccountInputOutput() : void { $this->header->account = 2; self::assertEquals(2, $this->header->account); } - /** - * @testdox Data can be defined as downloadable - * @covers phpOMS\Message\Http\HttpHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be defined as downloadable')] public function testDownloadable() : void { $this->header->setDownloadable('testname', 'mp3'); self::assertEquals(MimeType::M_BIN, $this->header->get('Content-Type')[0]); } - /** - * @testdox A header can be locked - * @covers phpOMS\Message\Http\HttpHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A header can be locked')] public function testLockInputOutput() : void { $this->header->lock(); self::assertTrue($this->header->isLocked()); } - /** - * @testdox A locked header cannot add new data - * @covers phpOMS\Message\Http\HttpHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A locked header cannot add new data')] public function testLockInvalidSet() : void { $this->header->lock(); self::assertFalse($this->header->set('key', 'value')); } - /** - * @testdox A locked header cannot remove data - * @covers phpOMS\Message\Http\HttpHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A locked header cannot remove data')] public function testLockInvalidRemove() : void { $this->header->lock(); self::assertFalse($this->header->remove('key')); } - /** - * @testdox The header can generate default http headers based on status codes - * @covers phpOMS\Message\Http\HttpHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The header can generate default http headers based on status codes')] public function testHeaderGeneration() : void { $consts = RequestStatusCode::getConstants(); @@ -215,12 +176,8 @@ final class HttpHeaderTest extends \PHPUnit\Framework\TestCase $_SERVER = $tmp; } */ - - /** - * @testdox Security header data cannot be changed once defined - * @covers phpOMS\Message\Http\HttpHeader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Security header data cannot be changed once defined')] public function testInvalidOverwriteSecurityHeader() : void { self::assertTrue($this->header->set('content-security-policy', 'header')); diff --git a/tests/Message/Http/HttpRequestTest.php b/tests/Message/Http/HttpRequestTest.php index b90fb5d4b..9e44ced71 100755 --- a/tests/Message/Http/HttpRequestTest.php +++ b/tests/Message/Http/HttpRequestTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -25,17 +25,14 @@ use phpOMS\System\MimeType; use phpOMS\Uri\HttpUri; /** - * @testdox phpOMS\tests\Message\Http\HttpRequestTest: HttpRequest wrapper for http requests - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Message\Http\HttpRequest::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Message\Http\HttpRequestTest: HttpRequest wrapper for http requests')] final class HttpRequestTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The request has the expected default values after initialization - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The request has the expected default values after initialization')] public function testDefault() : void { $request = new HttpRequest(); @@ -62,11 +59,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals('en_US', $request->getLocale()); } - /** - * @testdox The OS can be set and returned - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The OS can be set and returned')] public function testOSInputOutput() : void { $request = new HttpRequest(new HttpUri('http://www.google.com/test/path'), $l11n = new Localization()); @@ -75,11 +69,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals(OSType::WINDOWS_XP, $request->getOS()); } - /** - * @testdox The browser can be set and returned - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The browser can be set and returned')] public function testBrowserTypeInputOutput() : void { $request = new HttpRequest(new HttpUri('http://www.google.com/test/path'), $l11n = new Localization()); @@ -92,11 +83,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals(['browser' => BrowserType::EDGE, 'os' => OSType::WINDOWS_XP], $request->getRequestInfo()); } - /** - * @testdox The request method can be set and returned - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The request method can be set and returned')] public function testRequestMethodInputOutput() : void { $request = new HttpRequest(new HttpUri('http://www.google.com/test/path'), $l11n = new Localization()); @@ -106,11 +94,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals(RouteVerb::PUT, $request->getRouteVerb()); } - /** - * @testdox The request referer can be returned - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The request referer can be returned')] public function testRequestRefererOutput() : void { $request = new HttpRequest(new HttpUri(''), $l11n = new Localization()); @@ -118,11 +103,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals('', $request->getReferer()); } - /** - * @testdox The route verb gets correctly inferred from the request method - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The route verb gets correctly inferred from the request method')] public function testRequestMethodToRouteVerb() : void { $request = new HttpRequest(new HttpUri('http://www.google.com/test/path'), $l11n = new Localization()); @@ -137,11 +119,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals(RouteVerb::SET, $request->getRouteVerb()); } - /** - * @testdox The request is correctly constructed - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The request is correctly constructed')] public function testConstructInputOutput() : void { $request = new HttpRequest(new HttpUri('http://www.google.com/test/path'), $l11n = new Localization()); @@ -149,11 +128,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals('http://www.google.com/test/path', $request->__toString()); } - /** - * @testdox The url hashes for the different paths get correctly generated - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The url hashes for the different paths get correctly generated')] public function testHashingInputOutput() : void { $request = new HttpRequest(new HttpUri('http://www.google.com/test/path'), $l11n = new Localization()); @@ -167,11 +143,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals($l11n, $request->header->l11n); } - /** - * @testdox Request data can be forcefully overwritten - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Request data can be forcefully overwritten')] public function testOverwrite() : void { $request = new HttpRequest(new HttpUri('http://www.google.com/test/path'), $l11n = new Localization()); @@ -181,11 +154,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals('value2', $request->getData('key')); } - /** - * @testdox Request data is not overwritten by default - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Request data is not overwritten by default')] public function testInvalidOverwrite() : void { $request = new HttpRequest(new HttpUri('http://www.google.com/test/path'), $l11n = new Localization()); @@ -195,11 +165,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals('value', $request->getData('key')); } - /** - * @testdox The uri can be changed and returned - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The uri can be changed and returned')] public function testUriInputOutput() : void { $request = new HttpRequest(new HttpUri('http://www.google.com/test/path'), $l11n = new Localization()); @@ -208,11 +175,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals('http://www.google.com/test/path2', $request->__toString()); } - /** - * @testdox Json data can be read from the request - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Json data can be read from the request')] public function testDataJsonRead() : void { $request = new HttpRequest(); @@ -227,11 +191,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals($data, $request->getDataJson('abc')); } - /** - * @testdox None-existing json data reads return empty data - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('None-existing json data reads return empty data')] public function testEmptyDataJsonRead() : void { $request = new HttpRequest(); @@ -239,11 +200,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $request->getDataJson('def')); } - /** - * @testdox Invalid json data returns empty data - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid json data returns empty data')] public function testInvalidDataJsonRead() : void { $request = new HttpRequest(); @@ -258,11 +216,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals($data, $request->getDataJson('abc')); } - /** - * @testdox List data can be read from the request - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('List data can be read from the request')] public function testDataList() : void { $request = new HttpRequest(); @@ -276,11 +231,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals($data, $request->getDataList('abc')); } - /** - * @testdox None-existing list data reads return empty data - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('None-existing list data reads return empty data')] public function testEmptyDataList() : void { $request = new HttpRequest(); @@ -288,11 +240,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $request->getDataList('def')); } - /** - * @testdox Request data can be read with pattern matching - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Request data can be read with pattern matching')] public function testDataLike() : void { $request = new HttpRequest(); @@ -304,11 +253,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals(['abcde' => $data], $request->getLike('[a-z]*')); } - /** - * @testdox In case of no pattern matches empty data is returned - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('In case of no pattern matches empty data is returned')] public function testInvalidDataLikeMatch() : void { $request = new HttpRequest(); @@ -320,22 +266,16 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $request->getLike('abcdef')); } - /** - * @testdox A request with a path can be correctly casted to a string - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A request with a path can be correctly casted to a string')] public function testToString() : void { $request = new HttpRequest(new HttpUri('http://www.google.com/test/path')); self::assertEquals('http://www.google.com/test/path', $request->__toString()); } - /** - * @testdox A request with a path and manually added data can be correctly casted to a string - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A request with a path and manually added data can be correctly casted to a string')] public function testToStringData() : void { $request = new HttpRequest(new HttpUri('http://www.google.com/test/path')); @@ -345,11 +285,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals('http://www.google.com/test/path?test=data&test2=3', $request->__toString()); } - /** - * @testdox A request with a path, query parameters and manually added data can be correctly casted to a string - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A request with a path, query parameters and manually added data can be correctly casted to a string')] public function testToStringGetData() : void { $request = new HttpRequest(new HttpUri('http://www.google.com/test/path?test=var')); @@ -360,11 +297,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase self::assertEquals('http://www.google.com/test/path?test=var&test=data&test2=3', $request->__toString()); } - /** - * @testdox A rest request can be made from a request and the result can be read - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A rest request can be made from a request and the result can be read')] public function testRestRequest() : void { $request = new HttpRequest(new HttpUri('https://raw.githubusercontent.com/Karaka-Management/Karaka/develop/LICENSE.txt')); @@ -376,11 +310,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A request can be made with post data - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A request can be made with post data')] public function testPostData() : void { $request = new HttpRequest(new HttpUri('http://localhost:1234' . $GLOBALS['frameworkpath'] . 'tests/Message/Http/HttpRequestPost.php')); @@ -394,11 +325,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A request can be made with json data - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A request can be made with json data')] public function testJsonData() : void { $request = new HttpRequest(new HttpUri('http://localhost:1234' . $GLOBALS['frameworkpath'] . 'tests/Message/Http/HttpRequestPost.php')); @@ -412,11 +340,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A request can be made with multipart data - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A request can be made with multipart data')] public function testMultipartData() : void { $request = new HttpRequest(new HttpUri('http://localhost:1234' . $GLOBALS['frameworkpath'] . 'tests/Message/Http/HttpRequestPost.php')); @@ -430,11 +355,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox If no language can be identified en is returned - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('If no language can be identified en is returned')] public function testLanguage() : void { $request = new HttpRequest(new HttpUri('http://localhost:1234' . $GLOBALS['frameworkpath'] . 'tests/Message/Http/HttpRequestLanguage.php')); @@ -446,11 +368,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox If no locale can be identified en_US is returned - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('If no locale can be identified en_US is returned')] public function testLocale() : void { $request = new HttpRequest(new HttpUri('http://localhost:1234' . $GLOBALS['frameworkpath'] . 'tests/Message/Http/HttpRequestLocale.php')); @@ -462,11 +381,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A none-mobile request is recognized as none-mobile - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-mobile request is recognized as none-mobile')] public function testMobile() : void { $request = new HttpRequest(new HttpUri('http://localhost:1234' . $GLOBALS['frameworkpath'] . 'tests/Message/Http/HttpRequestMobile.php')); @@ -478,11 +394,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox If the OS type is unknown a unknwon OS type is returned - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('If the OS type is unknown a unknwon OS type is returned')] public function testOS() : void { $request = new HttpRequest(new HttpUri('http://localhost:1234' . $GLOBALS['frameworkpath'] . 'tests/Message/Http/HttpRequestOS.php')); @@ -494,11 +407,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox If the browser type is unknown a unknwon browser type is returned - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('If the browser type is unknown a unknwon browser type is returned')] public function testBrowser() : void { $request = new HttpRequest(new HttpUri('http://localhost:1234' . $GLOBALS['frameworkpath'] . 'tests/Message/Http/HttpRequestBrowser.php')); @@ -510,11 +420,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A invalid https port throws a OutOfRangeException - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid https port throws a OutOfRangeException')] public function testInvalidHttpsPort() : void { $this->expectException(\OutOfRangeException::class); @@ -523,11 +430,8 @@ final class HttpRequestTest extends \PHPUnit\Framework\TestCase $request->isHttps(-1); } - /** - * @testdox A Invalid route verb throws a Exception - * @covers phpOMS\Message\Http\HttpRequest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A Invalid route verb throws a Exception')] public function testInvalidRouteVerb() : void { $this->expectException(\Exception::class); diff --git a/tests/Message/Http/HttpResponseTest.php b/tests/Message/Http/HttpResponseTest.php index 0352ccf50..516aec8a3 100755 --- a/tests/Message/Http/HttpResponseTest.php +++ b/tests/Message/Http/HttpResponseTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,10 +18,11 @@ use phpOMS\Message\Http\HttpResponse; use phpOMS\System\MimeType; /** - * @testdox phpOMS\tests\Message\Http\ResponseTest: HttpResponse wrapper for http responses - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Message\Http\HttpResponse::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Message\Http\HttpResponse::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Message\Http\ResponseTest: HttpResponse wrapper for http responses')] final class HttpResponseTest extends \PHPUnit\Framework\TestCase { protected HttpResponse $response; @@ -34,11 +35,8 @@ final class HttpResponseTest extends \PHPUnit\Framework\TestCase $this->response = new HttpResponse(); } - /** - * @testdox The response has the expected default values after initialization - * @covers phpOMS\Message\Http\HttpResponse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The response has the expected default values after initialization')] public function testDefault() : void { self::assertEquals('', $this->response->getBody()); @@ -48,33 +46,24 @@ final class HttpResponseTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\phpOMS\Message\Http\HttpHeader', $this->response->header); } - /** - * @testdox Response data can be set and returned - * @covers phpOMS\Message\Http\HttpResponse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Response data can be set and returned')] public function testResponseInputOutput() : void { $this->response->setResponse(['a' => 1]); self::assertEquals(1, $this->response->getData('a')); } - /** - * @testdox Response data can be removed - * @covers phpOMS\Message\Http\HttpResponse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Response data can be removed')] public function testRemove() : void { $this->response->setResponse(['a' => 1]); self::assertTrue($this->response->remove('a')); } - /** - * @testdox None-existing response data cannot be removed - * @covers phpOMS\Message\Http\HttpResponse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('None-existing response data cannot be removed')] public function testInvalidRemove() : void { $this->response->setResponse(['a' => 1]); @@ -83,11 +72,8 @@ final class HttpResponseTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->response->remove('a')); } - /** - * @testdox Test disabling output buffering - * @covers phpOMS\Message\Http\HttpResponse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Test disabling output buffering')] public function testEndAllOutputBuffering() : void { if (\headers_sent()) { @@ -103,11 +89,8 @@ final class HttpResponseTest extends \PHPUnit\Framework\TestCase self::assertEquals($start, \ob_get_level()); } - /** - * @testdox Response data can be turned into an array - * @covers phpOMS\Message\Http\HttpResponse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Response data can be turned into an array')] public function testToArray() : void { $data = [ @@ -142,11 +125,8 @@ final class HttpResponseTest extends \PHPUnit\Framework\TestCase self::assertEquals($data, $this->response->toArray()); } - /** - * @testdox A response with json as content-type is automatically rendered as json data - * @covers phpOMS\Message\Http\HttpResponse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A response with json as content-type is automatically rendered as json data')] public function testJsonRender() : void { $data = [ @@ -182,11 +162,8 @@ final class HttpResponseTest extends \PHPUnit\Framework\TestCase self::assertEquals(\json_encode($data), $this->response->render()); } - /** - * @testdox Json data can be decoded from the response data - * @covers phpOMS\Message\Http\HttpResponse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Json data can be decoded from the response data')] public function testJsonDataDecode() : void { $array = [1, 'abc' => 'def']; @@ -195,11 +172,8 @@ final class HttpResponseTest extends \PHPUnit\Framework\TestCase self::assertEquals($array, $this->response->getJsonData()); } - /** - * @testdox A html response can be forced to minimize the content by removing newlines and whitespaces - * @covers phpOMS\Message\Http\HttpResponse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A html response can be forced to minimize the content by removing newlines and whitespaces')] public function testMinimizedRender() : void { $this->response->set('view', new class() extends \phpOMS\Views\View { @@ -213,11 +187,8 @@ final class HttpResponseTest extends \PHPUnit\Framework\TestCase self::assertEquals('view_string with
text
that has whitespaces and new lines', $this->response->render(true)); } - /** - * @testdox None-html responses cannot be forced to minimize the content by removing newlines and whitespaces - * @covers phpOMS\Message\Http\HttpResponse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('None-html responses cannot be forced to minimize the content by removing newlines and whitespaces')] public function testInvalidMinimizedRender() : void { $this->response->set('view', new class() extends \phpOMS\Views\View { @@ -231,22 +202,16 @@ final class HttpResponseTest extends \PHPUnit\Framework\TestCase self::assertEquals(" view_string with
text
that has \n whitespaces and \n\nnew lines\n ", $this->response->render(true)); } - /** - * @testdox Invalid response data results in an empty array - * @covers phpOMS\Message\Http\HttpResponse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid response data results in an empty array')] public function testInvalidResponseDataToArray() : void { $this->response->set('invalid', new class() {}); self::assertEquals([], $this->response->toArray()); } - /** - * @testdox Invalid response data results in an empty render - * @covers phpOMS\Message\Http\HttpResponse - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid response data results in an empty render')] public function testInvalidResponseDataRender() : void { $this->response->set('invalid', new class() {}); diff --git a/tests/Message/Http/OSTypeTest.php b/tests/Message/Http/OSTypeTest.php index 227bfa897..c7af172c7 100755 --- a/tests/Message/Http/OSTypeTest.php +++ b/tests/Message/Http/OSTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,19 +21,15 @@ use phpOMS\Message\Http\OSType; */ final class OSTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(24, OSType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(OSType::getConstants(), \array_unique(OSType::getConstants())); diff --git a/tests/Message/Http/RequestMethodTest.php b/tests/Message/Http/RequestMethodTest.php index 18aa59036..0879346d6 100755 --- a/tests/Message/Http/RequestMethodTest.php +++ b/tests/Message/Http/RequestMethodTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Message\Http\RequestMethod; */ final class RequestMethodTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(6, RequestMethod::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(RequestMethod::getConstants(), \array_unique(RequestMethod::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('GET', RequestMethod::GET); diff --git a/tests/Message/Http/RequestStatusCodeTest.php b/tests/Message/Http/RequestStatusCodeTest.php index 0a3065b20..dbfebcaa1 100755 --- a/tests/Message/Http/RequestStatusCodeTest.php +++ b/tests/Message/Http/RequestStatusCodeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Message\Http\RequestStatusCode; */ final class RequestStatusCodeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(59, RequestStatusCode::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(RequestStatusCode::getConstants(), \array_unique(RequestStatusCode::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(100, RequestStatusCode::R_100); diff --git a/tests/Message/Http/RequestStatusTest.php b/tests/Message/Http/RequestStatusTest.php index 191595725..f2530dda6 100755 --- a/tests/Message/Http/RequestStatusTest.php +++ b/tests/Message/Http/RequestStatusTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Message\Http\RequestStatus; */ final class RequestStatusTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(58, RequestStatus::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(RequestStatus::getConstants(), \array_unique(RequestStatus::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('Continue', RequestStatus::R_100); diff --git a/tests/Message/Http/RestTest.php b/tests/Message/Http/RestTest.php index f4b7af59b..6d1f552c9 100755 --- a/tests/Message/Http/RestTest.php +++ b/tests/Message/Http/RestTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -22,17 +22,14 @@ use phpOMS\Message\Http\Rest; use phpOMS\Uri\HttpUri; /** - * @testdox phpOMS\tests\Message\Http\RestTest: Rest request wrapper - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Message\Http\Rest::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Message\Http\RestTest: Rest request wrapper')] final class RestTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A get request successfully returns the expected result - * @covers phpOMS\Message\Http\Rest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A get request successfully returns the expected result')] public function testRequest() : void { $request = new HttpRequest(new HttpUri('https://raw.githubusercontent.com/Karaka-Management/Karaka/develop/LICENSE.txt')); @@ -44,11 +41,8 @@ final class RestTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A post request with data successfully returns the expected result - * @covers phpOMS\Message\Http\Rest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A post request with data successfully returns the expected result')] public function testPost() : void { $request = new HttpRequest(new HttpUri('https://httpbin.org/post')); @@ -57,11 +51,8 @@ final class RestTest extends \PHPUnit\Framework\TestCase self::assertEquals('abc', REST::request($request)->getData('form')['pdata'] ?? ''); } - /** - * @testdox A put request with data successfully returns the expected result - * @covers phpOMS\Message\Http\Rest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A put request with data successfully returns the expected result')] public function testPut() : void { $request = new HttpRequest(new HttpUri('https://httpbin.org/put')); @@ -70,11 +61,8 @@ final class RestTest extends \PHPUnit\Framework\TestCase self::assertEquals('abc', REST::request($request)->getData('form')['pdata'] ?? ''); } - /** - * @testdox A delete request with data successfully returns the expected result - * @covers phpOMS\Message\Http\Rest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A delete request with data successfully returns the expected result')] public function testDelete() : void { $request = new HttpRequest(new HttpUri('https://httpbin.org/delete')); @@ -83,11 +71,8 @@ final class RestTest extends \PHPUnit\Framework\TestCase self::assertEquals('abc', REST::request($request)->getData('form')['ddata'] ?? ''); } - /** - * @testdox A get request with data successfully returns the expected result - * @covers phpOMS\Message\Http\Rest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A get request with data successfully returns the expected result')] public function testGet() : void { $request = new HttpRequest(new HttpUri('https://httpbin.org/get')); @@ -96,19 +81,13 @@ final class RestTest extends \PHPUnit\Framework\TestCase self::assertEquals('abc', REST::request($request)->getData('args')['gdata'] ?? ''); } - /** - * @covers phpOMS\Message\Http\Rest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testJsonRequest() : void { self::markTestIncomplete(); } - /** - * @covers phpOMS\Message\Http\Rest - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testMultiRequest() : void { self::markTestIncomplete(); diff --git a/tests/Message/Mail/EmailTest.php b/tests/Message/Mail/EmailTest.php index e25af6705..8f7b1b77c 100755 --- a/tests/Message/Mail/EmailTest.php +++ b/tests/Message/Mail/EmailTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,11 +21,10 @@ use phpOMS\System\CharsetType; use phpOMS\System\MimeType; /** - * @testdox phpOMS\tests\Message\MailHandlerTest: Abstract mail handler - * * @internal */ -final class EmailTestTest extends \PHPUnit\Framework\TestCase +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Message\MailHandlerTest: Abstract mail handler')] +final class EmailTest extends \PHPUnit\Framework\TestCase { protected Email $mail; diff --git a/tests/Message/Mail/ImapTest.php b/tests/Message/Mail/ImapTest.php index 2baaf78b1..a3b286415 100755 --- a/tests/Message/Mail/ImapTest.php +++ b/tests/Message/Mail/ImapTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Message\Mail\Imap; use phpOMS\Message\Mail\MailBoxInterface; /** - * @testdox phpOMS\tests\Message\MailHandlerTest: Abstract mail handler - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Message\MailHandlerTest: Abstract mail handler')] final class ImapTest extends \PHPUnit\Framework\TestCase { protected MailBoxInterface $handler; diff --git a/tests/Message/Mail/MailHandlerMailTrait.php b/tests/Message/Mail/MailHandlerMailTrait.php index d49c729c3..85b3343b2 100755 --- a/tests/Message/Mail/MailHandlerMailTrait.php +++ b/tests/Message/Mail/MailHandlerMailTrait.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -290,9 +290,7 @@ trait MailHandlerMailTrait self::assertTrue($this->handler->send($mail)); } - /** - * @dataProvider dataICalMethodMail - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataICalMethodMail')] public function testSendICalAltWithMail(string $methodLine, string $expected) : void { $this->handler->setMailer(SubmitType::MAIL); @@ -347,9 +345,7 @@ trait MailHandlerMailTrait ); } - /** - * @dataProvider dataICalMethodMail - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataICalMethodMail')] public function testSendICalAltAttachmentWithMail(string $methodLine, string $expected) : void { $this->handler->setMailer(SubmitType::MAIL); @@ -405,7 +401,7 @@ trait MailHandlerMailTrait ); } - public function dataICalMethodMail() + public static function dataICalMethodMail() : array { return [ 'Valid method: request (default)' => [ diff --git a/tests/Message/Mail/MailHandlerSendmailTrait.php b/tests/Message/Mail/MailHandlerSendmailTrait.php index 737e33bdf..95d78ba9b 100755 --- a/tests/Message/Mail/MailHandlerSendmailTrait.php +++ b/tests/Message/Mail/MailHandlerSendmailTrait.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -266,9 +266,7 @@ trait MailHandlerSendmailTrait self::assertTrue($this->handler->send($mail)); } - /** - * @dataProvider dataICalMethodSendmail - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataICalMethodSendmail')] public function testSendICalAltWithSendmail(string $methodLine, string $expected) : void { $this->handler->setMailer(SubmitType::SENDMAIL); @@ -321,9 +319,7 @@ trait MailHandlerSendmailTrait ); } - /** - * @dataProvider dataICalMethodSendmail - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataICalMethodSendmail')] public function testSendICalAltAttachmentWithSendmail(string $methodLine, string $expected) : void { $this->handler->setMailer(SubmitType::SENDMAIL); @@ -377,7 +373,7 @@ trait MailHandlerSendmailTrait ); } - public function dataICalMethodSendmail() + public static function dataICalMethodSendmail() : array { return [ 'Valid method: request (default)' => [ diff --git a/tests/Message/Mail/MailHandlerSmtpTrait.php b/tests/Message/Mail/MailHandlerSmtpTrait.php index 5a3e516c4..44581ea4f 100755 --- a/tests/Message/Mail/MailHandlerSmtpTrait.php +++ b/tests/Message/Mail/MailHandlerSmtpTrait.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -366,9 +366,7 @@ trait MailHandlerSmtpTrait self::assertTrue($this->handler->send($mail)); } - /** - * @dataProvider dataICalMethodSmtp - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataICalMethodSmtp')] public function testSendICalAltWithSmtp(string $methodLine, string $expected) : void { $this->handler->setMailer(SubmitType::SMTP); @@ -430,9 +428,7 @@ trait MailHandlerSmtpTrait ); } - /** - * @dataProvider dataICalMethodSmtp - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataICalMethodSmtp')] public function testSendICalAltAttachmentWithSmtp(string $methodLine, string $expected) : void { $this->handler->setMailer(SubmitType::SMTP); @@ -495,7 +491,7 @@ trait MailHandlerSmtpTrait ); } - public function dataICalMethodSmtp() + public static function dataICalMethodSmtp() : array { return [ 'Valid method: request (default)' => [ diff --git a/tests/Message/Mail/MailHandlerTest.php b/tests/Message/Mail/MailHandlerTest.php index 540ea0c68..4e6cc8594 100755 --- a/tests/Message/Mail/MailHandlerTest.php +++ b/tests/Message/Mail/MailHandlerTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,9 @@ require_once __DIR__ . '/../../Autoloader.php'; use phpOMS\Message\Mail\MailHandler; /** - * @testdox phpOMS\tests\Message\MailHandlerTest: Abstract mail handler - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Message\MailHandlerTest: Abstract mail handler')] final class MailHandlerTest extends \PHPUnit\Framework\TestCase { protected MailHandler $handler; diff --git a/tests/Message/Mail/Pop3Test.php b/tests/Message/Mail/Pop3Test.php index cde9ed1c1..39635eadd 100755 --- a/tests/Message/Mail/Pop3Test.php +++ b/tests/Message/Mail/Pop3Test.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Message\Mail\MailBoxInterface; use phpOMS\Message\Mail\Pop3; /** - * @testdox phpOMS\tests\Message\MailHandlerTest: Abstract mail handler - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Message\MailHandlerTest: Abstract mail handler')] final class Pop3Test extends \PHPUnit\Framework\TestCase { protected MailBoxInterface $handler; diff --git a/tests/Message/RequestAbstractTest.php b/tests/Message/RequestAbstractTest.php index 79c996aa7..eaa8caca7 100755 --- a/tests/Message/RequestAbstractTest.php +++ b/tests/Message/RequestAbstractTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,10 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Message\RequestAbstract; /** - * @testdox phpOMS\tests\Message\RequestAbstractTest: Abstract request - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Message\RequestAbstract::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Message\RequestAbstractTest: Abstract request')] final class RequestAbstractTest extends \PHPUnit\Framework\TestCase { protected $request = null; @@ -51,11 +51,8 @@ final class RequestAbstractTest extends \PHPUnit\Framework\TestCase }; } - /** - * @testdox Request data can be set and returned - * @covers phpOMS\Message\RequestAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Request data can be set and returned')] public function testDataInputOutput() : void { self::assertTrue($this->request->setData('key', 'value')); @@ -64,21 +61,15 @@ final class RequestAbstractTest extends \PHPUnit\Framework\TestCase self::assertEquals(['key' => 'value'], $this->request->getData()); } - /** - * @testdox A invalid data key returns null - * @covers phpOMS\Message\RequestAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid data key returns null')] public function testInvalidDataKeyOutput() : void { self::assertNull($this->request->getData('invalid')); } - /** - * @testdox Request data can be set and returned with correct types - * @covers phpOMS\Message\RequestAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Request data can be set and returned with correct types')] public function testDataTypeInputOutput() : void { $this->request->setData('key1', 1); @@ -103,18 +94,14 @@ final class RequestAbstractTest extends \PHPUnit\Framework\TestCase self::assertEquals(['asdf' => false], $this->request->getData()); } - /** - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDataJsonInputOutput() : void { $this->request->setData('asdf', '[1,2,3]'); self::assertEquals([1,2,3], $this->request->getDataJson('asdf')); } - /** - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDataStringInputOutput() : void { $this->request->setData('asdf', 1); @@ -122,9 +109,7 @@ final class RequestAbstractTest extends \PHPUnit\Framework\TestCase self::assertEquals('1', $this->request->getData('asdf', 'string')); } - /** - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDataBoolInputOutput() : void { $this->request->setData('asdf', 1); @@ -132,9 +117,7 @@ final class RequestAbstractTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->request->getData('asdf', 'bool')); } - /** - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDataFloatInputOutput() : void { $this->request->setData('asdf', 1); @@ -142,9 +125,7 @@ final class RequestAbstractTest extends \PHPUnit\Framework\TestCase self::assertEquals(1.0, $this->request->getData('asdf', 'float')); } - /** - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDataDateTimeInputOutput() : void { $this->request->setData('asdf', '2023-01-01'); @@ -158,9 +139,7 @@ final class RequestAbstractTest extends \PHPUnit\Framework\TestCase self::assertEquals(1, $this->request->getData('asdf', 'invalid')); } - /** - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidDataTypeInputOutput() : void { self::assertNull($this->request->getDataString('a')); diff --git a/tests/Message/ResponseAbstractTest.php b/tests/Message/ResponseAbstractTest.php index 87530523b..ba1db7b84 100755 --- a/tests/Message/ResponseAbstractTest.php +++ b/tests/Message/ResponseAbstractTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,10 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Message\ResponseAbstract; /** - * @testdox phpOMS\tests\Message\ResponseAbstractTest: Abstract response - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Message\ResponseAbstract::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Message\ResponseAbstractTest: Abstract response')] final class ResponseAbstractTest extends \PHPUnit\Framework\TestCase { protected $response = null; @@ -46,22 +46,16 @@ final class ResponseAbstractTest extends \PHPUnit\Framework\TestCase }; } - /** - * @testdox The response has the expected default values after initialization - * @covers phpOMS\Message\ResponseAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The response has the expected default values after initialization')] public function testDefault() : void { self::assertNull($this->response->getData('asdf')); self::assertEquals('', $this->response->getBody()); } - /** - * @testdox The response can be json serialized - * @covers phpOMS\Message\ResponseAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The response can be json serialized')] public function testJsonSerialize() : void { self::assertEquals([1], $this->response->jsonSerialize()); @@ -73,22 +67,16 @@ final class ResponseAbstractTest extends \PHPUnit\Framework\TestCase self::assertEquals(['asdf' => false], $this->response->getData()); } - /** - * @testdox Data can be set and returned for the response - * @covers phpOMS\Message\ResponseAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be set and returned for the response')] public function testDataInputOutput() : void { $this->response->set('asdf', false); self::assertFalse($this->response->getData('asdf')); } - /** - * @testdox Data can be set and returned for the response - * @covers phpOMS\Message\ResponseAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be set and returned for the response')] public function testDataStringInputOutput() : void { $this->response->set('asdf', 1); @@ -96,11 +84,8 @@ final class ResponseAbstractTest extends \PHPUnit\Framework\TestCase self::assertEquals('1', $this->response->getData('asdf', 'string')); } - /** - * @testdox Data can be set and returned for the response - * @covers phpOMS\Message\ResponseAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be set and returned for the response')] public function testDataBoolInputOutput() : void { $this->response->set('asdf', 1); @@ -108,11 +93,8 @@ final class ResponseAbstractTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->response->getData('asdf', 'bool')); } - /** - * @testdox Data can be set and returned for the response - * @covers phpOMS\Message\ResponseAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be set and returned for the response')] public function testDataFloatInputOutput() : void { $this->response->set('asdf', 1); @@ -120,20 +102,15 @@ final class ResponseAbstractTest extends \PHPUnit\Framework\TestCase self::assertEquals(1.0, $this->response->getData('asdf', 'float')); } - /** - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDataJsonInputOutput() : void { $this->response->set('asdf', '[1,2,3]'); self::assertEquals([1,2,3], $this->response->getDataJson('asdf')); } - /** - * @testdox Data can be set and returned for the response - * @covers phpOMS\Message\ResponseAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be set and returned for the response')] public function testDataDateTimeInputOutput() : void { $this->response->set('asdf', '2023-01-01'); @@ -147,11 +124,8 @@ final class ResponseAbstractTest extends \PHPUnit\Framework\TestCase self::assertEquals(1, $this->response->getData('asdf', 'invalid')); } - /** - * @testdox Data can be set and returned for the response - * @covers phpOMS\Message\ResponseAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be set and returned for the response')] public function testInvalidDataTypeInputOutput() : void { self::assertNull($this->response->getDataString('a')); diff --git a/tests/Message/Socket/HeaderTest.php b/tests/Message/Socket/HeaderTest.php index fe604cd5d..86ac4dfcd 100755 --- a/tests/Message/Socket/HeaderTest.php +++ b/tests/Message/Socket/HeaderTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Message/Socket/PacketManagerTest.php b/tests/Message/Socket/PacketManagerTest.php index 66d9f2234..c65898193 100755 --- a/tests/Message/Socket/PacketManagerTest.php +++ b/tests/Message/Socket/PacketManagerTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Message/Socket/PacketTypeTest.php b/tests/Message/Socket/PacketTypeTest.php index 6be10b092..2ea1baf59 100755 --- a/tests/Message/Socket/PacketTypeTest.php +++ b/tests/Message/Socket/PacketTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Message\Socket\PacketType; */ final class PacketTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(11, PacketType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(PacketType::getConstants(), \array_unique(PacketType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(0, PacketType::CONNECT); diff --git a/tests/Message/Socket/RequestTest.php b/tests/Message/Socket/RequestTest.php index b459f0d27..d5e2f7468 100755 --- a/tests/Message/Socket/RequestTest.php +++ b/tests/Message/Socket/RequestTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Message/Socket/ResponseTest.php b/tests/Message/Socket/ResponseTest.php index 449dd0493..7ecb8a27c 100755 --- a/tests/Message/Socket/ResponseTest.php +++ b/tests/Message/Socket/ResponseTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Model/Html/FormElementGeneratorTest.php b/tests/Model/Html/FormElementGeneratorTest.php index 7aa7ccde0..04d71661f 100755 --- a/tests/Model/Html/FormElementGeneratorTest.php +++ b/tests/Model/Html/FormElementGeneratorTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Model\Html; use phpOMS\Model\Html\FormElementGenerator; /** - * @testdox phpOMS\tests\Model\Html\FormElementGeneratorTest: Form element generator - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Model\Html\FormElementGenerator::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Model\Html\FormElementGeneratorTest: Form element generator')] final class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A text input element can be generated - * @covers phpOMS\Model\Html\FormElementGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A text input element can be generated')] public function testGenerateTextInput() : void { $element = [ @@ -49,11 +46,8 @@ final class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A text input element can be generated with a custom value - * @covers phpOMS\Model\Html\FormElementGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A text input element can be generated with a custom value')] public function testGenerateTextInputWithValue() : void { $element = [ @@ -75,11 +69,8 @@ final class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A datetime input element can be generated with custom formatting - * @covers phpOMS\Model\Html\FormElementGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A datetime input element can be generated with custom formatting')] public function testGenerateDateTimeInput() : void { $element = [ @@ -102,11 +93,8 @@ final class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A checkbox element can be generated - * @covers phpOMS\Model\Html\FormElementGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A checkbox element can be generated')] public function testGenerateCheckboxInput() : void { $element = [ @@ -130,11 +118,8 @@ final class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A checkbox element can be generated with a localized label element - * @covers phpOMS\Model\Html\FormElementGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A checkbox element can be generated with a localized label element')] public function testGenerateCheckboxWithLanguageInput() : void { $element = [ @@ -158,11 +143,8 @@ final class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A radio element can be generated - * @covers phpOMS\Model\Html\FormElementGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A radio element can be generated')] public function testGenerateRadioInput() : void { $element = [ @@ -186,11 +168,8 @@ final class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A radio element can be generated with a localized label element - * @covers phpOMS\Model\Html\FormElementGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A radio element can be generated with a localized label element')] public function testGenerateRadioWithLanguageInput() : void { $element = [ @@ -214,11 +193,8 @@ final class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A label element can be generated - * @covers phpOMS\Model\Html\FormElementGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A label element can be generated')] public function testGenerateLabel() : void { $element = [ @@ -237,11 +213,8 @@ final class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A localized label element can be generated - * @covers phpOMS\Model\Html\FormElementGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A localized label element can be generated')] public function testGenerateWithLanguageLabel() : void { $element = [ @@ -260,11 +233,8 @@ final class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A textarea element can be generated - * @covers phpOMS\Model\Html\FormElementGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A textarea element can be generated')] public function testGenerateTextarea() : void { $element = [ @@ -284,11 +254,8 @@ final class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A textarea element can be generated with a custom value - * @covers phpOMS\Model\Html\FormElementGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A textarea element can be generated with a custom value')] public function testGenerateWithValueTextarea() : void { $element = [ @@ -308,11 +275,8 @@ final class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A select element can be generated - * @covers phpOMS\Model\Html\FormElementGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A select element can be generated')] public function testGenerateSelect() : void { $element = [ @@ -337,11 +301,8 @@ final class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A localized select element can be generated - * @covers phpOMS\Model\Html\FormElementGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A localized select element can be generated')] public function testGenerateWithLanguageSelect() : void { $element = [ @@ -366,11 +327,8 @@ final class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A missing or invalid element type generates a INVALID output - * @covers phpOMS\Model\Html\FormElementGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing or invalid element type generates a INVALID output')] public function testInvalidElementType() : void { self::assertEquals( diff --git a/tests/Model/Html/HeadTest.php b/tests/Model/Html/HeadTest.php index 4aea21376..302a6dff5 100755 --- a/tests/Model/Html/HeadTest.php +++ b/tests/Model/Html/HeadTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,10 +18,10 @@ use phpOMS\Asset\AssetType; use phpOMS\Model\Html\Head; /** - * @testdox phpOMS\tests\Model\Html\HeadTest: Html head - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Model\Html\Head::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Model\Html\HeadTest: Html head')] final class HeadTest extends \PHPUnit\Framework\TestCase { protected Head $head; @@ -34,11 +34,8 @@ final class HeadTest extends \PHPUnit\Framework\TestCase $this->head = new Head(); } - /** - * @testdox The head has the expected default values after initialization - * @covers phpOMS\Model\Html\Head - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The head has the expected default values after initialization')] public function testDefault() : void { self::assertInstanceOf('\phpOMS\Model\Html\Meta', $this->head->meta); @@ -53,44 +50,32 @@ final class HeadTest extends \PHPUnit\Framework\TestCase self::assertEquals('', $this->head->render()); } - /** - * @testdox The title can be set and returned - * @covers phpOMS\Model\Html\Head - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The title can be set and returned')] public function testTitleInputOutput() : void { $this->head->title = 'my title'; self::assertEquals('my title', $this->head->title); } - /** - * @testdox The style can be set and returned - * @covers phpOMS\Model\Html\Head - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The style can be set and returned')] public function testStyleInputOutput() : void { $this->head->setStyle('base', '#test .class { color: #000; }'); self::assertEquals(['base' => '#test .class { color: #000; }'], $this->head->getStyleAll()); } - /** - * @testdox The script can be set and returned - * @covers phpOMS\Model\Html\Head - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The script can be set and returned')] public function testScriptInputOutput() : void { $this->head->setScript('key', 'console.log("msg");'); self::assertEquals(['key' => 'console.log("msg");'], $this->head->getScriptAll()); } - /** - * @testdox The assets can be set and rendered - * @covers phpOMS\Model\Html\Head - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The assets can be set and rendered')] public function testAssetRender() : void { $this->head->addAsset(AssetType::CSS, '/path/styles.css'); @@ -109,33 +94,24 @@ final class HeadTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The assets can be set and rendered at the end of the document - * @covers phpOMS\Model\Html\Head - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The assets can be set and rendered at the end of the document')] public function testAssetLateRender() : void { $this->head->addAsset(AssetType::JSLATE, '/path/late.js'); self::assertEquals('', $this->head->renderAssetsLate()); } - /** - * @testdox The assets can be set and rendered with attributes - * @covers phpOMS\Model\Html\Head - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The assets can be set and rendered with attributes')] public function testAssetRenderWithAttribute() : void { $this->head->addAsset(AssetType::JS, '/path/late.js', ['testkey' => 'testvalue']); self::assertEquals('', $this->head->renderAssets()); } - /** - * @testdox The assets can be set and rendered at the end of the document with attributes - * @covers phpOMS\Model\Html\Head - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The assets can be set and rendered at the end of the document with attributes')] public function testAssetLateRenderWithAttribute() : void { $this->head->addAsset(AssetType::JSLATE, '/path/late.js', ['testkey' => 'testvalue']); diff --git a/tests/Model/Html/MetaTest.php b/tests/Model/Html/MetaTest.php index 62b4020a7..2ccc0765d 100755 --- a/tests/Model/Html/MetaTest.php +++ b/tests/Model/Html/MetaTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,10 @@ namespace phpOMS\tests\Model\Html; use phpOMS\Model\Html\Meta; /** - * @testdox phpOMS\tests\Model\Html\MetaTest: Html meta data - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Model\Html\Meta::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Model\Html\MetaTest: Html meta data')] final class MetaTest extends \PHPUnit\Framework\TestCase { protected Meta $meta; @@ -33,11 +33,8 @@ final class MetaTest extends \PHPUnit\Framework\TestCase $this->meta = new Meta(); } - /** - * @testdox The meta data has the expected default values after initialization - * @covers phpOMS\Model\Html\Meta - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The meta data has the expected default values after initialization')] public function testDefault() : void { self::assertEquals('', $this->meta->description); @@ -50,88 +47,64 @@ final class MetaTest extends \PHPUnit\Framework\TestCase self::assertEquals('', $this->meta->render()); } - /** - * @testdox A keyword can be added and returned - * @covers phpOMS\Model\Html\Meta - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A keyword can be added and returned')] public function testKeywordInputOutput() : void { $this->meta->addKeyword('orange'); self::assertEquals(['orange'], $this->meta->getKeywords()); } - /** - * @testdox The author can be set and returned - * @covers phpOMS\Model\Html\Meta - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The author can be set and returned')] public function testAuthorInputOutput() : void { $this->meta->author = 'oms'; self::assertEquals('oms', $this->meta->author); } - /** - * @testdox The charset can be set and returned - * @covers phpOMS\Model\Html\Meta - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The charset can be set and returned')] public function testCharsetInputOutput() : void { $this->meta->setCharset('utf-8'); self::assertEquals('utf-8', $this->meta->getCharset()); } - /** - * @testdox The description can be set and returned - * @covers phpOMS\Model\Html\Meta - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The description can be set and returned')] public function testDescriptionInputOutput() : void { $this->meta->description = 'some description'; self::assertEquals('some description', $this->meta->description); } - /** - * @testdox A property can be set and returned - * @covers phpOMS\Model\Html\Meta - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A property can be set and returned')] public function testPropertyInputOutput() : void { $this->meta->setProperty('property', 'test property'); self::assertEquals('test property', $this->meta->getProperty('property')); } - /** - * @testdox A itemprop can be set and returned - * @covers phpOMS\Model\Html\Meta - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A itemprop can be set and returned')] public function testItempropInputOutput() : void { $this->meta->setItemprop('itemprop', 'test itemprop'); self::assertEquals('test itemprop', $this->meta->getItemprop('itemprop')); } - /** - * @testdox A name can be set and returned - * @covers phpOMS\Model\Html\Meta - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A name can be set and returned')] public function testNameInputOutput() : void { $this->meta->setName('title', 'test title'); self::assertEquals('test title', $this->meta->getName('title')); } - /** - * @testdox The meta data can be rendered - * @covers phpOMS\Model\Html\Meta - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The meta data can be rendered')] public function testRender() : void { $this->meta->addKeyword('orange'); diff --git a/tests/Model/Message/DomActionTest.php b/tests/Model/Message/DomActionTest.php index abfe98795..ffc676d7a 100755 --- a/tests/Model/Message/DomActionTest.php +++ b/tests/Model/Message/DomActionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Model\Message\DomAction; */ final class DomActionTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(9, DomAction::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(DomAction::getConstants(), \array_unique(DomAction::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(0, DomAction::CREATE_BEFORE); diff --git a/tests/Model/Message/DomTest.php b/tests/Model/Message/DomTest.php index 803b939fa..f124ef258 100755 --- a/tests/Model/Message/DomTest.php +++ b/tests/Model/Message/DomTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright 2013 Dennis Eichhorn @@ -20,12 +20,10 @@ use phpOMS\Model\Message\DomAction; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Model\Message\Dom::class)] final class DomTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Model\Message\Dom - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDefault() : void { $obj = new Dom(); @@ -37,10 +35,7 @@ final class DomTest extends \PHPUnit\Framework\TestCase self::assertEquals(DomAction::MODIFY, $obj->toArray()['action']); } - /** - * @covers phpOMS\Model\Message\Dom - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSetGet() : void { $obj = new Dom(); diff --git a/tests/Model/Message/FormValidationTest.php b/tests/Model/Message/FormValidationTest.php index 9ecd9f356..4b5a644f0 100755 --- a/tests/Model/Message/FormValidationTest.php +++ b/tests/Model/Message/FormValidationTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright 2013 Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Model\Message\FormValidation; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Model\Message\FormValidation::class)] final class FormValidationTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Model\Message\FormValidation - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDefault() : void { $obj = new FormValidation([]); @@ -33,10 +31,7 @@ final class FormValidationTest extends \PHPUnit\Framework\TestCase self::assertEmpty($obj->toArray()['validation']); } - /** - * @covers phpOMS\Model\Message\FormValidation - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSetGet() : void { $arr = ['a' => true, 'b' => false]; diff --git a/tests/Model/Message/NotifyTest.php b/tests/Model/Message/NotifyTest.php index 40a17e6ab..69a90c5fc 100755 --- a/tests/Model/Message/NotifyTest.php +++ b/tests/Model/Message/NotifyTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright 2013 Dennis Eichhorn @@ -20,12 +20,10 @@ use phpOMS\Model\Message\Notify; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Model\Message\Notify::class)] final class NotifyTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Model\Message\Notify - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDefault() : void { $obj = new Notify(); @@ -38,10 +36,7 @@ final class NotifyTest extends \PHPUnit\Framework\TestCase self::assertEquals(NotificationLevel::INFO, $obj->toArray()['level']); } - /** - * @covers phpOMS\Model\Message\Notify - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSetGet() : void { $obj = new Notify('message', NotificationLevel::WARNING); diff --git a/tests/Model/Message/RedirectTest.php b/tests/Model/Message/RedirectTest.php index 44b4b28cf..7e9d0302b 100755 --- a/tests/Model/Message/RedirectTest.php +++ b/tests/Model/Message/RedirectTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright 2013 Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Model\Message\Redirect; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Model\Message\Redirect::class)] final class RedirectTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Model\Message\Redirect - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDefault() : void { $obj = new Redirect(''); @@ -35,10 +33,7 @@ final class RedirectTest extends \PHPUnit\Framework\TestCase self::assertFalse($obj->toArray()['new']); } - /** - * @covers phpOMS\Model\Message\Redirect - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSetGet() : void { $obj = new Redirect('url', true); diff --git a/tests/Model/Message/ReloadTest.php b/tests/Model/Message/ReloadTest.php index 4b167b962..9f06bb150 100755 --- a/tests/Model/Message/ReloadTest.php +++ b/tests/Model/Message/ReloadTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright 2013 Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Model\Message\Reload; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Model\Message\Reload::class)] final class ReloadTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Model\Message\Reload - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDefault() : void { $obj = new Reload(); @@ -33,10 +31,7 @@ final class ReloadTest extends \PHPUnit\Framework\TestCase self::assertEquals(0, $obj->toArray()['time']); } - /** - * @covers phpOMS\Model\Message\Reload - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSetGet() : void { $obj = new Reload(5); diff --git a/tests/Module/Exception/InvalidModuleExceptionTest.php b/tests/Module/Exception/InvalidModuleExceptionTest.php index 63ae9e259..445072cc4 100755 --- a/tests/Module/Exception/InvalidModuleExceptionTest.php +++ b/tests/Module/Exception/InvalidModuleExceptionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Module\Exception\InvalidModuleException; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Module\Exception\InvalidModuleException::class)] final class InvalidModuleExceptionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Module\Exception\InvalidModuleException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testException() : void { self::assertInstanceOf(\UnexpectedValueException::class, new InvalidModuleException('')); diff --git a/tests/Module/Exception/InvalidThemeExceptionTest.php b/tests/Module/Exception/InvalidThemeExceptionTest.php index 5f65064ad..e2276272f 100755 --- a/tests/Module/Exception/InvalidThemeExceptionTest.php +++ b/tests/Module/Exception/InvalidThemeExceptionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Module\Exception\InvalidThemeException; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Module\Exception\InvalidThemeException::class)] final class InvalidThemeExceptionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Module\Exception\InvalidThemeException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testException() : void { self::assertInstanceOf(\UnexpectedValueException::class, new InvalidThemeException('')); diff --git a/tests/Module/InstallerAbstractTest.php b/tests/Module/InstallerAbstractTest.php index d3e1c4e02..aa314db94 100755 --- a/tests/Module/InstallerAbstractTest.php +++ b/tests/Module/InstallerAbstractTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -23,10 +23,10 @@ use phpOMS\Module\InstallerAbstract; use phpOMS\Module\ModuleInfo; /** - * @testdox phpOMS\tests\Module\InstallerAbstractTest: Abstract module installer - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Module\InstallerAbstract::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Module\InstallerAbstractTest: Abstract module installer')] final class InstallerAbstractTest extends \PHPUnit\Framework\TestCase { protected InstallerAbstract $installer; @@ -41,11 +41,8 @@ final class InstallerAbstractTest extends \PHPUnit\Framework\TestCase }; } - /** - * @testdox Invalid or missing module status file throws exception during installation - * @covers phpOMS\Module\InstallerAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid or missing module status file throws exception during installation')] public function testInvalidModuleInstall() : void { $this->expectException(\UnexpectedValueException::class); diff --git a/tests/Module/ModuleAbstractTest.php b/tests/Module/ModuleAbstractTest.php index 063e11a4d..a23848002 100755 --- a/tests/Module/ModuleAbstractTest.php +++ b/tests/Module/ModuleAbstractTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -28,10 +28,10 @@ use phpOMS\tests\DataStorage\Database\TestModel\ManyToManyRelModel; use phpOMS\tests\DataStorage\Database\TestModel\ManyToManyRelModelMapper; /** - * @testdox phpOMS\tests\Module\ModuleAbstractTest: Abstract module - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Module\ModuleAbstract::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Module\ModuleAbstractTest: Abstract module')] final class ModuleAbstractTest extends \PHPUnit\Framework\TestCase { protected $module = null; @@ -166,83 +166,59 @@ final class ModuleAbstractTest extends \PHPUnit\Framework\TestCase }; } - /** - * @testdox The constant values of the abstract module are overwritten by the extension - * @covers phpOMS\Module\ModuleAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The constant values of the abstract module are overwritten by the extension')] public function testConstants() : void { self::assertEquals(2, $this->module::ID); self::assertEquals('1.2.3', $this->module::VERSION); } - /** - * @testdox The name of the module can be returned - * @covers phpOMS\Module\ModuleAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The name of the module can be returned')] public function testName() : void { self::assertEquals('Test', $this->module->getName()); } - /** - * @testdox The dependencies of the module can be returned - * @covers phpOMS\Module\ModuleAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The dependencies of the module can be returned')] public function testDependencies() : void { self::assertEquals([1, 2], $this->module->getDependencies()); } - /** - * @testdox The providings of the module can be returned - * @covers phpOMS\Module\ModuleAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The providings of the module can be returned')] public function testProviding() : void { self::assertEquals([], $this->module->getProviding()); } - /** - * @testdox A module can receive information and functionality from another module - * @covers phpOMS\Module\ModuleAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A module can receive information and functionality from another module')] public function testReceiving() : void { $this->module->addReceiving('Test2'); self::assertTrue(\in_array('Test2', $this->module->getReceiving())); } - /** - * @testdox A module can load its own localization/language dataset - * @covers phpOMS\Module\ModuleAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A module can load its own localization/language dataset')] public function testLocalization() : void { self::assertEquals(['Test' => ['Key' => 'Value']], $this->module::getLocalization('en', 'Mytheme')); } - /** - * @testdox A invalid language or theme returns in an empty localization/language dataset - * @covers phpOMS\Module\ModuleAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid language or theme returns in an empty localization/language dataset')] public function testInvalidLocalization() : void { self::assertEquals([], $this->module::getLocalization('invalid', 'invalid')); } - /** - * @testdox The module can automatically generate a json response based on provided data for the frontend - * @covers phpOMS\Module\ModuleAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The module can automatically generate a json response based on provided data for the frontend')] public function testFillJson() : void { $request = new HttpRequest(); @@ -261,11 +237,8 @@ final class ModuleAbstractTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The module can automatically generate a json response based on provided data - * @covers phpOMS\Module\ModuleAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The module can automatically generate a json response based on provided data')] public function testFillJsonRaw() : void { $request = new HttpRequest(); @@ -427,41 +400,32 @@ final class ModuleAbstractTest extends \PHPUnit\Framework\TestCase \phpOMS\Log\FileLogger::getInstance()->verbose = false; } - /** - * @testdox A model can be created - * @covers phpOMS\Module\ModuleAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A model can be created')] public function testModelCreate() : void { $this->dbSetup(); $this->module->create(); - self::assertCount(1, BaseModelMapper::getAll()->execute()); + self::assertCount(1, BaseModelMapper::getAll()->executeGetArray()); $this->dbTeardown(); } - /** - * @testdox Multiple models can be generated - * @covers phpOMS\Module\ModuleAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Multiple models can be generated')] public function testModelsCreate() : void { $this->dbSetup(); $this->module->createMultiple(); - self::assertCount(2, BaseModelMapper::getAll()->execute()); + self::assertCount(2, BaseModelMapper::getAll()->executeGetArray()); $this->dbTeardown(); } - /** - * @testdox A model can be updated - * @covers phpOMS\Module\ModuleAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A model can be updated')] public function testModelUpdate() : void { $this->dbSetup(); @@ -474,11 +438,8 @@ final class ModuleAbstractTest extends \PHPUnit\Framework\TestCase $this->dbTeardown(); } - /** - * @testdox A model can be deleted - * @covers phpOMS\Module\ModuleAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A model can be deleted')] public function testModelDelete() : void { $this->dbSetup(); @@ -486,16 +447,13 @@ final class ModuleAbstractTest extends \PHPUnit\Framework\TestCase $this->module->create(); self::assertCount(1, BaseModelMapper::getAll()->execute()); $this->module->delete(); - self::assertCount(0, BaseModelMapper::getAll()->execute()); + self::assertCount(0, BaseModelMapper::getAll()->executeGetArray()); $this->dbTeardown(); } - /** - * @testdox A model relation can be created - * @covers phpOMS\Module\ModuleAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A model relation can be created')] public function testModelRelation() : void { $this->dbSetup(); @@ -517,11 +475,8 @@ final class ModuleAbstractTest extends \PHPUnit\Framework\TestCase $this->dbTeardown(); } - /** - * @testdox The model CRUD functions can be called with a closure - * @covers phpOMS\Module\ModuleAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The model CRUD functions can be called with a closure')] public function testModelFunctionsWithClosure() : void { $output = $this->module->createWithCallable(); diff --git a/tests/Module/ModuleInfoTest.php b/tests/Module/ModuleInfoTest.php index 0b749a749..2f7d332f6 100755 --- a/tests/Module/ModuleInfoTest.php +++ b/tests/Module/ModuleInfoTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Module\ModuleInfo; /** - * @testdox phpOMS\tests\Module\ModuleInfoTest: Module info file manager - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Module\ModuleInfo::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Module\ModuleInfoTest: Module info file manager')] final class ModuleInfoTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A info file can be correctly loaded - * @covers phpOMS\Module\ModuleInfo - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A info file can be correctly loaded')] public function testLoad() : void { $info = new ModuleInfo(__DIR__ . '/info-test.json'); @@ -50,11 +47,8 @@ final class ModuleInfoTest extends \PHPUnit\Framework\TestCase self::assertEquals(__DIR__ . '/info-test.json', $info->getPath()); } - /** - * @testdox A info file can be modified - * @covers phpOMS\Module\ModuleInfo - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A info file can be modified')] public function testChange() : void { $jarray = \json_decode(\file_get_contents(__DIR__ . '/info-test.json'), true); @@ -74,11 +68,8 @@ final class ModuleInfoTest extends \PHPUnit\Framework\TestCase $info->update(); } - /** - * @testdox A invalid info file path load throws a PathException - * @covers phpOMS\Module\ModuleInfo - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid info file path load throws a PathException')] public function testInvalidPathLoad() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -87,11 +78,8 @@ final class ModuleInfoTest extends \PHPUnit\Framework\TestCase $info->load(); } - /** - * @testdox A invalid info file path update throws a PathException - * @covers phpOMS\Module\ModuleInfo - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid info file path update throws a PathException')] public function testInvalidPathUpdate() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -100,11 +88,8 @@ final class ModuleInfoTest extends \PHPUnit\Framework\TestCase $info->update(); } - /** - * @testdox A invalid change data throws a InvalidArgumentException - * @covers phpOMS\Module\ModuleInfo - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid change data throws a InvalidArgumentException')] public function testInvalidDataSet() : void { $this->expectException(\InvalidArgumentException::class); diff --git a/tests/Module/ModuleManagerTest.php b/tests/Module/ModuleManagerTest.php index 79776bf28..378c9ba7a 100755 --- a/tests/Module/ModuleManagerTest.php +++ b/tests/Module/ModuleManagerTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -30,10 +30,13 @@ use phpOMS\Utils\TestUtils; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Module\ModuleManagerTest: Manager for the module system - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Module\ModuleManager::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Module\InstallerAbstract::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Module\StatusAbstract::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Module\UninstallerAbstract::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Module\ModuleManagerTest: Manager for the module system')] final class ModuleManagerTest extends \PHPUnit\Framework\TestCase { protected ApplicationAbstract $app; @@ -57,32 +60,23 @@ final class ModuleManagerTest extends \PHPUnit\Framework\TestCase $this->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../Modules/'); } - /** - * @testdox Unknown modules return a null module - * @covers phpOMS\Module\ModuleManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Unknown modules return a null module')] public function testUnknownModuleGet() : void { self::assertInstanceOf('\phpOMS\Module\NullModule', $this->moduleManager->get('doesNotExist2')); } - /** - * @testdox Unknown modules cannot get activated, deactivated - * @covers phpOMS\Module\ModuleManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Unknown modules cannot get activated, deactivated')] public function testUnknwonModuleStatusChange() : void { self::assertFalse($this->moduleManager->activate('randomErrorTest1')); self::assertFalse($this->moduleManager->deactivate('randomErrorTest1')); } - /** - * @testdox Active modules can be returned - * @covers phpOMS\Module\ModuleManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Active modules can be returned')] public function testAllActiveModules() : void { $active = $this->moduleManager->getActiveModules(); @@ -90,11 +84,8 @@ final class ModuleManagerTest extends \PHPUnit\Framework\TestCase self::assertNotEmpty($active); } - /** - * @testdox Modules can be checked to be active - * @covers phpOMS\Module\ModuleManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Modules can be checked to be active')] public function testActiveModule() : void { $active = $this->moduleManager->getActiveModules(); @@ -106,11 +97,8 @@ final class ModuleManagerTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->moduleManager->isActive('Invalid')); } - /** - * @testdox Modules can be checked to be running - * @covers phpOMS\Module\ModuleManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Modules can be checked to be running')] public function testRunningModule() : void { $module = $this->moduleManager->get('TestModule'); @@ -118,11 +106,8 @@ final class ModuleManagerTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->moduleManager->isRunning('Invalid')); } - /** - * @testdox All available modules can be returned - * @covers phpOMS\Module\ModuleManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All available modules can be returned')] public function testAllModules() : void { $all = $this->moduleManager->getAllModules(); @@ -130,13 +115,8 @@ final class ModuleManagerTest extends \PHPUnit\Framework\TestCase self::assertNotEmpty($all); } - /** - * @testdox A module can be installed and its status can be changed - * @covers phpOMS\Module\InstallerAbstract - * @covers phpOMS\Module\ModuleManager - * @covers phpOMS\Module\StatusAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A module can be installed and its status can be changed')] public function testStatus() : void { $this->moduleManager->install('TestModule'); @@ -182,35 +162,24 @@ final class ModuleManagerTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->moduleManager->isActive('TestModule')); } - /** - * @testdox A none-existing module cannot be re-initialized - * @covers phpOMS\Module\ModuleManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing module cannot be re-initialized')] public function testInvalidModuleReInit() : void { $this->moduleManager->reInit('Invalid'); self::assertFalse($this->moduleManager->isActive('Invalid')); } - /** - * @testdox A module can be re-initialized - * @covers phpOMS\Module\InstallerAbstract - * @covers phpOMS\Module\ModuleManager - * @covers phpOMS\Module\StatusAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A module can be re-initialized')] public function testReInit() : void { $this->moduleManager->reInit('TestModule'); self::assertTrue($this->moduleManager->isActive('TestModule')); } - /** - * @testdox A module is automatically loaded for its URIs - * @covers phpOMS\Module\ModuleManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A module is automatically loaded for its URIs')] public function testRequestLoad() : void { $request = new HttpRequest(new HttpUri('http://127.0.0.1/en/backend/testmodule')); @@ -235,11 +204,8 @@ final class ModuleManagerTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->moduleManager->isRunning('TestModule')); } - /** - * @testdox Getting language files for an invalid module returns an empty array - * @covers phpOMS\Module\ModuleManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Getting language files for an invalid module returns an empty array')] public function testGetLanguageForInvalidRequest() : void { $request = new HttpRequest(new HttpUri('http://127.0.0.1/en/error/invalid')); @@ -250,11 +216,8 @@ final class ModuleManagerTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $this->moduleManager->getLanguageFiles($request)); } - /** - * @testdox Installed modules can be returned - * @covers phpOMS\Module\ModuleManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Installed modules can be returned')] public function testInstalledModules() : void { $installed = $this->moduleManager->getInstalledModules(); @@ -262,43 +225,30 @@ final class ModuleManagerTest extends \PHPUnit\Framework\TestCase self::assertNotEmpty($installed); } - /** - * @testdox A module can be checked if it is installed - * @covers phpOMS\Module\ModuleManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A module can be checked if it is installed')] public function testIsInstalled() : void { self::assertTrue($this->moduleManager->isInstalled('TestModule')); } - /** - * @testdox Installing an already installed module doesn't perform anything - * @covers phpOMS\Module\ModuleManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Installing an already installed module doesn't perform anything")] public function testInstallingAlreadyInstalledModule() : void { self::assertTrue($this->moduleManager->install('TestModule')); } - /** - * @testdox The valid module can be returned - * @covers phpOMS\Module\ModuleManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The valid module can be returned')] public function testAdminModule() : void { self::assertInstanceOf('\phpOMS\Module\ModuleAbstract', $this->moduleManager->get('Admin')); self::assertInstanceOf('\Modules\Admin\Controller\ApiController', $this->moduleManager->get('Admin')); } - /** - * @testdox A module can be uninstalled - * @covers phpOMS\Module\ModuleManager - * @covers phpOMS\Module\UninstallerAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A module can be uninstalled')] public function testUninstall() : void { $this->moduleManager->uninstall('TestModule'); @@ -312,11 +262,8 @@ final class ModuleManagerTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->moduleManager->isRunning('TestModule')); } - /** - * @testdox A empty or invalid module path returns an empty array on module getter functions. - * @covers phpOMS\Module\ModuleManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A empty or invalid module path returns an empty array on module getter functions.')] public function testInvalidModulePath() : void { $moduleManager = new ModuleManager($this->app, __DIR__ . '/Testmodule/'); @@ -326,21 +273,15 @@ final class ModuleManagerTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $moduleManager->getActiveModules(false)); } - /** - * @testdox A invalid module name cannot be installed - * @covers phpOMS\Module\ModuleManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid module name cannot be installed')] public function testInvalidModuleInstall() : void { self::assertFalse($this->moduleManager->install('Invalid')); } - /** - * @testdox A invalid module name cannot be uninstalled - * @covers phpOMS\Module\ModuleManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid module name cannot be uninstalled')] public function testInvalidModuleUninstall() : void { self::assertFalse($this->moduleManager->uninstall('Invalid')); diff --git a/tests/Module/NullModuleTest.php b/tests/Module/NullModuleTest.php index 5c6257f07..cea05c950 100755 --- a/tests/Module/NullModuleTest.php +++ b/tests/Module/NullModuleTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -22,10 +22,10 @@ use phpOMS\Module\NullModule; use phpOMS\Utils\TestUtils; /** - * @testdox phpOMS\tests\Module\NullModuleTest: Basic module functionality - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Module\NullModule::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Module\NullModuleTest: Basic module functionality')] final class NullModuleTest extends \PHPUnit\Framework\TestCase { protected NullModule $module; @@ -42,21 +42,15 @@ final class NullModuleTest extends \PHPUnit\Framework\TestCase $this->module = new NullModule($app); } - /** - * @testdox The null module is an instance of the module abstract - * @covers phpOMS\Module\NullModule - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The null module is an instance of the module abstract')] public function testModule() : void { self::assertInstanceOf('\phpOMS\Module\ModuleAbstract', $this->module); } - /** - * @testdox A invalid module method call will create an error log - * @covers phpOMS\Module\NullModule - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid module method call will create an error log')] public function testInvalidModuleMethodCalls() : void { $this->module->invalidMethodCall(); diff --git a/tests/Module/PackageManagerTest.php b/tests/Module/PackageManagerTest.php index 7fc40beac..e8006bdda 100755 --- a/tests/Module/PackageManagerTest.php +++ b/tests/Module/PackageManagerTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,10 +21,10 @@ use phpOMS\System\File\Local\Directory; use phpOMS\Utils\IO\Zip\Zip; /** - * @testdox phpOMS\tests\Module\PackageManagerTest: Manager for install/update packages - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Module\PackageManager::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Module\PackageManagerTest: Manager for install/update packages')] final class PackageManagerTest extends \PHPUnit\Framework\TestCase { public static function setUpBeforeClass() : void @@ -79,11 +79,8 @@ final class PackageManagerTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A package can be installed - * @covers phpOMS\Module\PackageManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A package can be installed')] public function testPackageValidInstall() : void { if (\is_dir(__DIR__ . '/dummyModule')) { @@ -143,11 +140,8 @@ final class PackageManagerTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox A package which didn't get extracted cannot be loaded and throws a PathException - * @covers phpOMS\Module\PackageManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A package which didn't get extracted cannot be loaded and throws a PathException")] public function testNotExtractedLoad() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -161,11 +155,8 @@ final class PackageManagerTest extends \PHPUnit\Framework\TestCase $package->load(); } - /** - * @testdox A invalid package cannot be installed and throws a Exception - * @covers phpOMS\Module\PackageManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid package cannot be installed and throws a Exception')] public function testInvalidInstall() : void { $this->expectException(\Exception::class); @@ -179,11 +170,8 @@ final class PackageManagerTest extends \PHPUnit\Framework\TestCase $package->install(); } - /** - * @testdox A invalid package key doesn't validate the package - * @covers phpOMS\Module\PackageManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A invalid package key doesn't validate the package")] public function testPackageInvalidKey() : void { $package = new PackageManager( @@ -197,11 +185,8 @@ final class PackageManagerTest extends \PHPUnit\Framework\TestCase self::assertFalse($package->isValid()); } - /** - * @testdox A invalid package content doesn't validate the package - * @covers phpOMS\Module\PackageManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A invalid package content doesn't validate the package")] public function testPackageInvalidContent() : void { $package = new PackageManager( @@ -216,11 +201,8 @@ final class PackageManagerTest extends \PHPUnit\Framework\TestCase self::assertFalse($package->isValid()); } - /** - * @testdox The temporarily extracted package can be cleaned up - * @covers phpOMS\Module\PackageManager - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The temporarily extracted package can be cleaned up')] public function testCleanup() : void { $package = new PackageManager( diff --git a/tests/Module/StatusAbstractTest.php b/tests/Module/StatusAbstractTest.php index 5e252c86b..e19ce1c4d 100755 --- a/tests/Module/StatusAbstractTest.php +++ b/tests/Module/StatusAbstractTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,10 @@ use phpOMS\Module\ModuleInfo; use phpOMS\Module\StatusAbstract; /** - * @testdox phpOMS\tests\Module\StatusAbstractTest: Abstract module status - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Module\StatusAbstract::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Module\StatusAbstractTest: Abstract module status')] final class StatusAbstractTest extends \PHPUnit\Framework\TestCase { protected StatusAbstract $status; @@ -41,9 +41,8 @@ final class StatusAbstractTest extends \PHPUnit\Framework\TestCase /** * A invalid module path cannot be activated - * @covers phpOMS\Module\StatusAbstract - * @group framework */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidModulePathActivation() : void { $moduleInfo = new ModuleInfo(__DIR__ . '/info.json'); diff --git a/tests/Module/Test/Theme/Mytheme/Lang/en.lang.php b/tests/Module/Test/Theme/Mytheme/Lang/en.lang.php index 48064671a..437d00a68 100755 --- a/tests/Module/Test/Theme/Mytheme/Lang/en.lang.php +++ b/tests/Module/Test/Theme/Mytheme/Lang/en.lang.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package Modules\Localization * @copyright Dennis Eichhorn diff --git a/tests/Module/Testmodule/Admin/Installer.php b/tests/Module/Testmodule/Admin/Installer.php index 2f7d7c04b..e49f2f076 100755 --- a/tests/Module/Testmodule/Admin/Installer.php +++ b/tests/Module/Testmodule/Admin/Installer.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Module/UninstallerAbstractTest.php b/tests/Module/UninstallerAbstractTest.php index c4d916f53..6221bd52d 100755 --- a/tests/Module/UninstallerAbstractTest.php +++ b/tests/Module/UninstallerAbstractTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,10 +21,10 @@ use phpOMS\Module\ModuleInfo; use phpOMS\Module\UninstallerAbstract; /** - * @testdox phpOMS\tests\Module\UninstallerAbstractTest: Abstract module uninstaller - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Module\UninstallerAbstract::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Module\UninstallerAbstractTest: Abstract module uninstaller')] final class UninstallerAbstractTest extends \PHPUnit\Framework\TestCase { protected UninstallerAbstract $uninstaller; @@ -40,11 +40,8 @@ final class UninstallerAbstractTest extends \PHPUnit\Framework\TestCase }; } - /** - * @testdox A missing database schema will not perform any database operations - * @covers phpOMS\Module\UninstallerAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing database schema will not perform any database operations')] public function testMissingDbFileUninstall() : void { $this->uninstaller::dropTables( diff --git a/tests/Module/dummyModule/README.md b/tests/Module/dummyModule/README.md deleted file mode 100644 index 1becba2bb..000000000 --- a/tests/Module/dummyModule/README.md +++ /dev/null @@ -1 +0,0 @@ -404: Not Found \ No newline at end of file diff --git a/tests/Module/dummyModule/Replace.md b/tests/Module/dummyModule/Replace.md deleted file mode 100644 index 85d44f7ea..000000000 --- a/tests/Module/dummyModule/Replace.md +++ /dev/null @@ -1 +0,0 @@ -To copy! \ No newline at end of file diff --git a/tests/Module/dummyModule/copyHere/a.md b/tests/Module/dummyModule/copyHere/a.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/Module/dummyModule/copyHere/sub/b.txt b/tests/Module/dummyModule/copyHere/sub/b.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/Module/dummyModule/externalCopy.md b/tests/Module/dummyModule/externalCopy.md deleted file mode 100644 index 85d44f7ea..000000000 --- a/tests/Module/dummyModule/externalCopy.md +++ /dev/null @@ -1 +0,0 @@ -To copy! \ No newline at end of file diff --git a/tests/Module/dummyModule/moveHere/a.md b/tests/Module/dummyModule/moveHere/a.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/Module/dummyModule/moveHere/sub/b.txt b/tests/Module/dummyModule/moveHere/sub/b.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/Module/dummyModule/toCopy/a.md b/tests/Module/dummyModule/toCopy/a.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/Module/dummyModule/toCopy/sub/b.txt b/tests/Module/dummyModule/toCopy/sub/b.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/Preload0.php b/tests/Preload0.php index 036a776d8..025d0695c 100755 --- a/tests/Preload0.php +++ b/tests/Preload0.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package Tests\PHPUnit * @copyright Dennis Eichhorn diff --git a/tests/PreloadTest/Preload1.php b/tests/PreloadTest/Preload1.php index d408305f2..f4c2c8715 100755 --- a/tests/PreloadTest/Preload1.php +++ b/tests/PreloadTest/Preload1.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package Tests\PHPUnit * @copyright Dennis Eichhorn diff --git a/tests/PreloadTest/Sub/Preload2.php b/tests/PreloadTest/Sub/Preload2.php index 71f6f3cbb..90f2e5a26 100755 --- a/tests/PreloadTest/Sub/Preload2.php +++ b/tests/PreloadTest/Sub/Preload2.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package Tests\PHPUnit * @copyright Dennis Eichhorn diff --git a/tests/PreloadTest/Sub/Preload3.php b/tests/PreloadTest/Sub/Preload3.php index 4b36a37ca..9bb86e06a 100755 --- a/tests/PreloadTest/Sub/Preload3.php +++ b/tests/PreloadTest/Sub/Preload3.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package Tests\PHPUnit * @copyright Dennis Eichhorn diff --git a/tests/PreloaderTest.php b/tests/PreloaderTest.php index f6cbd87f7..280c9d19f 100755 --- a/tests/PreloaderTest.php +++ b/tests/PreloaderTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,16 +17,13 @@ namespace phpOMS\tests; use phpOMS\Preloader; /** - * @testdox phpOMS\tests\PreloaderTest: Class preloader - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Preloader::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\PreloaderTest: Class preloader')] final class PreloaderTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Preloader - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPreloading() : void { $includes = \get_included_files(); diff --git a/tests/Router/RouteVerbTest.php b/tests/Router/RouteVerbTest.php index 9460de209..3762dab49 100755 --- a/tests/Router/RouteVerbTest.php +++ b/tests/Router/RouteVerbTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Router\RouteVerb; /** - * @testdox phpOMS\tests\WebRouter\RouteVerbTest: Route verb enum * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\WebRouter\RouteVerbTest: Route verb enum')] final class RouteVerbTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The route verb enum has the correct values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The route verb enum has the correct values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertTrue(\defined('phpOMS\Router\RouteVerb::GET')); @@ -38,11 +36,9 @@ final class RouteVerbTest extends \PHPUnit\Framework\TestCase self::assertTrue(\defined('phpOMS\Router\RouteVerb::ANY')); } - /** - * @testdox The route verb enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The route verb enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { $values = RouteVerb::getConstants(); diff --git a/tests/Router/SocketRouterTest.php b/tests/Router/SocketRouterTest.php index 11c14d1c4..5946668be 100755 --- a/tests/Router/SocketRouterTest.php +++ b/tests/Router/SocketRouterTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -24,10 +24,10 @@ use phpOMS\Router\SocketRouter; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Router\SocketRouterTest: Router for socket requests - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Router\SocketRouter::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Router\SocketRouterTest: Router for socket requests')] final class SocketRouterTest extends \PHPUnit\Framework\TestCase { protected SocketRouter $router; @@ -40,41 +40,29 @@ final class SocketRouterTest extends \PHPUnit\Framework\TestCase $this->router = new SocketRouter(); } - /** - * @testdox The route result for an empty request is empty - * @covers phpOMS\Router\SocketRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The route result for an empty request is empty')] public function testDefault() : void { self::assertEmpty($this->router->route('some_test route')); } - /** - * @testdox A none-existing routing file cannot be imported - * @covers phpOMS\Router\SocketRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing routing file cannot be imported')] public function testInvalidRoutingFile() : void { self::assertFalse($this->router->importFromFile(__DIR__ . '/invalidFile.php')); } - /** - * @testdox A existing routing file can be imported - * @covers phpOMS\Router\SocketRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A existing routing file can be imported')] public function testLoadingRoutesFromFile() : void { self::assertTrue($this->router->importFromFile(__DIR__ . '/socketRouterTestFile.php')); } - /** - * @testdox A matching route returns the destinations - * @covers phpOMS\Router\SocketRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A matching route returns the destinations')] public function testRouteMatching() : void { self::assertTrue($this->router->importFromFile(__DIR__ . '/socketRouterTestFile.php')); @@ -85,11 +73,8 @@ final class SocketRouterTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The routes can be removed from the router - * @covers phpOMS\Router\SocketRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The routes can be removed from the router')] public function testRouteClearing() : void { self::assertTrue($this->router->importFromFile(__DIR__ . '/socketRouterTestFile.php')); @@ -101,11 +86,8 @@ final class SocketRouterTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Routes can be added dynamically - * @covers phpOMS\Router\SocketRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Routes can be added dynamically')] public function testDynamicRouteAdding() : void { $this->router->add('^.*backends_admin -settings=general( \-.*$|$)', 'Controller:test'); @@ -115,11 +97,8 @@ final class SocketRouterTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Routes only match if the permissions match - * @covers phpOMS\Router\SocketRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Routes only match if the permissions match')] public function testWithValidPermissions() : void { self::assertTrue($this->router->importFromFile(__DIR__ . '/socketRouterTestFilePermission.php')); @@ -151,11 +130,8 @@ final class SocketRouterTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Routes don't match if the permissions don't match - * @covers phpOMS\Router\SocketRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Routes don't match if the permissions don't match")] public function testWithInvalidPermissions() : void { self::assertTrue($this->router->importFromFile(__DIR__ . '/socketRouterTestFilePermission.php')); @@ -211,11 +187,8 @@ final class SocketRouterTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A data validation pattern validates matches correctly - * @covers phpOMS\Router\SocketRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A data validation pattern validates matches correctly')] public function testDataValidation() : void { $this->router->add( @@ -230,11 +203,8 @@ final class SocketRouterTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A data validation pattern invalidates missmatches - * @covers phpOMS\Router\SocketRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A data validation pattern invalidates missmatches')] public function testInvalidDataValidation() : void { $this->router->add( @@ -249,11 +219,8 @@ final class SocketRouterTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A uri can be used for data population - * @covers phpOMS\Router\SocketRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A uri can be used for data population')] public function testDataFromPattern() : void { $this->router->add( diff --git a/tests/Router/WebRouterTest.php b/tests/Router/WebRouterTest.php index 66865d88e..569a47686 100755 --- a/tests/Router/WebRouterTest.php +++ b/tests/Router/WebRouterTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -28,10 +28,10 @@ use phpOMS\Uri\HttpUri; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Router\WebRouterTest: Router for web requests - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Router\WebRouter::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Router\WebRouterTest: Router for web requests')] final class WebRouterTest extends \PHPUnit\Framework\TestCase { protected WebRouter $router; @@ -44,11 +44,8 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase $this->router = new WebRouter(); } - /** - * @testdox The route result for an empty request is empty - * @covers phpOMS\Router\WebRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The route result for an empty request is empty')] public function testDefault() : void { self::assertEmpty( @@ -58,31 +55,22 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A none-existing routing file cannot be imported - * @covers phpOMS\Router\WebRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing routing file cannot be imported')] public function testInvalidRoutingFile() : void { self::assertFalse($this->router->importFromFile(__DIR__ . '/invalidFile.php')); } - /** - * @testdox A existing routing file can be imported - * @covers phpOMS\Router\WebRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A existing routing file can be imported')] public function testLoadingRoutesFromFile() : void { self::assertTrue($this->router->importFromFile(__DIR__ . '/webRouterTestFile.php')); } - /** - * @testdox A matching route returns the destinations - * @covers phpOMS\Router\WebRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A matching route returns the destinations')] public function testRouteMatching() : void { self::assertTrue($this->router->importFromFile(__DIR__ . '/webRouterTestFile.php')); @@ -97,11 +85,8 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The routes can be removed from the router - * @covers phpOMS\Router\WebRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The routes can be removed from the router')] public function testRouteClearing() : void { self::assertTrue($this->router->importFromFile(__DIR__ . '/webRouterTestFile.php')); @@ -117,11 +102,8 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Invalid routing verbs don't match even if the route matches - * @covers phpOMS\Router\WebRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Invalid routing verbs don't match even if the route matches")] public function testRouteMissMatchingForInvalidVerbs() : void { self::assertTrue($this->router->importFromFile(__DIR__ . '/webRouterTestFile.php')); @@ -135,11 +117,8 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Routes can be added dynamically - * @covers phpOMS\Router\WebRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Routes can be added dynamically')] public function testDynamicRouteAdding() : void { $this->router->add('^.*/backends/admin/settings/general(\?.*$|$)', 'Controller:test', RouteVerb::GET | RouteVerb::SET); @@ -167,11 +146,8 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Routes which require a CSRF token can only match with a CSRF token - * @covers phpOMS\Router\WebRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Routes which require a CSRF token can only match with a CSRF token')] public function testWithCSRF() : void { self::assertTrue($this->router->importFromFile(__DIR__ . '/webRouteTestCsrf.php')); @@ -180,18 +156,15 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase [['dest' => '\Modules\Admin\Controller:viewCsrf']], $this->router->route( (new HttpRequest( - new HttpUri('http://test.com/backend/admin/settings/csrf/something?test') + new HttpUri('http://test.com/backend/admin/settings/csrf?test') ))->uri->getRoute(), 'csrf_string' ) ); } - /** - * @testdox Routes which require a CSRF token don't match without a CSRF token - * @covers phpOMS\Router\WebRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Routes which require a CSRF token don't match without a CSRF token")] public function testWithoutCSRF() : void { self::assertTrue($this->router->importFromFile(__DIR__ . '/webRouteTestCsrf.php')); @@ -200,17 +173,14 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase ['dest' => RouteStatus::INVALID_CSRF], $this->router->route( (new HttpRequest( - new HttpUri('http://test.com/backend/admin/settings/csrf/something?test') + new HttpUri('http://test.com/backend/admin/settings/csrf?test') ))->uri->getRoute() ) ); } - /** - * @testdox Routes only match if the permissions match - * @covers phpOMS\Router\WebRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Routes only match if the permissions match')] public function testWithValidPermissions() : void { if (!Autoloader::exists('\Modules\Admin\Controller\Controller')) { @@ -246,11 +216,8 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Routes don't match if the permissions don't match - * @covers phpOMS\Router\WebRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Routes don't match if the permissions don't match")] public function testWithInvalidPermissions() : void { if (!Autoloader::exists('\Modules\Admin\Controller\Controller')) { @@ -310,11 +277,8 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A data validation pattern validates matches correctly - * @covers phpOMS\Router\WebRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A data validation pattern validates matches correctly')] public function testDataValidation() : void { $this->router->add( @@ -334,11 +298,8 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A data validation pattern invalidates miss-matches - * @covers phpOMS\Router\WebRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A data validation pattern invalidates miss-matches')] public function testInvalidDataValidation() : void { $this->router->add( @@ -358,11 +319,8 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A uri can be used for data population - * @covers phpOMS\Router\WebRouter - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A uri can be used for data population')] public function testDataFromPattern() : void { $this->router->add( diff --git a/tests/Security/EncryptionHelperTest.php b/tests/Security/EncryptionHelperTest.php index 017dbb862..abc61a84e 100644 --- a/tests/Security/EncryptionHelperTest.php +++ b/tests/Security/EncryptionHelperTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,9 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Security\EncryptionHelper; /** - * @testdox phpOMS\tests\Security\EncryptionHelperTest: Basic php source code security inspection - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Security\EncryptionHelperTest: Basic php source code security inspection')] final class EncryptionHelperTest extends \PHPUnit\Framework\TestCase { public function testSharedKey() : void diff --git a/tests/Security/GuardTest.php b/tests/Security/GuardTest.php index 8bac47439..e92db3364 100644 --- a/tests/Security/GuardTest.php +++ b/tests/Security/GuardTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,10 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Security\Guard; /** - * @testdox phpOMS\tests\Security\GuardTest: Basic php source code security inspection - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Security\Guard::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Security\GuardTest: Basic php source code security inspection')] final class GuardTest extends \PHPUnit\Framework\TestCase { public function testSafePath() : void @@ -57,11 +57,8 @@ final class GuardTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A string can be validated for shell safety - * @covers phpOMS\Security\Guard - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A string can be validated for shell safety')] public function testIsShellSafe() : void { self::assertTrue(Guard::isShellSafe('asdf')); diff --git a/tests/Security/PhpCodeTest.php b/tests/Security/PhpCodeTest.php index cfabd52ca..2d5d394c5 100755 --- a/tests/Security/PhpCodeTest.php +++ b/tests/Security/PhpCodeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Security\PhpCode; /** - * @testdox phpOMS\tests\Security\PhpCodeTest: Basic php source code security inspection - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Security\PhpCode::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Security\PhpCodeTest: Basic php source code security inspection')] final class PhpCodeTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A file with unicode characters gets correctly identified - * @covers phpOMS\Security\PhpCode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file with unicode characters gets correctly identified')] public function testHasUnicode() : void { self::assertTrue( @@ -41,11 +38,8 @@ final class PhpCodeTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A file with no unicode characters gets correctly identified - * @covers phpOMS\Security\PhpCode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file with no unicode characters gets correctly identified')] public function testHasNoUnicode() : void { self::assertFalse( @@ -57,22 +51,16 @@ final class PhpCodeTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A file with no disabled functions gets correctly identified - * @covers phpOMS\Security\PhpCode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file with no disabled functions gets correctly identified')] public function testDisabledFunctions() : void { self::assertFalse(PhpCode::isDisabled(['file_get_contents'])); self::assertFalse(PhpCode::isDisabled(['eval', 'file_get_contents'])); } - /** - * @testdox A file with deprecated functions gets correctly identified - * @covers phpOMS\Security\PhpCode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file with deprecated functions gets correctly identified')] public function testHasDeprecatedFunction() : void { self::assertTrue( @@ -84,11 +72,8 @@ final class PhpCodeTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A file with no deprecated functions gets correctly identified - * @covers phpOMS\Security\PhpCode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file with no deprecated functions gets correctly identified')] public function testHasNoDeprecatedFunction() : void { self::assertFalse( @@ -100,41 +85,29 @@ final class PhpCodeTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A file hash comparison is successful if the file generates the same hash - * @covers phpOMS\Security\PhpCode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file hash comparison is successful if the file generates the same hash')] public function testFileIntegrity() : void { self::assertTrue(PhpCode::validateFileIntegrity(__DIR__ . '/Sample/hasDeprecated.php', \md5_file(__DIR__ . '/Sample/hasDeprecated.php'))); } - /** - * @testdox A file hash comparison is unsuccessful if the file generates a different hash - * @covers phpOMS\Security\PhpCode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file hash comparison is unsuccessful if the file generates a different hash')] public function testFileInvalidIntegrity() : void { self::assertFalse(PhpCode::validateFileIntegrity(__DIR__ . '/Sample/hasUnicode.php', \md5_file(__DIR__ . '/Sample/hasDeprecated.php'))); } - /** - * @testdox Two equal strings validate as the same - * @covers phpOMS\Security\PhpCode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Two equal strings validate as the same')] public function testStringIntegrity() : void { self::assertTrue(PhpCode::validateStringIntegrity('aa', 'aa')); } - /** - * @testdox Two different strings don't validate as the same - * @covers phpOMS\Security\PhpCode - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Two different strings don't validate as the same")] public function testStringInvalidIntegrity() : void { self::assertFalse(PhpCode::validateStringIntegrity('aa', 'aA')); diff --git a/tests/Socket/Client/ClientConnectionTest.php b/tests/Socket/Client/ClientConnectionTest.php index 79348fe81..e6ae08e05 100755 --- a/tests/Socket/Client/ClientConnectionTest.php +++ b/tests/Socket/Client/ClientConnectionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Socket/Client/ClientTest.php b/tests/Socket/Client/ClientTest.php index c850dee93..1994baba0 100755 --- a/tests/Socket/Client/ClientTest.php +++ b/tests/Socket/Client/ClientTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -30,6 +30,7 @@ use phpOMS\Socket\Client\Client; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Socket\Client\Client::class)] final class ClientTest extends \PHPUnit\Framework\TestCase { protected $app; @@ -79,10 +80,7 @@ final class ClientTest extends \PHPUnit\Framework\TestCase \unlink(__DIR__ . '/server.log'); } - /** - * @covers phpOMS\Socket\Client\Client - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSetupTCPSocket() : void { self::markTestIncomplete(); diff --git a/tests/Socket/Client/ClientTestHelper.php b/tests/Socket/Client/ClientTestHelper.php index 1728af467..40e163407 100755 --- a/tests/Socket/Client/ClientTestHelper.php +++ b/tests/Socket/Client/ClientTestHelper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package test * @copyright Dennis Eichhorn diff --git a/tests/Socket/Client/NullClientConnectionTest.php b/tests/Socket/Client/NullClientConnectionTest.php index f97921c3e..f0ee6e43b 100755 --- a/tests/Socket/Client/NullClientConnectionTest.php +++ b/tests/Socket/Client/NullClientConnectionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,12 +21,10 @@ use phpOMS\Socket\Client\NullClientConnection; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Socket\Client\NullClientConnection::class)] final class NullClientConnectionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Socket\Client\NullClientConnection - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDefault() : void { self::assertInstanceOf(ClientConnection::class, new NullClientConnection(new Account(), null)); diff --git a/tests/Socket/Server/ClientManagerTest.php b/tests/Socket/Server/ClientManagerTest.php index cab0c6f33..a157d2f89 100755 --- a/tests/Socket/Server/ClientManagerTest.php +++ b/tests/Socket/Server/ClientManagerTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Socket/Server/ServerTest.php b/tests/Socket/Server/ServerTest.php index a44349699..b85a52c4c 100755 --- a/tests/Socket/Server/ServerTest.php +++ b/tests/Socket/Server/ServerTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -30,6 +30,7 @@ use phpOMS\Socket\Server\Server; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Socket\Server\Server::class)] final class ServerTest extends \PHPUnit\Framework\TestCase { protected $app; @@ -79,10 +80,7 @@ final class ServerTest extends \PHPUnit\Framework\TestCase \unlink(__DIR__ . '/server.log'); } - /** - * @covers phpOMS\Socket\Server\Server - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSetupTCPSocket() : void { $pipes = []; diff --git a/tests/Socket/Server/ServerTestHelper.php b/tests/Socket/Server/ServerTestHelper.php index 0245e7148..713746080 100755 --- a/tests/Socket/Server/ServerTestHelper.php +++ b/tests/Socket/Server/ServerTestHelper.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package test * @copyright Dennis Eichhorn diff --git a/tests/Stdlib/Base/AddressTest.php b/tests/Stdlib/Base/AddressTest.php index ccae59dea..bd5dc5696 100755 --- a/tests/Stdlib/Base/AddressTest.php +++ b/tests/Stdlib/Base/AddressTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -15,13 +15,12 @@ declare(strict_types=1); namespace phpOMS\tests\Stdlib\Base; use phpOMS\Stdlib\Base\Address; -use phpOMS\Stdlib\Base\Location; /** - * @testdox phpOMS\tests\Stdlib\Base\AddressTest: Address type - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Stdlib\Base\Address::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Stdlib\Base\AddressTest: Address type')] final class AddressTest extends \PHPUnit\Framework\TestCase { protected Address $address; @@ -34,16 +33,13 @@ final class AddressTest extends \PHPUnit\Framework\TestCase $this->address = new Address(); } - /** - * @testdox The address has the expected default values after initialization - * @covers phpOMS\Stdlib\Base\Address - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The address has the expected default values after initialization')] public function testDefault() : void { $expected = [ - 'fao' => '', - 'name' => '', + 'fao' => '', + 'name' => '', 'postal' => '', 'city' => '', 'country' => 'XX', @@ -59,27 +55,21 @@ final class AddressTest extends \PHPUnit\Framework\TestCase self::assertEquals($expected, $this->address->jsonSerialize()); } - /** - * @testdox The fao can be set and returned - * @covers phpOMS\Stdlib\Base\Address - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The fao can be set and returned')] public function testFAOInputOutput() : void { $this->address->fao = 'fao'; self::assertEquals('fao', $this->address->fao); } - /** - * @testdox The address can be turned into array data - * @covers phpOMS\Stdlib\Base\Address - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The address can be turned into array data')] public function testArray() : void { $expected = [ - 'fao' => 'fao', - 'name' => '', + 'fao' => 'fao', + 'name' => '', 'postal' => '', 'city' => '', 'country' => 'XX', @@ -89,21 +79,18 @@ final class AddressTest extends \PHPUnit\Framework\TestCase 'lon' => 0.0, ]; - $this->address->fao = 'fao'; + $this->address->fao = 'fao'; self::assertEquals($expected, $this->address->toArray()); } - /** - * @testdox The address can be json serialized - * @covers phpOMS\Stdlib\Base\Address - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The address can be json serialized')] public function testJsonSerialize() : void { $expected = [ - 'fao' => 'fao', - 'name' => '', + 'fao' => 'fao', + 'name' => '', 'postal' => '', 'city' => '', 'country' => 'XX', @@ -113,7 +100,7 @@ final class AddressTest extends \PHPUnit\Framework\TestCase 'lon' => 0.0, ]; - $this->address->fao = 'fao'; + $this->address->fao = 'fao'; self::assertEquals($expected, $this->address->jsonSerialize()); } diff --git a/tests/Stdlib/Base/AddressTypeTest.php b/tests/Stdlib/Base/AddressTypeTest.php index 4b63a56d8..6505d564d 100755 --- a/tests/Stdlib/Base/AddressTypeTest.php +++ b/tests/Stdlib/Base/AddressTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Stdlib\Base\AddressType; */ final class AddressTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(7, AddressType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(AddressType::getConstants(), \array_unique(AddressType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(1, AddressType::HOME); diff --git a/tests/Stdlib/Base/EnumArrayDemo.php b/tests/Stdlib/Base/EnumArrayDemo.php index 4e60db55f..8c87888c8 100755 --- a/tests/Stdlib/Base/EnumArrayDemo.php +++ b/tests/Stdlib/Base/EnumArrayDemo.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Stdlib/Base/EnumArrayTest.php b/tests/Stdlib/Base/EnumArrayTest.php index d80e87fba..f952bc60e 100755 --- a/tests/Stdlib/Base/EnumArrayTest.php +++ b/tests/Stdlib/Base/EnumArrayTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -15,79 +15,58 @@ declare(strict_types=1); namespace phpOMS\tests\Stdlib\Base; /** - * @testdox phpOMS\tests\Stdlib\Base\EnumArrayTest: Enum array type - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Stdlib\Base\EnumArray::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Stdlib\Base\EnumArrayTest: Enum array type')] final class EnumArrayTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A valid enum name returns the enum value - * @covers phpOMS\Stdlib\Base\EnumArray - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A valid enum name returns the enum value')] public function testValueOutput() : void { self::assertEquals(1, EnumArrayDemo::get('ENUM1')); self::assertEquals('abc', EnumArrayDemo::get('ENUM2')); } - /** - * @testdox A valid enum name can be validated - * @covers phpOMS\Stdlib\Base\EnumArray - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A valid enum name can be validated')] public function testValidateEnumName() : void { self::assertTrue(EnumArrayDemo::isValidName('ENUM1')); } - /** - * @testdox A invalid enum name doesn't validate - * @covers phpOMS\Stdlib\Base\EnumArray - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A invalid enum name doesn't validate")] public function testInvalidEnumNameValidation() : void { self::assertFalse(EnumArrayDemo::isValidName('enum1')); } - /** - * @testdox All enum name/value pairs can be returned - * @covers phpOMS\Stdlib\Base\EnumArray - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All enum name/value pairs can be returned')] public function testOutputValues() : void { self::assertEquals(['ENUM1' => 1, 'ENUM2' => 'abc'], EnumArrayDemo::getConstants()); } - /** - * @testdox A valid enum value can be checked for existence - * @covers phpOMS\Stdlib\Base\EnumArray - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A valid enum value can be checked for existence')] public function testValidateEnumValue() : void { self::assertTrue(EnumArrayDemo::isValidValue(1)); self::assertTrue(EnumArrayDemo::isValidValue('abc')); } - /** - * @testdox A invalid enum value doesn't validate - * @covers phpOMS\Stdlib\Base\EnumArray - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A invalid enum value doesn't validate")] public function testInvalidEnumValueValidation() : void { self::assertFalse(EnumArrayDemo::isValidValue('e3')); } - /** - * @testdox A invalid enum name throws a OutOfBoundsException - * @covers phpOMS\Stdlib\Base\EnumArray - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid enum name throws a OutOfBoundsException')] public function testInvalidConstantException() : void { $this->expectException(\OutOfBoundsException::class); @@ -95,21 +74,15 @@ final class EnumArrayTest extends \PHPUnit\Framework\TestCase EnumArrayDemo::get('enum2'); } - /** - * @testdox The amount of enum values can be returned - * @covers phpOMS\Stdlib\Base\EnumArray - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The amount of enum values can be returned')] public function testCount() : void { self::assertEquals(2, EnumArrayDemo::count()); } - /** - * @testdox A random enum value can be returned - * @covers phpOMS\Stdlib\Base\EnumArray - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A random enum value can be returned')] public function testRandomValue() : void { self::assertTrue(EnumArrayDemo::isValidValue(EnumArrayDemo::getRandom())); diff --git a/tests/Stdlib/Base/EnumDemo.php b/tests/Stdlib/Base/EnumDemo.php index 27f358e2f..96266b677 100755 --- a/tests/Stdlib/Base/EnumDemo.php +++ b/tests/Stdlib/Base/EnumDemo.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Stdlib/Base/EnumTest.php b/tests/Stdlib/Base/EnumTest.php index 62cfe7f99..dbabffb5b 100755 --- a/tests/Stdlib/Base/EnumTest.php +++ b/tests/Stdlib/Base/EnumTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -15,110 +15,80 @@ declare(strict_types=1); namespace phpOMS\tests\Stdlib\Base; /** - * @testdox phpOMS\tests\Stdlib\Base\EnumTest: Enum type - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Stdlib\Base\Enum::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Stdlib\Base\EnumTest: Enum type')] final class EnumTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A valid enum name can be validated - * @covers phpOMS\Stdlib\Base\Enum - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A valid enum name can be validated')] public function testValidateEnumName() : void { self::assertTrue(EnumDemo::isValidName('ENUM1')); } - /** - * @testdox A invalid enum name doesn't validate - * @covers phpOMS\Stdlib\Base\Enum - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A invalid enum name doesn't validate")] public function testInvalidEnumNameValidation() : void { self::assertFalse(EnumDemo::isValidName('enum1')); } - /** - * @testdox All enum name/value pairs can be returned - * @covers phpOMS\Stdlib\Base\Enum - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All enum name/value pairs can be returned')] public function testOutputValues() : void { self::assertEquals(['ENUM1' => 1, 'ENUM2' => ';l'], EnumDemo::getConstants()); } - /** - * @testdox A valid enum value can be checked for existence - * @covers phpOMS\Stdlib\Base\Enum - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A valid enum value can be checked for existence')] public function testValidateEnumValue() : void { self::assertTrue(EnumDemo::isValidValue(1)); self::assertTrue(EnumDemo::isValidValue(';l')); } - /** - * @testdox A invalid enum value doesn't validate - * @covers phpOMS\Stdlib\Base\Enum - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A invalid enum value doesn't validate")] public function testInvalidEnumValueValidation() : void { self::assertFalse(EnumDemo::isValidValue('e3')); } - /** - * @testdox A random enum value can be returned - * @covers phpOMS\Stdlib\Base\Enum - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A random enum value can be returned')] public function testRandomValue() : void { self::assertTrue(EnumDemo::isValidValue(EnumDemo::getRandom())); } - /** - * @testdox A valid enum name returns the enum value - * @covers phpOMS\Stdlib\Base\Enum - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A valid enum name returns the enum value')] public function testValueOutput() : void { self::assertEquals(EnumDemo::ENUM2, EnumDemo::getByName('ENUM2')); self::assertEquals(EnumDemo::ENUM2, EnumDemo::getByName('ENUM2')); } - /** - * @testdox The amount of enum values can be returned - * @covers phpOMS\Stdlib\Base\Enum - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The amount of enum values can be returned')] public function testCount() : void { self::assertEquals(2, EnumDemo::count()); } - /** - * @testdox A valid enum value returns the enum name - * @covers phpOMS\Stdlib\Base\Enum - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A valid enum value returns the enum name')] public function testNameOutput() : void { self::assertEquals('ENUM1', EnumDemo::getName('1')); self::assertEquals('ENUM2', EnumDemo::getName(';l')); } - /** - * @testdox Binary flags validate if they are set - * @covers phpOMS\Stdlib\Base\Enum - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Binary flags validate if they are set')] public function testFlags() : void { self::assertTrue(EnumDemo::hasFlag(13, 4)); @@ -126,22 +96,16 @@ final class EnumTest extends \PHPUnit\Framework\TestCase self::assertTrue(EnumDemo::hasFlag(13, 8)); } - /** - * @testdox Binary flags don't validate if they are not set - * @covers phpOMS\Stdlib\Base\Enum - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Binary flags don't validate if they are not set")] public function testInvalidFlags() : void { self::assertFalse(EnumDemo::hasFlag(13, 2)); self::assertFalse(EnumDemo::hasFlag(13, 16)); } - /** - * @testdox A invalid enum name returns null - * @covers phpOMS\Stdlib\Base\Enum - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid enum name returns null')] public function testInvalidConstantException() : void { self::assertNull(EnumDemo::getByName('ENUM3')); diff --git a/tests/Stdlib/Base/Exception/InvalidEnumNameTest.php b/tests/Stdlib/Base/Exception/InvalidEnumNameTest.php index 803744085..8b4b2b045 100755 --- a/tests/Stdlib/Base/Exception/InvalidEnumNameTest.php +++ b/tests/Stdlib/Base/Exception/InvalidEnumNameTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Stdlib\Base\Exception\InvalidEnumName; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Stdlib\Base\Exception\InvalidEnumName::class)] final class InvalidEnumNameTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Stdlib\Base\Exception\InvalidEnumName - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testException() : void { self::assertInstanceOf(\UnexpectedValueException::class, new InvalidEnumName('')); diff --git a/tests/Stdlib/Base/Exception/InvalidEnumValueTest.php b/tests/Stdlib/Base/Exception/InvalidEnumValueTest.php index 190d0c9b6..1090a5555 100755 --- a/tests/Stdlib/Base/Exception/InvalidEnumValueTest.php +++ b/tests/Stdlib/Base/Exception/InvalidEnumValueTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Stdlib\Base\Exception\InvalidEnumValue; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class)] final class InvalidEnumValueTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Stdlib\Base\Exception\InvalidEnumValue - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testException() : void { self::assertInstanceOf(\UnexpectedValueException::class, new InvalidEnumValue('')); diff --git a/tests/Stdlib/Base/HeapItem.php b/tests/Stdlib/Base/HeapItem.php index bae3efbc0..9f92a54e3 100755 --- a/tests/Stdlib/Base/HeapItem.php +++ b/tests/Stdlib/Base/HeapItem.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Stdlib/Base/HeapTest.php b/tests/Stdlib/Base/HeapTest.php index 879188acd..dace97921 100755 --- a/tests/Stdlib/Base/HeapTest.php +++ b/tests/Stdlib/Base/HeapTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Stdlib\Base; use phpOMS\Stdlib\Base\Heap; /** - * @testdox phpOMS\tests\Stdlib\Base\HeapTest: Heap - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Stdlib\Base\Heap::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Stdlib\Base\HeapTest: Heap')] final class HeapTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A list of elements can be turned into a heap - * @covers phpOMS\Stdlib\Base\Heap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A list of elements can be turned into a heap')] public function testHeapify() : void { $heap = new Heap(); @@ -50,11 +47,8 @@ final class HeapTest extends \PHPUnit\Framework\TestCase self::assertEquals(6, $heap->pop()->getValue()); } - /** - * @testdox Elements get correctly pushed to the heap - * @covers phpOMS\Stdlib\Base\Heap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Elements get correctly pushed to the heap')] public function testSize() : void { $heap = new Heap(); @@ -65,11 +59,8 @@ final class HeapTest extends \PHPUnit\Framework\TestCase self::assertEquals(5, $heap->size()); } - /** - * @testdox A element can be added to a heap at the correct position - * @covers phpOMS\Stdlib\Base\Heap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A element can be added to a heap at the correct position')] public function testInsort() : void { $heap = new Heap(); @@ -92,11 +83,8 @@ final class HeapTest extends \PHPUnit\Framework\TestCase self::assertEquals(6, $heap->pop()->getValue()); } - /** - * @testdox Heap elements get returned in the correct order - * @covers phpOMS\Stdlib\Base\Heap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Heap elements get returned in the correct order')] public function testPushAndPop() : void { $heap = new Heap(); @@ -115,11 +103,8 @@ final class HeapTest extends \PHPUnit\Framework\TestCase self::assertEquals($sortedFunction, $sorted); } - /** - * @testdox Heap elements get returned in the correct order by using a custom comparator - * @covers phpOMS\Stdlib\Base\Heap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Heap elements get returned in the correct order by using a custom comparator')] public function testPushAndPopCustomComparator() : void { $heap = new Heap(function($a, $b) { return ($a <=> $b) * -1; }); @@ -138,11 +123,8 @@ final class HeapTest extends \PHPUnit\Framework\TestCase self::assertEquals(\array_reverse($sortedFunction), $sorted); } - /** - * @testdox The heap can be turned into an array - * @covers phpOMS\Stdlib\Base\Heap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The heap can be turned into an array')] public function testArray() : void { $heap = new Heap(); @@ -162,11 +144,8 @@ final class HeapTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Heap elements can be replaced - * @covers phpOMS\Stdlib\Base\Heap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Heap elements can be replaced')] public function testReplace() : void { $heap = new Heap(); @@ -187,11 +166,8 @@ final class HeapTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A heap element can be returned while adding a new one - * @covers phpOMS\Stdlib\Base\Heap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A heap element can be returned while adding a new one')] public function testPushPop() : void { $heap = new Heap(); @@ -215,11 +191,8 @@ final class HeapTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The heap can be checked if it contains certain elements - * @covers phpOMS\Stdlib\Base\Heap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The heap can be checked if it contains certain elements')] public function testContains() : void { $heap = new Heap(); @@ -236,11 +209,8 @@ final class HeapTest extends \PHPUnit\Framework\TestCase self::assertFalse($heap->contains(new HeapItem(6))); } - /** - * @testdox The heap can be checked if it contains certain custom elements - * @covers phpOMS\Stdlib\Base\Heap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The heap can be checked if it contains certain custom elements')] public function testContainsItem() : void { $heap = new Heap(); @@ -257,11 +227,8 @@ final class HeapTest extends \PHPUnit\Framework\TestCase self::assertFalse($heap->contains(new HeapItem(6))); } - /** - * @testdox A heap item can be updated if it exists while maintaining the correct order - * @covers phpOMS\Stdlib\Base\Heap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A heap item can be updated if it exists while maintaining the correct order')] public function testUpdate() : void { $heap = new Heap(); @@ -286,11 +253,8 @@ final class HeapTest extends \PHPUnit\Framework\TestCase self::assertFalse($heap->update(new HeapItem(999))); } - /** - * @testdox The first heap element can be returned without removing it - * @covers phpOMS\Stdlib\Base\Heap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The first heap element can be returned without removing it')] public function testPeek() : void { $heap = new Heap(); @@ -305,11 +269,8 @@ final class HeapTest extends \PHPUnit\Framework\TestCase self::assertEquals($b, $heap->peek()); } - /** - * @testdox The n smallest elements can be returned from the heap - * @covers phpOMS\Stdlib\Base\Heap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The n smallest elements can be returned from the heap')] public function testNSmallest() : void { $heap = new Heap(); @@ -321,11 +282,8 @@ final class HeapTest extends \PHPUnit\Framework\TestCase self::assertEquals([new HeapItem(1), new HeapItem(1), new HeapItem(3)], $heap->getNSmallest(3)); } - /** - * @testdox The n largest elements can be returned from the heap - * @covers phpOMS\Stdlib\Base\Heap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The n largest elements can be returned from the heap')] public function testNLargest() : void { $heap = new Heap(); @@ -338,11 +296,8 @@ final class HeapTest extends \PHPUnit\Framework\TestCase self::assertEquals([new HeapItem(4), new HeapItem(4), new HeapItem(3)], $heap->getNLargest(3)); } - /** - * @testdox The heap can be cleared of all elements - * @covers phpOMS\Stdlib\Base\Heap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The heap can be cleared of all elements')] public function testClear() : void { $heap = new Heap(); @@ -354,11 +309,8 @@ final class HeapTest extends \PHPUnit\Framework\TestCase self::assertEquals(0, $heap->size()); } - /** - * @testdox The heap can be checked if it has elements - * @covers phpOMS\Stdlib\Base\Heap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The heap can be checked if it has elements')] public function testEmpty() : void { $heap = new Heap(); diff --git a/tests/Stdlib/Base/IbanTest.php b/tests/Stdlib/Base/IbanTest.php index 89a5a96ad..13767a43a 100755 --- a/tests/Stdlib/Base/IbanTest.php +++ b/tests/Stdlib/Base/IbanTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,17 +18,14 @@ use phpOMS\Localization\ISO3166TwoEnum; use phpOMS\Stdlib\Base\Iban; /** - * @testdox phpOMS\tests\Stdlib\Base\IbanTest: Iban type - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Stdlib\Base\Iban::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Stdlib\Base\IbanTest: Iban type')] final class IbanTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A iban can be correctly parsed into its different components - * @covers phpOMS\Stdlib\Base\Iban - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A iban can be correctly parsed into its different components')] public function testInputOutput() : void { $strRepresentation = 'DE22 6008 0000 0960 0280 00'; @@ -49,11 +46,8 @@ final class IbanTest extends \PHPUnit\Framework\TestCase self::assertEquals(22, $iban->getLength()); } - /** - * @testdox A iban can be serialized and unserialized - * @covers phpOMS\Stdlib\Base\Iban - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A iban can be serialized and unserialized')] public function testSearialization() : void { $strRepresentation = 'DE22 6008 0000 0960 0280 00'; @@ -66,11 +60,8 @@ final class IbanTest extends \PHPUnit\Framework\TestCase self::assertEquals('DE22 6008 0000 0960 0280 00', $iban->serialize()); } - /** - * @testdox A invalid iban country code throws a InvalidArgumentException - * @covers phpOMS\Stdlib\Base\Iban - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid iban country code throws a InvalidArgumentException')] public function testInvalidIbanCountry() : void { $this->expectException(\InvalidArgumentException::class); @@ -78,11 +69,8 @@ final class IbanTest extends \PHPUnit\Framework\TestCase $iban = new Iban('ZZ22 6008 0000 0960 0280 00'); } - /** - * @testdox A invalid iban length throws a InvalidArgumentException - * @covers phpOMS\Stdlib\Base\Iban - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid iban length throws a InvalidArgumentException')] public function testInvalidIbanLength() : void { $this->expectException(\InvalidArgumentException::class); @@ -90,11 +78,8 @@ final class IbanTest extends \PHPUnit\Framework\TestCase $iban = new Iban('DE22 6008 0000 0960 0280 0'); } - /** - * @testdox A invalid iban checksum throws a InvalidArgumentException - * @covers phpOMS\Stdlib\Base\Iban - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid iban checksum throws a InvalidArgumentException')] public function testInvalidIbanChecksum() : void { $this->expectException(\InvalidArgumentException::class); diff --git a/tests/Stdlib/Base/LocationTest.php b/tests/Stdlib/Base/LocationTest.php index d5e4dd2f3..00793368a 100755 --- a/tests/Stdlib/Base/LocationTest.php +++ b/tests/Stdlib/Base/LocationTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,10 +18,10 @@ use phpOMS\Stdlib\Base\AddressType; use phpOMS\Stdlib\Base\Location; /** - * @testdox phpOMS\tests\Stdlib\Base\LocationTest: Location type - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Stdlib\Base\Location::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Stdlib\Base\LocationTest: Location type')] final class LocationTest extends \PHPUnit\Framework\TestCase { protected Location $location; @@ -34,11 +34,8 @@ final class LocationTest extends \PHPUnit\Framework\TestCase $this->location = new Location(); } - /** - * @testdox The location has the expected default values after initialization - * @covers phpOMS\Stdlib\Base\Location - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The location has the expected default values after initialization')] public function testDefault() : void { $expected = [ @@ -62,66 +59,48 @@ final class LocationTest extends \PHPUnit\Framework\TestCase self::assertEquals($expected, $this->location->jsonSerialize()); } - /** - * @testdox The postal can be set and returned - * @covers phpOMS\Stdlib\Base\Location - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The postal can be set and returned')] public function testPostalInputOutput() : void { $this->location->postal = '0123456789'; self::assertEquals('0123456789', $this->location->postal); } - /** - * @testdox The city can be set and returned - * @covers phpOMS\Stdlib\Base\Location - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The city can be set and returned')] public function testCityInputOutput() : void { $this->location->city = 'city'; self::assertEquals('city', $this->location->city); } - /** - * @testdox The country can be set and returned - * @covers phpOMS\Stdlib\Base\Location - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The country can be set and returned')] public function testCountryInputOutput() : void { $this->location->setCountry('Country'); self::assertEquals('Country', $this->location->country); } - /** - * @testdox The address can be set and returned - * @covers phpOMS\Stdlib\Base\Location - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The address can be set and returned')] public function testAddressInputOutput() : void { $this->location->address = 'Some address here'; self::assertEquals('Some address here', $this->location->address); } - /** - * @testdox The state can be set and returned - * @covers phpOMS\Stdlib\Base\Location - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The state can be set and returned')] public function testStateInputOutput() : void { $this->location->state = 'This is a state 123'; self::assertEquals('This is a state 123', $this->location->state); } - /** - * @testdox The location can be turned into an array - * @covers phpOMS\Stdlib\Base\Location - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The location can be turned into an array')] public function testArray() : void { $expected = [ @@ -146,11 +125,8 @@ final class LocationTest extends \PHPUnit\Framework\TestCase self::assertEquals($expected, $this->location->toArray()); } - /** - * @testdox The location can be json serialized - * @covers phpOMS\Stdlib\Base\Location - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The location can be json serialized')] public function testJsonSerialize() : void { $expected = [ @@ -176,11 +152,8 @@ final class LocationTest extends \PHPUnit\Framework\TestCase self::assertEquals(\json_encode($this->location->jsonSerialize()), $this->location->serialize()); } - /** - * @testdox The location can unserialized - * @covers phpOMS\Stdlib\Base\Location - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The location can unserialized')] public function testUnserialize() : void { $expected = [ diff --git a/tests/Stdlib/Base/NullLocationTest.php b/tests/Stdlib/Base/NullLocationTest.php index bfd3ea21b..99e314ed7 100755 --- a/tests/Stdlib/Base/NullLocationTest.php +++ b/tests/Stdlib/Base/NullLocationTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Stdlib\Base\NullLocation; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Stdlib\Base\NullLocation::class)] final class NullLocationTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Stdlib\Base\NullLocation - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNullLocation() : void { self::assertInstanceOf('\phpOMS\Stdlib\Base\Location', new NullLocation()); diff --git a/tests/Stdlib/Base/PhoneTypeTest.php b/tests/Stdlib/Base/PhoneTypeTest.php index d26d5a540..c616bf65b 100755 --- a/tests/Stdlib/Base/PhoneTypeTest.php +++ b/tests/Stdlib/Base/PhoneTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Stdlib\Base\PhoneType; */ final class PhoneTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(4, PhoneType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(PhoneType::getConstants(), \array_unique(PhoneType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(1, PhoneType::HOME); diff --git a/tests/Stdlib/Base/SmartDateTimeTest.php b/tests/Stdlib/Base/SmartDateTimeTest.php index 00e06bed3..c97b86cb4 100755 --- a/tests/Stdlib/Base/SmartDateTimeTest.php +++ b/tests/Stdlib/Base/SmartDateTimeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,39 +19,30 @@ use phpOMS\Stdlib\Base\SmartDateTime; require_once __DIR__ . '/../../Autoloader.php'; /** - * @testdox phpOMS\tests\Stdlib\Base\SmartDateTimeTest: DateTime type with additional functionality - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Stdlib\Base\SmartDateTime::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Stdlib\Base\SmartDateTimeTest: DateTime type with additional functionality')] final class SmartDateTimeTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The smart datetime extends the datetime - * @covers phpOMS\Stdlib\Base\SmartDateTime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The smart datetime extends the datetime')] public function testAttributes() : void { $datetime = new SmartDateTime(); self::assertInstanceOf('\DateTime', $datetime); } - /** - * @testdox The smart datetime can be formatted like the datetime - * @covers phpOMS\Stdlib\Base\SmartDateTime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The smart datetime can be formatted like the datetime')] public function testFormat() : void { $datetime = new SmartDateTime('1970-01-01'); self::assertEquals('1970-01-01', $datetime->format('Y-m-d')); } - /** - * @testdox The smart datetime can be modified an creates a new smart datetime - * @covers phpOMS\Stdlib\Base\SmartDateTime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The smart datetime can be modified an creates a new smart datetime')] public function testCreateModify() : void { $datetime = new SmartDateTime('1970-01-01'); @@ -70,33 +61,24 @@ final class SmartDateTimeTest extends \PHPUnit\Framework\TestCase self::assertEquals('1973-12-31', $datetime->createModify(0, -18, 30)->format('Y-m-d')); } - /** - * @testdox The days of the month can be returned - * @covers phpOMS\Stdlib\Base\SmartDateTime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The days of the month can be returned')] public function testDaysOfMonth() : void { $datetime = new SmartDateTime('1975-06-01'); self::assertEquals(30, $datetime->getDaysOfMonth()); } - /** - * @testdox The week day index of the first day of the month can be returned - * @covers phpOMS\Stdlib\Base\SmartDateTime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The week day index of the first day of the month can be returned')] public function testFirstDayOfMonth() : void { $datetime = new SmartDateTime('1975-06-01'); self::assertEquals(0, $datetime->getFirstDayOfMonth()); } - /** - * @testdox A smart datetime can be created from a datetime - * @covers phpOMS\Stdlib\Base\SmartDateTime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A smart datetime can be created from a datetime')] public function testCreateFromDateTime() : void { $expected = new \DateTime('now'); @@ -104,11 +86,8 @@ final class SmartDateTimeTest extends \PHPUnit\Framework\TestCase self::assertEquals($expected->format('Y-m-d H:i:s'), $obj->format('Y-m-d H:i:s')); } - /** - * @testdox A smart datetime can be returned of the last day of the month - * @covers phpOMS\Stdlib\Base\SmartDateTime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A smart datetime can be returned of the last day of the month')] public function testEndOfMonth() : void { $expected = new \DateTime('now'); @@ -117,11 +96,8 @@ final class SmartDateTimeTest extends \PHPUnit\Framework\TestCase self::assertEquals(\date("Y-m-t", \strtotime($expected->format('Y-m-d'))), $obj->getEndOfMonth()->format('Y-m-d')); } - /** - * @testdox A smart datetime can be returned of the fist day of the month - * @covers phpOMS\Stdlib\Base\SmartDateTime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A smart datetime can be returned of the fist day of the month')] public function testStartOfMonth() : void { $expected = new \DateTime('now'); @@ -130,11 +106,8 @@ final class SmartDateTimeTest extends \PHPUnit\Framework\TestCase self::assertEquals(\date("Y-m-01", \strtotime($expected->format('Y-m-d'))), $obj->getStartOfMonth()->format('Y-m-d')); } - /** - * @testdox A smart datetime can be returned of the last day of the week - * @covers phpOMS\Stdlib\Base\SmartDateTime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A smart datetime can be returned of the last day of the week')] public function testEndOfWeek() : void { $expected = new \DateTime('2019-11-23'); @@ -143,11 +116,8 @@ final class SmartDateTimeTest extends \PHPUnit\Framework\TestCase self::assertEquals($expected->format('Y-m-d'), $obj->getEndOfWeek()->format('Y-m-d')); } - /** - * @testdox A smart datetime can be returned of the fist day of the week - * @covers phpOMS\Stdlib\Base\SmartDateTime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A smart datetime can be returned of the fist day of the week')] public function testStartOfWeek() : void { $expected = new \DateTime('2019-11-17'); @@ -156,11 +126,8 @@ final class SmartDateTimeTest extends \PHPUnit\Framework\TestCase self::assertEquals($expected->format('Y-m-d'), $obj->getStartOfWeek()->format('Y-m-d')); } - /** - * @testdox A smart datetime can be returned of the end of the day - * @covers phpOMS\Stdlib\Base\SmartDateTime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A smart datetime can be returned of the end of the day')] public function testEndOfDay() : void { $expected = new \DateTime('2019-11-21'); @@ -169,11 +136,8 @@ final class SmartDateTimeTest extends \PHPUnit\Framework\TestCase self::assertEquals($expected->format('Y-m-d') . ' 23:59:59', $obj->getEndOfDay()->format('Y-m-d H:i:s')); } - /** - * @testdox A smart datetime can be returned of the start of the day - * @covers phpOMS\Stdlib\Base\SmartDateTime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A smart datetime can be returned of the start of the day')] public function testStartOfDay() : void { $expected = new \DateTime('2019-11-21'); @@ -182,11 +146,8 @@ final class SmartDateTimeTest extends \PHPUnit\Framework\TestCase self::assertEquals($expected->format('Y-m-d') . ' 00:00:00', $obj->getStartOfDay()->format('Y-m-d H:i:s')); } - /** - * @testdox A date or year can be checked if it is a leap year - * @covers phpOMS\Stdlib\Base\SmartDateTime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A date or year can be checked if it is a leap year')] public function testLeapYear() : void { self::assertFalse((new SmartDateTime('2103-07-20'))->isLeapYear()); @@ -197,11 +158,8 @@ final class SmartDateTimeTest extends \PHPUnit\Framework\TestCase self::assertTrue(SmartDateTime::leapYear(1600)); } - /** - * @testdox The day of the week index can be returned from a date - * @covers phpOMS\Stdlib\Base\SmartDateTime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The day of the week index can be returned from a date')] public function testDayOfWeek() : void { $expected = new \DateTime('now'); @@ -211,21 +169,15 @@ final class SmartDateTimeTest extends \PHPUnit\Framework\TestCase self::assertEquals(\date('w', $expected->getTimestamp()), $obj->getDayOfWeek()); } - /** - * @testdox A invalid day of the week returns a negative week index - * @covers phpOMS\Stdlib\Base\SmartDateTime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid day of the week returns a negative week index')] public function testInvalidDayOfWeek() : void { self::assertEquals(-1, SmartDateTime::dayOfWeek(-2, 0, 99)); } - /** - * @testdox A calendar sheet is returned containing all days of the month and some days of the previous and next month - * @covers phpOMS\Stdlib\Base\SmartDateTime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A calendar sheet is returned containing all days of the month and some days of the previous and next month')] public function testCalendarSheet() : void { $expected = new \DateTime('now'); diff --git a/tests/Stdlib/Graph/EdgeTest.php b/tests/Stdlib/Graph/EdgeTest.php index c9b5c8d17..b808b8526 100755 --- a/tests/Stdlib/Graph/EdgeTest.php +++ b/tests/Stdlib/Graph/EdgeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,17 +18,14 @@ use phpOMS\Stdlib\Graph\Edge; use phpOMS\Stdlib\Graph\Node; /** - * @testdox phpOMS\tests\Stdlib\Graph\EdgeTest: Edge between nodes - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Stdlib\Graph\Edge::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Stdlib\Graph\EdgeTest: Edge between nodes')] final class EdgeTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The edge has the expected default values after initialization - * @covers phpOMS\Stdlib\Graph\Edge - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The edge has the expected default values after initialization')] public function testDefault() : void { $edge = new Edge(new Node('1'), new Node('2')); @@ -39,22 +36,16 @@ final class EdgeTest extends \PHPUnit\Framework\TestCase self::assertFalse($edge->isDirected); } - /** - * @testdox An edge can be directed - * @covers phpOMS\Stdlib\Graph\Edge - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An edge can be directed')] public function testDirected() : void { $edge = new Edge(new Node('7'), new Node('8'), 1.0, true); self::assertTrue($edge->isDirected); } - /** - * @testdox An edge weight can be set and returned - * @covers phpOMS\Stdlib\Graph\Edge - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An edge weight can be set and returned')] public function testWeightInputOutput() : void { $edge = new Edge(new Node('7'), new Node('8'), 2.0, true); @@ -65,11 +56,8 @@ final class EdgeTest extends \PHPUnit\Framework\TestCase self::assertEquals(3.0, $edge->weight); } - /** - * @testdox Two edge weights can be compared - * @covers phpOMS\Stdlib\Graph\Edge - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Two edge weights can be compared')] public function testWeightComparison() : void { $edge1 = new Edge(new Node('7'), new Node('8'), 1.0, true); diff --git a/tests/Stdlib/Graph/GraphTest.php b/tests/Stdlib/Graph/GraphTest.php index 26d8d3408..1a97f7eb7 100755 --- a/tests/Stdlib/Graph/GraphTest.php +++ b/tests/Stdlib/Graph/GraphTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,10 @@ use phpOMS\Stdlib\Graph\Graph; use phpOMS\Stdlib\Graph\Node; /** - * @testdox hpOMS\tests\Stdlib\Graph\Graph: Graph - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Stdlib\Graph\Graph::class)] +#[\PHPUnit\Framework\Attributes\TestDox('hpOMS\tests\Stdlib\Graph\Graph: Graph')] final class GraphTest extends \PHPUnit\Framework\TestCase { protected Graph $graph; @@ -36,11 +36,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase $this->graph = new Graph(); } - /** - * @testdox The graph has the expected default values after initialization - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The graph has the expected default values after initialization')] public function testDefault() : void { self::assertNull($this->graph->getNode('invalid')); @@ -69,11 +66,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase self::assertEquals($this->graph, $this->graph->getKruskalMinimalSpanningTree()); } - /** - * @testdox A graph can ge set as directed - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A graph can ge set as directed')] public function testDirectedOutput() : void { $node0 = new Node('0'); @@ -88,11 +82,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->graph->isDirected()); } - /** - * @testdox A node can be add to a graph and returned - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A node can be add to a graph and returned')] public function testNodeInputOutput() : void { $node0 = new Node('0'); @@ -101,11 +92,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase self::assertEquals($node0, $this->graph->getNode('0')); } - /** - * @testdox The existence of a node in a graph can be checked - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The existence of a node in a graph can be checked')] public function testNodeExists() : void { $node0 = new Node('0'); @@ -115,11 +103,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->graph->hasNode('1')); } - /** - * @testdox A graph can be checked for bridges - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A graph can be checked for bridges')] public function testGraphWithBridge() : void { $node0 = new Node('0'); @@ -153,11 +138,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase self::assertEquals('6', $bridges[0]->node2->getId()); } - /** - * @testdox Multiple bridges are correctly identified in a graph - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Multiple bridges are correctly identified in a graph')] public function testGraphWithBridges() : void { $node0 = new Node('0'); @@ -178,11 +160,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase self::assertCount(3, $bridges); } - /** - * @testdox A graph without bridges is correctly classified - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A graph without bridges is correctly classified')] public function testGraphWithoutBridges() : void { $node0 = new Node('0'); @@ -201,11 +180,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase self::assertCount(0, $bridges); } - /** - * @testdox Edges can be add and returned from a graph - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Edges can be add and returned from a graph')] public function testEdgesInputOutput() : void { $node0 = new Node('0'); @@ -237,11 +213,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase self::assertCount(8, $edges); } - /** - * @testdox An edge can be found by two edge ids - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An edge can be found by two edge ids')] public function testEdgeInputOutput() : void { $node0 = new Node('0'); @@ -282,11 +255,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase self::assertNull($this->graph->getEdge('invalid1', 'invalid2')); } - /** - * @testdox The existence of cycles in undirected graphs can be checked - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The existence of cycles in undirected graphs can be checked')] public function testUndirectedCycle() : void { $node0 = new Node('0'); @@ -309,11 +279,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->graph->hasCycle()); } - /** - * @testdox The existence of cycles in directed graphs can be checked - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The existence of cycles in directed graphs can be checked')] public function testDirectedCycle() : void { $node0 = new Node('0'); @@ -339,11 +306,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase self::assertTrue($this->graph->hasCycle()); } - /** - * @testdox The cost of a graph can be calculated - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The cost of a graph can be calculated')] public function testCost() : void { $node0 = new Node('0'); @@ -362,11 +326,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase self::assertEquals(5.0, $this->graph->getCost()); } - /** - * @testdox The Kruskal minimal spanning tree can be created - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The Kruskal minimal spanning tree can be created')] public function testKruskalMinimalSpanningTree() : void { $node1 = new Node('1'); @@ -409,10 +370,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase * 0 | \ / * \ | \ / * 2 4 6 - * - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testFindAllReachableNodesDFS() : void { $node0 = new Node('0'); @@ -449,10 +408,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase * 0 | \ / * \ | \ / * 2 4 6 - * - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testGetAllPathsBetweenNodes() : void { $node0 = new Node('0'); @@ -489,10 +446,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase * 0 | \ / * \ | \ / * 2 4 6 - * - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCountAllPathsBetweenNodes() : void { $node0 = new Node('0'); @@ -528,10 +483,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase * 0 | \ / * \ | \ / * 2 4 6 - * - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testLongestPathBetweenNodes() : void { $node0 = new Node('0'); @@ -571,10 +524,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase * 0 | \ / * \ | \ / * 2 4 6 - * - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testShortestPathBetweenNodes() : void { $node0 = new Node('0'); @@ -611,10 +562,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase * 0 | \ / * \ | \ / * 2 4 6 - * - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testShortestPathFloydWarshall() : void { $node0 = new Node('0'); @@ -651,10 +600,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase * 0 | \ / * \ | \ / * 2 4 6 - * - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testLongestPathsDfs() : void { $node0 = new Node('0'); @@ -691,10 +638,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase * 0 | \ / * \ | \ / * 2 4 6 - * - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testUnconnectedGraph() : void { $node0 = new Node('0'); @@ -730,10 +675,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase * 0 | \ / * \ | \ / * 2 4 - * - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testConnectedGraph() : void { $node0 = new Node('0'); @@ -767,10 +710,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase * 0 | \ / * \ | \ / * 2 4 - * - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDiameter() : void { $node0 = new Node('0'); @@ -804,10 +745,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase * 0 | \ / * \ | \ / * 2 4 - * - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testGirth() : void { $node0 = new Node('0'); @@ -841,10 +780,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase * 0 | \ / * \ | \ / * 2 4 - * - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testCircuitRank() : void { $node0 = new Node('0'); @@ -878,10 +815,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase * 0---|---3 * \ | / * 2 - * - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStronglyConnected() : void { $node0 = new Node('0'); @@ -906,10 +841,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase /** * 0 - 1 - 2 - * - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidStronglyConnected() : void { $node0 = new Node('0'); @@ -932,10 +865,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase * 0 | \ / * \ | \ / * 2 4 - * - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testBipartite() : void { $node0 = new Node('0'); @@ -969,10 +900,8 @@ final class GraphTest extends \PHPUnit\Framework\TestCase * 0 | \ / * \ | \ / * 2 4 - * - * @covers phpOMS\Stdlib\Graph\Graph - * @group framework */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testTriangles() : void { $node0 = new Node('0'); diff --git a/tests/Stdlib/Graph/NodeTest.php b/tests/Stdlib/Graph/NodeTest.php index a399d7706..0162d2801 100755 --- a/tests/Stdlib/Graph/NodeTest.php +++ b/tests/Stdlib/Graph/NodeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,17 +18,14 @@ use phpOMS\Stdlib\Graph\Edge; use phpOMS\Stdlib\Graph\Node; /** - * @testdox phpOMS\tests\Stdlib\Graph\NodeTest: Node in a graph - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Stdlib\Graph\Node::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Stdlib\Graph\NodeTest: Node in a graph')] final class NodeTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The node has the expected default values after initialization - * @covers phpOMS\Stdlib\Graph\Node - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The node has the expected default values after initialization')] public function testDefault() : void { $node = new Node('A'); @@ -39,11 +36,8 @@ final class NodeTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $node->getNeighbors()); } - /** - * @testdox The node data can be set and returned - * @covers phpOMS\Stdlib\Graph\Node - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The node data can be set and returned')] public function testDataInputOutput() : void { $node = new Node('B', 1); @@ -53,22 +47,16 @@ final class NodeTest extends \PHPUnit\Framework\TestCase self::assertFalse($node->getData()); } - /** - * @testdox Two equal nodes are equal - * @covers phpOMS\Stdlib\Graph\Node - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Two equal nodes are equal')] public function testNodesEqual() : void { $node = new Node('B', 1); self::assertTrue($node->isEqual($node)); } - /** - * @testdox Two different nodes are not equal - * @covers phpOMS\Stdlib\Graph\Node - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Two different nodes are not equal')] public function testNodesNotEqual() : void { $node = new Node('A', 1); @@ -82,11 +70,8 @@ final class NodeTest extends \PHPUnit\Framework\TestCase self::assertFalse($node->isEqual($node2)); } - /** - * @testdox An edge for a node can be defined - * @covers phpOMS\Stdlib\Graph\Node - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An edge for a node can be defined')] public function testEdgeInputOutput() : void { $node = new Node('A', 1); @@ -95,11 +80,8 @@ final class NodeTest extends \PHPUnit\Framework\TestCase self::assertCount(1, $node->getEdges()); } - /** - * @testdox Edges can be removed from a node - * @covers phpOMS\Stdlib\Graph\Node - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Edges can be removed from a node')] public function testEdgeRemove() : void { $node = new Node('A', 1); @@ -109,11 +91,8 @@ final class NodeTest extends \PHPUnit\Framework\TestCase self::assertCount(0, $node->getEdges()); } - /** - * @testdox An edge for a node can be defined by key - * @covers phpOMS\Stdlib\Graph\Node - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An edge for a node can be defined by key')] public function testEdgeKeyInputOutput() : void { $node = new Node('A', 1); @@ -123,11 +102,8 @@ final class NodeTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf(Edge::class, $node->getEdge(3)); } - /** - * @testdox A node relationship can be defined - * @covers phpOMS\Stdlib\Graph\Node - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A node relationship can be defined')] public function testNodeRelation() : void { $node1 = new Node('A'); @@ -139,13 +115,11 @@ final class NodeTest extends \PHPUnit\Framework\TestCase } /** - * @testdox All neighbors of a node can be returned - * @covers phpOMS\Stdlib\Graph\Node - * @group framework - * * @bug Directed graphs may return invalid neighbors * https://github.com/Karaka-Management/phpOMS/issues/366 */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All neighbors of a node can be returned')] public function testNeighborsInputOutput() : void { $node1 = new Node('A'); diff --git a/tests/Stdlib/Map/KeyTypeTest.php b/tests/Stdlib/Map/KeyTypeTest.php index 02e6e7c1a..987b000eb 100755 --- a/tests/Stdlib/Map/KeyTypeTest.php +++ b/tests/Stdlib/Map/KeyTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Stdlib\Map\KeyType; */ final class KeyTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(2, KeyType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(KeyType::getConstants(), \array_unique(KeyType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(0, KeyType::SINGLE); diff --git a/tests/Stdlib/Map/MultiMapTest.php b/tests/Stdlib/Map/MultiMapTest.php index 66d29e2c7..9aa2c5f1e 100755 --- a/tests/Stdlib/Map/MultiMapTest.php +++ b/tests/Stdlib/Map/MultiMapTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ use phpOMS\Stdlib\Map\MultiMap; use phpOMS\Stdlib\Map\OrderType; /** - * @testdox phpOMS\tests\Stdlib\Map\MultiMapTest: Map which associates multiple keys with the same value - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Stdlib\Map\MultiMap::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Stdlib\Map\MultiMapTest: Map which associates multiple keys with the same value')] final class MultiMapTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The map has the expected default values and functionality after initialization - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The map has the expected default values and functionality after initialization')] public function testDefault() : void { $map = new MultiMap(); @@ -46,11 +43,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertFalse($map->remove('someKey')); } - /** - * @testdox Elements with multiple optional keys can be added - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Elements with multiple optional keys can be added')] public function testBasicAddAny() : void { $map = new MultiMap(); @@ -60,11 +54,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertTrue($inserted); } - /** - * @testdox Elements with multiple optional keys can be returned if any of the keys matches - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Elements with multiple optional keys can be returned if any of the keys matches')] public function testBasicGetAny() : void { $map = new MultiMap(); @@ -74,11 +65,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val1', $map->get('b')); } - /** - * @testdox Elements can be forcefully overwritten - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Elements can be forcefully overwritten')] public function testOverwriteAny() : void { $map = new MultiMap(); @@ -92,11 +80,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val2', $map->get('b')); } - /** - * @testdox By default elements are not overwritten - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('By default elements are not overwritten')] public function testInvalidOverwriteSubkeyAny() : void { $map = new MultiMap(); @@ -110,11 +95,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val2', $map->get('b')); } - /** - * @testdox If a element with partially matching keys is already in the map it will be only added for the new key - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('If a element with partially matching keys is already in the map it will be only added for the new key')] public function testOverwriteCreateAny() : void { $map = new MultiMap(); @@ -129,11 +111,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val3', $map->get('c')); } - /** - * @testdox If all keys exist in the map no new element will be created - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('If all keys exist in the map no new element will be created')] public function testInvalidOverwriteAny() : void { $map = new MultiMap(); @@ -148,11 +127,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val3', $map->get('c')); } - /** - * @testdox Values can be set/replaced by key - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Values can be set/replaced by key')] public function testSetByKeyAny() : void { $map = new MultiMap(); @@ -168,11 +144,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val3', $map->get('c')); } - /** - * @testdox Values cannot be set/replaced if the key doesn't exist - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Values cannot be set/replaced if the key doesn't exist")] public function testInvalidSetByKeyAny() : void { $map = new MultiMap(); @@ -185,11 +158,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals(2, $map->count()); } - /** - * @testdox A key cannot be remapped to a none-existing key - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A key cannot be remapped to a none-existing key')] public function testInvalidRemapNewAny() : void { $map = new MultiMap(); @@ -202,11 +172,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertFalse($remap); } - /** - * @testdox A key can be remapped to the value of an existing key - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A key can be remapped to the value of an existing key')] public function testRemapAny() : void { $map = new MultiMap(); @@ -222,11 +189,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val3', $map->get('c')); } - /** - * @testdox If no more keys are associated with a value after a remap the value is removed from the map - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('If no more keys are associated with a value after a remap the value is removed from the map')] public function testRemapUnmapAny() : void { $map = new MultiMap(); @@ -242,11 +206,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val3', $map->get('c')); } - /** - * @testdox All keys of the map can be returned - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All keys of the map can be returned')] public function testMapKeysAny() : void { $map = new MultiMap(); @@ -261,11 +222,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertIsArray($map->keys()); } - /** - * @testdox All values of the map can be returned - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All values of the map can be returned')] public function testMapValuesAny() : void { $map = new MultiMap(); @@ -280,11 +238,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertIsArray($map->values()); } - /** - * @testdox Sibling keys can be found - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Sibling keys can be found')] public function testSiblingsAny() : void { $map = new MultiMap(); @@ -295,11 +250,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals(['a'], $siblings); } - /** - * @testdox If a key doesn't exist or has no siblings no siblings are returned - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("If a key doesn't exist or has no siblings no siblings are returned")] public function testInvalidSiblingsAny() : void { $map = new MultiMap(); @@ -310,11 +262,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEmpty($siblings); } - /** - * @testdox A key for a value can be removed - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A key for a value can be removed')] public function testRemoveAny() : void { $map = new MultiMap(); @@ -328,11 +277,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertCount(1, $map->values()); } - /** - * @testdox If the last key of a value is removed the value is also removed from the map - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('If the last key of a value is removed the value is also removed from the map')] public function testRemoveLastAny() : void { $map = new MultiMap(); @@ -348,11 +294,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertCount(1, $map->values()); } - /** - * @testdox If a key doesn't exist it cannot be removed - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("If a key doesn't exist it cannot be removed")] public function testInvalidRemoveAny() : void { $map = new MultiMap(); @@ -364,11 +307,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertFalse($removed); } - /** - * @testdox Elements with multiple required keys can be added - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Elements with multiple required keys can be added')] public function testBasicAddExact() : void { $map = new MultiMap(KeyType::MULTIPLE); @@ -378,11 +318,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertTrue($inserted); } - /** - * @testdox Elements with multiple required keys can be returned if all match - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Elements with multiple required keys can be returned if all match')] public function testBasicGetExact() : void { $map = new MultiMap(KeyType::MULTIPLE); @@ -392,11 +329,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val1', $map->get(['b', 'a'])); } - /** - * @testdox Elements with multiple required keys cannot be returned if they don't match exactly - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Elements with multiple required keys cannot be returned if they don't match exactly")] public function testBasicInvalidGetExact() : void { $map = new MultiMap(KeyType::MULTIPLE); @@ -405,11 +339,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertNotEquals('val1', $map->get(['b'])); } - /** - * @testdox Elements with multiple required and ordered keys can be added - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Elements with multiple required and ordered keys can be added')] public function testBasicAddExactOrdered() : void { $map = new MultiMap(KeyType::MULTIPLE, OrderType::STRICT); @@ -419,11 +350,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertTrue($inserted); } - /** - * @testdox Elements with multiple required ordered keys can be if all match in the correct order - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Elements with multiple required ordered keys can be if all match in the correct order')] public function testBasicGetExactOrdered() : void { $map = new MultiMap(KeyType::MULTIPLE, OrderType::STRICT); @@ -432,11 +360,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val1', $map->get(['a', 'b'])); } - /** - * @testdox Elements with multiple required keys cannot be returned if they don't match exactly in the correct order - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Elements with multiple required keys cannot be returned if they don't match exactly in the correct order")] public function testBasicInvalidOrderedGetExact() : void { $map = new MultiMap(KeyType::MULTIPLE, OrderType::STRICT); @@ -445,11 +370,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertNull($map->get(['b', 'a'])); } - /** - * @testdox Elements with multiple required keys can be forcefully overwritten - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Elements with multiple required keys can be forcefully overwritten')] public function testOverwriteExact() : void { $map = new MultiMap(KeyType::MULTIPLE); @@ -461,11 +383,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val2', $map->get(['a', 'b'])); } - /** - * @testdox Elements with multiple required ordered keys can be forcefully overwritten - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Elements with multiple required ordered keys can be forcefully overwritten')] public function testOverwriteExactOrdered() : void { $map = new MultiMap(KeyType::MULTIPLE, OrderType::STRICT); @@ -477,11 +396,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val2', $map->get(['a', 'b'])); } - /** - * @testdox An element cannot be added to for multiple required keys if the keys already exist in a different order - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An element cannot be added to for multiple required keys if the keys already exist in a different order')] public function testInvalidAddDifferentOrderExact() : void { $map = new MultiMap(KeyType::MULTIPLE); @@ -494,11 +410,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val2', $map->get(['b', 'a'])); } - /** - * @testdox If a element with partially matching multiple keys is already in the map it will be only added for the new key - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('If a element with partially matching multiple keys is already in the map it will be only added for the new key')] public function testOverwriteCreateExact() : void { $map = new MultiMap(KeyType::MULTIPLE); @@ -513,11 +426,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val1', $map->get(['a', 'c'])); } - /** - * @testdox Adding differently ordered keys for multiple required keys will create a new entry in the map - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Adding differently ordered keys for multiple required keys will create a new entry in the map')] public function testAddDifferentlyOrderedKeys() : void { $map = new MultiMap(KeyType::MULTIPLE, OrderType::STRICT); @@ -530,11 +440,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val3', $map->get(['b', 'a'])); } - /** - * @testdox If all keys for multiple required keys exist in the map no new element will be created - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('If all keys for multiple required keys exist in the map no new element will be created')] public function testInvalidOverwriteExact() : void { $map = new MultiMap(KeyType::MULTIPLE); @@ -548,11 +455,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val3', $map->get(['a', 'c'])); } - /** - * @testdox If all keys for multiple required ordered keys exist in the map no new element will be created - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('If all keys for multiple required ordered keys exist in the map no new element will be created')] public function testInvalidOverwriteExactOrdered() : void { $map = new MultiMap(KeyType::MULTIPLE, OrderType::STRICT); @@ -566,11 +470,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val3', $map->get(['a', 'c'])); } - /** - * @testdox Values can be set/replaced by multiple required keys - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Values can be set/replaced by multiple required keys')] public function testSetByKeyExact() : void { $map = new MultiMap(KeyType::MULTIPLE); @@ -586,11 +487,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val3', $map->get(['a', 'c'])); } - /** - * @testdox Values cannot be set/replaced if the multiple required keys don't match or exist - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Values cannot be set/replaced if the multiple required keys don't match or exist")] public function testInvalidSetByKeyExact() : void { $map = new MultiMap(KeyType::MULTIPLE); @@ -606,11 +504,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertFalse($set); } - /** - * @testdox Values can be set/replaced by multiple required ordered keys if the order is correct - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Values can be set/replaced by multiple required ordered keys if the order is correct')] public function testSetByKeyExactOrdered() : void { $map = new MultiMap(KeyType::MULTIPLE, OrderType::STRICT); @@ -624,11 +519,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals('val4', $map->get(['a', 'b'])); } - /** - * @testdox Values cannot be set/replaced if the multiple required ordered keys don't match or exist in the correct order - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Values cannot be set/replaced if the multiple required ordered keys don't match or exist in the correct order")] public function testInvalidSetByKeyExactOrdered() : void { $map = new MultiMap(KeyType::MULTIPLE, OrderType::STRICT); @@ -641,11 +533,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertFalse($set); } - /** - * @testdox Multiple keys cannot be remapped - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Multiple keys cannot be remapped')] public function testInvalidRemapExact() : void { $map = new MultiMap(KeyType::MULTIPLE); @@ -656,11 +545,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertFalse($remap); } - /** - * @testdox All sibling key combinations can be found for multiple required keys - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All sibling key combinations can be found for multiple required keys')] public function testSiblingsExact() : void { $map = new MultiMap(KeyType::MULTIPLE); @@ -669,11 +555,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals([['a', 'b'], ['b', 'a']], $map->getSiblings(['a', 'b'])); } - /** - * @testdox For multiple required ordered keys don't exist any siblings - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("For multiple required ordered keys don't exist any siblings")] public function testSiblingsExactOrdered() : void { $map = new MultiMap(KeyType::MULTIPLE, OrderType::STRICT); @@ -682,11 +565,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $map->getSiblings(['a', 'b'])); } - /** - * @testdox A multiple required key combination for a value can be removed - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A multiple required key combination for a value can be removed')] public function testRemoveExact() : void { $map = new MultiMap(KeyType::MULTIPLE); @@ -700,11 +580,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertCount(1, $map->values()); } - /** - * @testdox If a multiple required key combination doesn't exist it cannot be removed - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("If a multiple required key combination doesn't exist it cannot be removed")] public function testInvalidRemoveExact() : void { $map = new MultiMap(KeyType::MULTIPLE); @@ -719,11 +596,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertFalse($map->removeKey('a')); } - /** - * @testdox A multiple required ordered key combination for a value can be removed - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A multiple required ordered key combination for a value can be removed')] public function testRemoveExactOrdered() : void { $map = new MultiMap(KeyType::MULTIPLE, OrderType::STRICT); @@ -737,11 +611,8 @@ final class MultiMapTest extends \PHPUnit\Framework\TestCase self::assertCount(1, $map->values()); } - /** - * @testdox If a multiple required ordered key combination doesn't exist it cannot be removed - * @covers phpOMS\Stdlib\Map\MultiMap - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("If a multiple required ordered key combination doesn't exist it cannot be removed")] public function testInvalidRemoveExactOrdered() : void { $map = new MultiMap(KeyType::MULTIPLE, OrderType::STRICT); diff --git a/tests/Stdlib/Map/OrderTypeTest.php b/tests/Stdlib/Map/OrderTypeTest.php index ece9ca5d3..7147d92cf 100755 --- a/tests/Stdlib/Map/OrderTypeTest.php +++ b/tests/Stdlib/Map/OrderTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Stdlib\Map\OrderType; */ final class OrderTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(2, OrderType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(OrderType::getConstants(), \array_unique(OrderType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(0, OrderType::LOOSE); diff --git a/tests/Stdlib/Queue/PriorityModeTest.php b/tests/Stdlib/Queue/PriorityModeTest.php index 4aed8c6e1..91463ad73 100755 --- a/tests/Stdlib/Queue/PriorityModeTest.php +++ b/tests/Stdlib/Queue/PriorityModeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Stdlib\Queue\PriorityMode; */ final class PriorityModeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(4, PriorityMode::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(PriorityMode::getConstants(), \array_unique(PriorityMode::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(1, PriorityMode::FIFO); diff --git a/tests/Stdlib/Queue/PriorityQueueTest.php b/tests/Stdlib/Queue/PriorityQueueTest.php index 38439e68c..92f4a8170 100755 --- a/tests/Stdlib/Queue/PriorityQueueTest.php +++ b/tests/Stdlib/Queue/PriorityQueueTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,17 +18,14 @@ use phpOMS\Stdlib\Queue\PriorityMode; use phpOMS\Stdlib\Queue\PriorityQueue; /** - * @testdox phpOMS\tests\Stdlib\Queue\PriorityQueueTest: Priority queue - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Stdlib\Queue\PriorityQueue::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Stdlib\Queue\PriorityQueueTest: Priority queue')] final class PriorityQueueTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The queue has the expected default values and functionality after initialization - * @covers phpOMS\Stdlib\Queue\PriorityQueue - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The queue has the expected default values and functionality after initialization')] public function testDefault() : void { $queue = new PriorityQueue(); @@ -39,11 +36,8 @@ final class PriorityQueueTest extends \PHPUnit\Framework\TestCase self::assertEquals(PriorityMode::FIFO, $queue->getType()); } - /** - * @testdox Queue elements can be added with the default value of 1.0 and returned - * @covers phpOMS\Stdlib\Queue\PriorityQueue - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Queue elements can be added with the default value of 1.0 and returned')] public function testInputOutput() : void { $queue = new PriorityQueue(); @@ -52,11 +46,8 @@ final class PriorityQueueTest extends \PHPUnit\Framework\TestCase self::assertEquals(['data' => 'a', 'priority' => 1.0], $queue->get($id)); } - /** - * @testdox Queue elements can be added with a priority - * @covers phpOMS\Stdlib\Queue\PriorityQueue - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Queue elements can be added with a priority')] public function testAddWithPriority() : void { $queue = new PriorityQueue(); @@ -68,11 +59,8 @@ final class PriorityQueueTest extends \PHPUnit\Framework\TestCase self::assertEquals(-1, $queue->get($id)['priority']); } - /** - * @testdox The priority queue returns the correct amount of elements it holds - * @covers phpOMS\Stdlib\Queue\PriorityQueue - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The priority queue returns the correct amount of elements it holds')] public function testCount() : void { $queue = new PriorityQueue(); @@ -83,11 +71,8 @@ final class PriorityQueueTest extends \PHPUnit\Framework\TestCase self::assertEquals(3, $queue->count()); } - /** - * @testdox A queue element can be removed - * @covers phpOMS\Stdlib\Queue\PriorityQueue - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A queue element can be removed')] public function testRemove() : void { $queue = new PriorityQueue(); @@ -100,11 +85,8 @@ final class PriorityQueueTest extends \PHPUnit\Framework\TestCase self::assertEquals(2, $queue->count()); } - /** - * @testdox A none-existing queue element id cannot be removed - * @covers phpOMS\Stdlib\Queue\PriorityQueue - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing queue element id cannot be removed')] public function testInvalidRemove() : void { $queue = new PriorityQueue(); @@ -118,11 +100,8 @@ final class PriorityQueueTest extends \PHPUnit\Framework\TestCase self::assertEquals(2, $queue->count()); } - /** - * @testdox A removed or none-existing queue element returns a empty data - * @covers phpOMS\Stdlib\Queue\PriorityQueue - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A removed or none-existing queue element returns a empty data')] public function testInvalidGet() : void { $queue = new PriorityQueue(); @@ -133,11 +112,8 @@ final class PriorityQueueTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $queue->get($id)); } - /** - * @testdox The priority of all queue elements can be uniformly increased - * @covers phpOMS\Stdlib\Queue\PriorityQueue - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The priority of all queue elements can be uniformly increased')] public function testPriorityIncreaseAll() : void { $queue = new PriorityQueue(); @@ -155,11 +131,8 @@ final class PriorityQueueTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The priority or a queue element can be changed - * @covers phpOMS\Stdlib\Queue\PriorityQueue - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The priority or a queue element can be changed')] public function testPriorityChange() : void { $queue = new PriorityQueue(); @@ -173,11 +146,8 @@ final class PriorityQueueTest extends \PHPUnit\Framework\TestCase self::assertEquals(3, $queue->get($id1)['priority']); } - /** - * @testdox The queue can be serialized and unserialized - * @covers phpOMS\Stdlib\Queue\PriorityQueue - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The queue can be serialized and unserialized')] public function testSerialize() : void { $queue = new PriorityQueue(); @@ -192,11 +162,8 @@ final class PriorityQueueTest extends \PHPUnit\Framework\TestCase self::assertEquals($queue->serialize(), $queue2->serialize()); } - /** - * @testdox A queue element can be popped from the que which also removes it from the queue - * @covers phpOMS\Stdlib\Queue\PriorityQueue - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A queue element can be popped from the que which also removes it from the queue')] public function testPop() : void { $queue = new PriorityQueue(); @@ -208,11 +175,8 @@ final class PriorityQueueTest extends \PHPUnit\Framework\TestCase self::assertEquals(0, $queue->count()); } - /** - * @testdox A FIFO queue returns the elements in FIFO order - * @covers phpOMS\Stdlib\Queue\PriorityQueue - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A FIFO queue returns the elements in FIFO order')] public function testFIFO() : void { $queue = new PriorityQueue(PriorityMode::FIFO); @@ -226,11 +190,8 @@ final class PriorityQueueTest extends \PHPUnit\Framework\TestCase self::assertEquals(['data' => 'c', 'priority' => -1], $queue->pop()); } - /** - * @testdox A LIFO queue returns the elements in LIFO order - * @covers phpOMS\Stdlib\Queue\PriorityQueue - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A LIFO queue returns the elements in LIFO order')] public function testLIFO() : void { $queue = new PriorityQueue(PriorityMode::LIFO); @@ -244,11 +205,8 @@ final class PriorityQueueTest extends \PHPUnit\Framework\TestCase self::assertEquals(['data' => 'a', 'priority' => -2], $queue->pop()); } - /** - * @testdox A highest queue returns the elements in highest priority order - * @covers phpOMS\Stdlib\Queue\PriorityQueue - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A highest queue returns the elements in highest priority order')] public function testHighest() : void { $queue = new PriorityQueue(PriorityMode::HIGHEST); @@ -262,11 +220,8 @@ final class PriorityQueueTest extends \PHPUnit\Framework\TestCase self::assertEquals(['data' => 'a', 'priority' => -2], $queue->pop()); } - /** - * @testdox A lowest queue returns the elements in lowest priority order - * @covers phpOMS\Stdlib\Queue\PriorityQueue - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A lowest queue returns the elements in lowest priority order')] public function testLowest() : void { $queue = new PriorityQueue(PriorityMode::LOWEST); @@ -280,11 +235,8 @@ final class PriorityQueueTest extends \PHPUnit\Framework\TestCase self::assertEquals(['data' => 'b', 'priority' => 2], $queue->pop()); } - /** - * @testdox A invalid priority queue type throws a InvalidEnumValue - * @covers phpOMS\Stdlib\Queue\PriorityQueue - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid priority queue type throws a InvalidEnumValue')] public function testInvalidPriority() : void { $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); diff --git a/tests/Stdlib/Tree/BinarySearchTreeTest.php b/tests/Stdlib/Tree/BinarySearchTreeTest.php index 73276be49..79b2445c7 100644 --- a/tests/Stdlib/Tree/BinarySearchTreeTest.php +++ b/tests/Stdlib/Tree/BinarySearchTreeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,9 @@ use phpOMS\Stdlib\Tree\BinarySearchTree; use phpOMS\Stdlib\Tree\Node; /** - * @testdox phpOMS\tests\Stdlib\Tree\BinarySearchTreeTest: Priority queue - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Stdlib\Tree\BinarySearchTreeTest: Priority queue')] final class BinarySearchTreeTest extends \PHPUnit\Framework\TestCase { public function testInsert() : void diff --git a/tests/System/CharsetTypeTest.php b/tests/System/CharsetTypeTest.php index 25709b53c..65d45628f 100755 --- a/tests/System/CharsetTypeTest.php +++ b/tests/System/CharsetTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,36 +19,30 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\System\CharsetType; /** - * @testdox phpOMS\tests\System\CharsetTypeTest: Character set type enum * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\System\CharsetTypeTest: Character set type enum')] final class CharsetTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The character set type enum has the correct amount of values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The character set type enum has the correct amount of values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(3, CharsetType::getConstants()); } - /** - * @testdox The character set type enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The character set type enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(CharsetType::getConstants(), \array_unique(CharsetType::getConstants())); } - /** - * @testdox The character set type enum has the correct values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The character set type enum has the correct values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('us-ascii', CharsetType::ASCII); diff --git a/tests/System/File/ContentPutModeTest.php b/tests/System/File/ContentPutModeTest.php index 612de666f..473f593f0 100755 --- a/tests/System/File/ContentPutModeTest.php +++ b/tests/System/File/ContentPutModeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\System\File\ContentPutMode; */ final class ContentPutModeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(4, ContentPutMode::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(ContentPutMode::getConstants(), \array_unique(ContentPutMode::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(1, ContentPutMode::APPEND); diff --git a/tests/System/File/ExtensionTypeTest.php b/tests/System/File/ExtensionTypeTest.php index 1a42e7fbd..8b7932739 100755 --- a/tests/System/File/ExtensionTypeTest.php +++ b/tests/System/File/ExtensionTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\System\File\ExtensionType; */ final class ExtensionTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(14, ExtensionType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(ExtensionType::getConstants(), \array_unique(ExtensionType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(1, ExtensionType::UNKNOWN); diff --git a/tests/System/File/FileUtilsTest.php b/tests/System/File/FileUtilsTest.php index 0eea5cebe..9bc0a1b55 100755 --- a/tests/System/File/FileUtilsTest.php +++ b/tests/System/File/FileUtilsTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,17 +18,14 @@ use phpOMS\System\File\ExtensionType; use phpOMS\System\File\FileUtils; /** - * @testdox phpOMS\tests\System\File\FileUtilsTest: File utilities - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\System\File\FileUtils::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\System\File\FileUtilsTest: File utilities')] final class FileUtilsTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox File extensions can be categorized - * @covers phpOMS\System\File\FileUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('File extensions can be categorized')] public function testExtension() : void { self::assertEquals(ExtensionType::UNKNOWN, FileUtils::getExtensionType('test')); @@ -47,32 +44,23 @@ final class FileUtilsTest extends \PHPUnit\Framework\TestCase self::assertEquals(ExtensionType::DIRECTORY, FileUtils::getExtensionType('/')); } - /** - * @testdox A relative path can be turned into an absolute path - * @covers phpOMS\System\File\FileUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A relative path can be turned into an absolute path')] public function testAbsolute() : void { self::assertEquals(\realpath(__DIR__ . '/..'), FileUtils::absolute(__DIR__ . '/..')); self::assertEquals('/test/ative', FileUtils::absolute('/test/path/for/../rel/../../ative')); } - /** - * @testdox Permissions can be turned into octal values - * @covers phpOMS\System\File\FileUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Permissions can be turned into octal values')] public function testPermissionToOctal() : void { self::assertEquals(0742, FileUtils::permissionToOctal('rwxr---w-')); } - /** - * @testdox The encoding of a file can be changed - * @covers phpOMS\System\File\FileUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The encoding of a file can be changed')] public function testChangeFileEncoding() : void { if (\is_file(__DIR__ . '/UTF-8.txt')) { @@ -90,11 +78,8 @@ final class FileUtilsTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox The file information can be resolved from a path - * @covers phpOMS\System\File\FileUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The file information can be resolved from a path')] public function testPathInfo() : void { self::assertEquals(__DIR__, FileUtils::mb_pathinfo(__DIR__ . '/FileUtilsTest.php', \PATHINFO_DIRNAME)); diff --git a/tests/System/File/Ftp/DirectoryTest.php b/tests/System/File/Ftp/DirectoryTest.php index 1c83e6106..96639a1d8 100755 --- a/tests/System/File/Ftp/DirectoryTest.php +++ b/tests/System/File/Ftp/DirectoryTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,10 +18,10 @@ use phpOMS\System\File\Ftp\Directory; use phpOMS\Uri\HttpUri; /** - * @testdox phpOMS\tests\System\File\Ftp\DirectoryTest: Directory handler for a ftp server - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\System\File\Ftp\Directory::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\System\File\Ftp\DirectoryTest: Directory handler for a ftp server')] final class DirectoryTest extends \PHPUnit\Framework\TestCase { public const BASE = 'ftp://test:123456@127.0.0.1:21'; @@ -71,29 +71,20 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testConnection() : void { self::assertNotFalse(Directory::ftpConnect(new HttpUri(self::BASE . '/test'))); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidConnection() : void { self::assertNull(Directory::ftpConnect(new HttpUri('ftp://karaka.app:21'))); } - /** - * @testdox A directory can be created - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be created')] public function testStaticCreate() : void { $dirPath = __DIR__ . '/test'; @@ -103,22 +94,16 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir($dirPath); } - /** - * @testdox A directory can be checked for existence - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be checked for existence')] public function testStaticExists() : void { self::assertTrue(Directory::exists(self::$con, __DIR__)); self::assertFalse(Directory::exists(self::$con, __DIR__ . '/invalid/path/here')); } - /** - * @testdox An existing directory cannot be overwritten - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An existing directory cannot be overwritten')] public function testInvalidStaticOverwrite() : void { $dirPath = __DIR__ . '/test'; @@ -128,11 +113,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir($dirPath); } - /** - * @testdox A directory can be forced to be created recursively - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be forced to be created recursively')] public function testStaticSubdir() : void { $dirPath = __DIR__ . '/test/sub/path'; @@ -144,21 +126,15 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::delete(self::$con, __DIR__ . '/test'); } - /** - * @testdox By default a directory is not created recursively - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('By default a directory is not created recursively')] public function testInvalidStaticSubdir() : void { self::assertFalse(Directory::create(self::$con, __DIR__ . '/invalid/path/here')); } - /** - * @testdox The name of a directory is just its name without its path - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The name of a directory is just its name without its path')] public function testStaticName() : void { $dirPath = __DIR__ . '/test'; @@ -166,11 +142,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', Directory::name($dirPath)); } - /** - * @testdox The basename is the same as the name of the directory - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The basename is the same as the name of the directory')] public function testStaticBasename() : void { $dirPath = __DIR__ . '/test'; @@ -178,11 +151,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', Directory::basename($dirPath)); } - /** - * @testdox The dirname is the same as the name of the directory - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The dirname is the same as the name of the directory')] public function testStaticDirname() : void { $dirPath = __DIR__ . '/test'; @@ -190,11 +160,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', Directory::dirname($dirPath)); } - /** - * @testdox The parent of a directory can be returned - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The parent of a directory can be returned')] public function testStaticParent() : void { $dirPath = __DIR__ . '/test'; @@ -202,11 +169,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals(\strtr(\realpath(__DIR__), '\\', '/'), Directory::parent($dirPath)); } - /** - * @testdox The full absolute path of a directory can be returned - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The full absolute path of a directory can be returned')] public function testStaticDirectoryPath() : void { $dirPath = __DIR__ . '/test'; @@ -214,11 +178,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals($dirPath, Directory::dirpath($dirPath)); } - /** - * @testdox The directories creation date can be returned - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The directories creation date can be returned')] public function testStaticCreatedAt() : void { $dirPath = __DIR__ . '/test'; @@ -233,11 +194,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::delete(self::$con, $dirPath); } - /** - * @testdox The directories last change date can be returned - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The directories last change date can be returned')] public function testStaticChangedAt() : void { $dirPath = __DIR__ . '/test'; @@ -252,11 +210,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::delete(self::$con, $dirPath); } - /** - * @testdox A directory can be deleted - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be deleted')] public function testStaticDelete() : void { $dirPath = __DIR__ . '/test'; @@ -266,11 +221,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertFalse(Directory::exists(self::$con, $dirPath)); } - /** - * @testdox A none-existing directory cannot be deleted - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing directory cannot be deleted')] public function testInvalidStaticDelete() : void { $dirPath = __DIR__ . '/test'; @@ -278,66 +230,48 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertFalse(Directory::delete(self::$con, $dirPath)); } - /** - * @testdox The size of a directory can be returned - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The size of a directory can be returned')] public function testStaticSizeRecursive() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertGreaterThan(0, Directory::size(self::$con, $dirTestPath)); } - /** - * @testdox The size of a none-existing directory is negative - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The size of a none-existing directory is negative')] public function testInvalidStaticSizeRecursive() : void { $dirTestPath = __DIR__ . '/invalid/test/here'; self::assertEquals(-1, Directory::size(self::$con, $dirTestPath)); } - /** - * @testdox The recursive size of a directory is equals or greater than the size of the same directory none-recursive - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The recursive size of a directory is equals or greater than the size of the same directory none-recursive')] public function testStaticSize() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertGreaterThan(Directory::size(self::$con, $dirTestPath, false), Directory::size(self::$con, $dirTestPath)); } - /** - * @testdox The permission of a directory can be returned - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission of a directory can be returned')] public function testStaticPermission() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertGreaterThan(0, Directory::permission(self::$con, $dirTestPath)); } - /** - * @testdox The permission of a none-existing directory is negative - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission of a none-existing directory is negative')] public function testInvalidStaticPermission() : void { $dirTestPath = __DIR__ . '/invalid/test/here'; self::assertEquals(-1, Directory::permission(self::$con, $dirTestPath)); } - /** - * @testdox A directory can be copied recursively - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be copied recursively')] public function testStaticCopy() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -347,10 +281,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::delete(self::$con, __DIR__ . '/newdirtest'); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStaticCopyOverwrite() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -362,10 +293,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::delete(self::$con, __DIR__ . '/newdirtest'); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStaticInvalidCopyOverwrite() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -375,11 +303,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::delete(self::$con, __DIR__ . '/newdirtest'); } - /** - * @testdox A directory can be moved/renamed to a different path - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be moved/renamed to a different path')] public function testStaticMove() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -390,10 +315,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::move(self::$con, __DIR__ . '/newdirtest', $dirTestPath); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStaticInvalidMoveOverwrite() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -404,10 +326,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::move(self::$con, __DIR__ . '/newdirtest', $dirTestPath); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStaticMoveOverwrite() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -421,123 +340,87 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::move(self::$con, __DIR__ . '/newdirtest', $dirTestPath); } - /** - * @testdox The amount of files in a directory can be returned recursively - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The amount of files in a directory can be returned recursively')] public function testStaticCountRecursive() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertEquals(4, Directory::count(self::$con, $dirTestPath)); } - /** - * @testdox The amount of files in a directory can be returned none-recursively - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The amount of files in a directory can be returned none-recursively')] public function testStaticCount() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertEquals(1, Directory::count(self::$con, $dirTestPath, false)); } - /** - * @testdox The amount of files of a none-existing directory is negative - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The amount of files of a none-existing directory is negative')] public function testInvalidStaticCount() : void { $dirTestPath = __DIR__ . '/invalid/path/here'; self::assertEquals(-1, Directory::count(self::$con, $dirTestPath, false)); } - /** - * @testdox All files and sub-directories of a directory can be listed - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All files and sub-directories of a directory can be listed')] public function testStaticListFiles() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertCount(6, Directory::list(self::$con, $dirTestPath, '*', true)); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStaticListFilesByExtension() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertCount(3, Directory::listByExtension(self::$con, $dirTestPath, 'txt', '', true)); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStaticOwner() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertTrue(!empty(Directory::owner(self::$con, $dirTestPath))); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDirectoryNameSanitizing() : void { self::assertEquals(':/some/test/[path', Directory::sanitize(':#&^$/some%/test/[path!')); } - /** - * @testdox A none-existing directory returns a empty list of files and sub-directories - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing directory returns a empty list of files and sub-directories')] public function testInvalidListPath() : void { self::assertEquals([], Directory::list(self::$con, __DIR__ . '/invalid.txt')); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidListFilesByExtension() : void { self::assertEquals([], Directory::listByExtension(self::$con, __DIR__ . '/invalid/path/here', 'txt')); } - /** - * @testdox A invalid directory cannot be copied to a new destination - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid directory cannot be copied to a new destination')] public function testInvalidCopyPath() : void { self::assertFalse(Directory::copy(self::$con, __DIR__ . '/invalid', __DIR__ . '/invalid2')); } - /** - * @testdox A invalid directory cannot be moved to a new destination - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid directory cannot be moved to a new destination')] public function testInvalidMovePath() : void { self::assertFalse(Directory::move(self::$con, __DIR__ . '/invalid', __DIR__ . '/invalid2')); } - /** - * @testdox Reading the creation date of a none-existing directory throws a PathException - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the creation date of a none-existing directory throws a PathException')] public function testInvalidCreatedPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -545,11 +428,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::created(self::$con, __DIR__ . '/invalid'); } - /** - * @testdox Reading the last change date of a none-existing directory throws a PathException - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the last change date of a none-existing directory throws a PathException')] public function testInvalidChangedPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -557,11 +437,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::changed(self::$con, __DIR__ . '/invalid'); } - /** - * @testdox Reading the owner of a none-existing directory throws a PathException - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the owner of a none-existing directory throws a PathException')] public function testInvalidOwnerPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -569,10 +446,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::owner(self::$con, __DIR__ . '/invalid'); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testList() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -584,10 +458,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase ], $dir->getList()); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeOutput() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -596,10 +467,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf(Directory::class, $dir->getNode('sub')); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeCreate() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__), true, self::$con); @@ -615,10 +483,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir(__DIR__ . '/nodedir2'); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeDelete() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__), true, self::$con); @@ -631,10 +496,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertFalse(\is_dir(__DIR__ . '/nodedir')); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeCopy() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__), true, self::$con); @@ -647,10 +509,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir(__DIR__ . '/nodedir2'); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeMove() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__), true, self::$con); @@ -663,10 +522,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir(__DIR__ . '/nodedir2'); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeExists() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__), true, self::$con); @@ -676,10 +532,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertFalse($dir->isExisting('invalid')); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testParentOutput() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__ . '/dirtest'), true, self::$con); @@ -687,10 +540,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals(__DIR__, $dir->getParent()->getPath()); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeNext() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__ . '/dirtest'), true, self::$con); @@ -699,10 +549,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals(__DIR__ . '/dirtest/test.txt', $dir->current()->getPath()); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeCurrent() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__ . '/dirtest'), true, self::$con); @@ -710,10 +557,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals(__DIR__ . '/dirtest/sub', $dir->current()->getPath()); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeKey() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__ . '/dirtest'), true, self::$con); @@ -724,10 +568,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('test.txt', $dir->key()); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeArrayRead() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__ . '/dirtest'), true, self::$con); @@ -735,10 +576,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', $dir['test.txt']->getName()); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeArraySet() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__), true, self::$con); @@ -753,10 +591,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir(__DIR__ . '/nodedir'); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeArrayRemove() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__), true, self::$con); @@ -769,10 +604,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertFalse(\is_dir(__DIR__ . '/nodedir')); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeArrayExists() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__), true, self::$con); @@ -781,10 +613,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertFalse(isset($dir['invalid'])); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeCreatedAt() : void { $dirPath = __DIR__ . '/test'; @@ -798,10 +627,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir($dirPath); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeChangedAt() : void { $dirPath = __DIR__ . '/test'; @@ -815,10 +641,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir($dirPath); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeOwner() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__ . '/dirtest'), true, self::$con); @@ -826,10 +649,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertTrue(!empty($dir->getOwner())); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodePermission() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__ . '/dirtest'), true, self::$con); @@ -837,10 +657,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertGreaterThan(0, $dir->getPermission()); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDirname() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__ . '/dirtest'), true, self::$con); @@ -849,10 +666,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('dirtest', $dir->current()->getDirname()); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testName() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__ . '/dirtest'), true, self::$con); @@ -861,10 +675,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', $dir->current()->getName()); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testBaseame() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__ . '/dirtest'), true, self::$con); @@ -873,10 +684,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('test.txt', $dir->current()->getBasename()); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDirpath() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__ . '/dirtest'), true, self::$con); @@ -885,10 +693,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals(__DIR__ . '/dirtest', $dir->current()->getDirPath()); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeValid() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__ . '/dirtest'), true, self::$con); @@ -897,10 +702,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertTrue($dir->valid()); } - /** - * @covers phpOMS\System\File\Ftp\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeInvalid() : void { $dir = new Directory(new HttpUri(self::BASE . __DIR__ . '/dirtest'), true, self::$con); diff --git a/tests/System/File/Ftp/FileTest.php b/tests/System/File/Ftp/FileTest.php index 74efbc90a..e562b3b9e 100755 --- a/tests/System/File/Ftp/FileTest.php +++ b/tests/System/File/Ftp/FileTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,10 +20,10 @@ use phpOMS\System\File\Ftp\File; use phpOMS\Uri\HttpUri; /** - * @testdox phpOMS\tests\System\File\Ftp\FileTest: File handler for a ftp server - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\System\File\Ftp\File::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\System\File\Ftp\FileTest: File handler for a ftp server')] final class FileTest extends \PHPUnit\Framework\TestCase { public const BASE = 'ftp://test:123456@127.0.0.1:21'; @@ -75,29 +75,20 @@ final class FileTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testConnection() : void { self::assertNotFalse(File::ftpConnect(new HttpUri(self::BASE . '/test'))); } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidConnection() : void { self::assertNull(File::ftpConnect(new HttpUri('ftp://karaka.app:21'))); } - /** - * @testdox A file without content can be created - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file without content can be created')] public function testStaticCreate() : void { $testFile = __DIR__ . '/test.txt'; @@ -108,11 +99,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox A file cannot be created if it already exists - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file cannot be created if it already exists')] public function testInvalidStaticCreate() : void { $testFile = __DIR__ . '/test.txt'; @@ -123,11 +111,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox A file with content can be created - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file with content can be created')] public function testStaticPut() : void { $testFile = __DIR__ . '/test.txt'; @@ -138,11 +123,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox A file cannot be replaced if it doesn't exists - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A file cannot be replaced if it doesn't exists")] public function testInvalidStaticCreateReplace() : void { $testFile = __DIR__ . '/test.txt'; @@ -150,11 +132,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertfalse(\is_file($testFile)); } - /** - * @testdox A file cannot be appended if it doesn't exists - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A file cannot be appended if it doesn't exists")] public function testInvalidStaticCreateAppend() : void { $testFile = __DIR__ . '/test.txt'; @@ -162,11 +141,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertfalse(\is_file($testFile)); } - /** - * @testdox A file cannot be prepended if it doesn't exists - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A file cannot be prepended if it doesn't exists")] public function testInvalidStaticCreatePrepend() : void { $testFile = __DIR__ . '/test.txt'; @@ -174,22 +150,16 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertfalse(\is_file($testFile)); } - /** - * @testdox A file can be checked for existence - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be checked for existence')] public function testStaticExists() : void { self::assertTrue(File::exists(self::$con, __DIR__ . '/FileTest.php')); self::assertFalse(File::exists(self::$con, __DIR__ . '/invalid/file.txt')); } - /** - * @testdox A file can be replaced with a new one - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be replaced with a new one')] public function testStaticReplace() : void { $testFile = __DIR__ . '/test.txt'; @@ -201,11 +171,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox The set alias works like the replace flag - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The set alias works like the replace flag')] public function testStaticSetAlias() : void { $testFile = __DIR__ . '/test.txt'; @@ -217,11 +184,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox A file can be appended with additional content - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be appended with additional content')] public function testStaticAppend() : void { $testFile = __DIR__ . '/test.txt'; @@ -233,11 +197,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox The append alias works like the append flag - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The append alias works like the append flag')] public function testStaticAppendAlias() : void { $testFile = __DIR__ . '/test.txt'; @@ -249,11 +210,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox A file can be prepended with additional content - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be prepended with additional content')] public function testStaticPrepend() : void { $testFile = __DIR__ . '/test.txt'; @@ -265,11 +223,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox The prepend alias works like the prepend flag - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The prepend alias works like the prepend flag')] public function testStaticPrependAlias() : void { $testFile = __DIR__ . '/test.txt'; @@ -281,11 +236,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox The content of a file can be read - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The content of a file can be read')] public function testStaticGet() : void { $testFile = __DIR__ . '/test.txt'; @@ -295,11 +247,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox The parent directory of a file can be returned - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The parent directory of a file can be returned')] public function testStaticParent() : void { $testFile = __DIR__ . '/test.txt'; @@ -307,11 +256,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals(\strtr(\realpath(__DIR__ . '/../'), '\\', '/'), File::parent($testFile)); } - /** - * @testdox The extension of a file can be returned - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The extension of a file can be returned')] public function testStaticExtension() : void { $testFile = __DIR__ . '/test.txt'; @@ -319,11 +265,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals('txt', File::extension($testFile)); } - /** - * @testdox The name of a file can be returned - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The name of a file can be returned')] public function testStaticName() : void { $testFile = __DIR__ . '/test.txt'; @@ -331,11 +274,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', File::name($testFile)); } - /** - * @testdox The basename of a file can be returned - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The basename of a file can be returned')] public function testStaticBaseName() : void { $testFile = __DIR__ . '/test.txt'; @@ -343,11 +283,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals('test.txt', File::basename($testFile)); } - /** - * @testdox The file name of a file can be returned - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The file name of a file can be returned')] public function testStaticDirname() : void { $testFile = __DIR__ . '/test.txt'; @@ -355,11 +292,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals(\basename(\realpath(__DIR__)), File::dirname($testFile)); } - /** - * @testdox The file path of a file can be returned - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The file path of a file can be returned')] public function testStaticDirectoryPath() : void { $testFile = __DIR__ . '/test.txt'; @@ -367,11 +301,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals(\realpath(__DIR__), File::dirpath($testFile)); } - /** - * @testdox The count of a file is always 1 - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The count of a file is always 1')] public function testStaticCount() : void { $testFile = __DIR__ . '/test.txt'; @@ -379,11 +310,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals(1, File::count(self::$con, $testFile)); } - /** - * @testdox The directories creation date can be returned - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The directories creation date can be returned')] public function testStaticCreatedAt() : void { $testFile = __DIR__ . '/test.txt'; @@ -397,11 +325,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox The directories last change date can be returned - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The directories last change date can be returned')] public function testStaticChangedAt() : void { $testFile = __DIR__ . '/test.txt'; @@ -415,11 +340,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox A file can be deleted - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be deleted')] public function testStaticDelete() : void { $testFile = __DIR__ . '/test.txt'; @@ -429,11 +351,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertFalse(File::exists(self::$con, $testFile)); } - /** - * @testdox A none-existing file cannot be deleted - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing file cannot be deleted')] public function testInvalidStaticDelete() : void { $testFile = __DIR__ . '/test.txt'; @@ -441,11 +360,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertFalse(File::delete(self::$con, $testFile)); } - /** - * @testdox The size of a file can be returned - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The size of a file can be returned')] public function testStaticSize() : void { $testFile = __DIR__ . '/test.txt'; @@ -458,11 +374,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox The permission of a file can be returned - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission of a file can be returned')] public function testStaticPermission() : void { $testFile = __DIR__ . '/test.txt'; @@ -475,22 +388,16 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox The permission of a none-existing file is negative - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission of a none-existing file is negative')] public function testInvalidStaticPermission() : void { $testFile = __DIR__ . '/test.txt'; self::assertEquals(-1, File::permission(self::$con, $testFile)); } - /** - * @testdox A file can be copied to a different location - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be copied to a different location')] public function testStaticCopy() : void { $testFile = __DIR__ . '/test.txt'; @@ -509,11 +416,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox A file cannot be copied to a different location if the destination already exists - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file cannot be copied to a different location if the destination already exists')] public function testInvalidStaticCopy() : void { $testFile = __DIR__ . '/test.txt'; @@ -529,11 +433,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox A file can be forced to be copied to a different location even if the destination already exists - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be forced to be copied to a different location even if the destination already exists')] public function testStaticCopyOverwrite() : void { $testFile = __DIR__ . '/test.txt'; @@ -549,11 +450,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox A file can be moved to a different location - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be moved to a different location')] public function testStaticMove() : void { $testFile = __DIR__ . '/test.txt'; @@ -569,11 +467,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase Directory::delete(self::$con, __DIR__ . '/sub'); } - /** - * @testdox A file cannot be moved to a different location if the destination already exists - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file cannot be moved to a different location if the destination already exists')] public function testInvalidStaticMove() : void { $testFile = __DIR__ . '/test.txt'; @@ -590,11 +485,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox A file can be forced to be moved to a different location even if the destination already exists - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be forced to be moved to a different location even if the destination already exists')] public function testStaticMoveOverwrite() : void { $testFile = __DIR__ . '/test.txt'; @@ -610,70 +502,49 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $newPath); } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStaticOwner() : void { $dirTestPath = __DIR__ . '/dirtest/test.txt'; self::assertTrue(!empty(File::owner(self::$con, $dirTestPath))); } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testFileNameSanitizing() : void { self::assertEquals('/some/test/[path.txt', File::sanitize(':#&^$/some%/test/[path!.txt')); } - /** - * @testdox The size of a none-existing file is negative - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The size of a none-existing file is negative')] public function testInvalidSizePath() : void { self::assertEquals(-1, File::size(self::$con, __DIR__ . '/invalid.txt')); } - /** - * @testdox A none-existing file cannot be copied - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing file cannot be copied')] public function testInvalidCopyPath() : void { self::assertFalse(File::copy(self::$con, __DIR__ . '/invalid.txt', __DIR__ . '/invalid2.txt')); } - /** - * @testdox A none-existing file cannot be moved - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing file cannot be moved')] public function testInvalidMovePath() : void { self::assertFalse(File::move(self::$con, __DIR__ . '/invalid.txt', __DIR__ . '/invalid2.txt')); } - /** - * @testdox Reading the content of a none-existing file returns an empty string - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the content of a none-existing file returns an empty string')] public function testInvalidGetPath() : void { self::assertEquals('', File::get(self::$con, __DIR__ . '/invalid.txt')); } - /** - * @testdox Reading the created date of a none-existing file throws a PathException - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the created date of a none-existing file throws a PathException')] public function testInvalidCreatedPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -681,11 +552,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::created(self::$con, __DIR__ . '/invalid.txt'); } - /** - * @testdox Reading the last change date of a none-existing file throws a PathException - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the last change date of a none-existing file throws a PathException')] public function testInvalidChangedPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -693,11 +561,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::changed(self::$con, __DIR__ . '/invalid.txt'); } - /** - * @testdox Reading the owner of a none-existing file throws a PathException - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the owner of a none-existing file throws a PathException')] public function testInvalidOwnerPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -705,10 +570,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::owner(self::$con, __DIR__ . '/invalid.txt'); } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeInputOutput() : void { $testFile = __DIR__ . '/test.txt'; @@ -725,10 +587,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeReplace() : void { $testFile = __DIR__ . '/test.txt'; @@ -746,10 +605,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeAppend() : void { $testFile = __DIR__ . '/test.txt'; @@ -767,10 +623,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodePrepend() : void { $testFile = __DIR__ . '/test.txt'; @@ -788,10 +641,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeExtension() : void { $testFile = __DIR__ . '/test.txt'; @@ -800,10 +650,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals('txt', $file->getExtension()); } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeCreatedAt() : void { $testFile = __DIR__ . '/test.txt'; @@ -823,10 +670,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeChangedAt() : void { $testFile = __DIR__ . '/test.txt'; @@ -846,10 +690,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeOwner() : void { $testFile = __DIR__ . '/dirtest/test.txt'; @@ -858,10 +699,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertTrue(!empty($file->getOwner())); } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodePermission() : void { $testFile = __DIR__ . '/dirtest/test.txt'; @@ -870,10 +708,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertGreaterThan(0, $file->getPermission()); } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDirname() : void { $testFile = __DIR__ . '/dirtest/test.txt'; @@ -882,10 +717,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals('dirtest', $file->getDirname()); } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testName() : void { $testFile = __DIR__ . '/dirtest/test.txt'; @@ -894,10 +726,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', $file->getName()); } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testBaseame() : void { $testFile = __DIR__ . '/dirtest/test.txt'; @@ -906,10 +735,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals('test.txt', $file->getBasename()); } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDirpath() : void { $testFile = __DIR__ . '/dirtest/test.txt'; @@ -918,10 +744,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals(__DIR__ . '/dirtest', $file->getDirPath()); } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testParentOutput() : void { $testFile = __DIR__ . '/dirtest/test.txt'; @@ -930,10 +753,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals(__DIR__ . '/dirtest', $file->getDirPath()); } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeCreate() : void { $testFile = __DIR__ . '/test.txt'; @@ -951,10 +771,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeDelete() : void { $testFile = __DIR__ . '/test.txt'; @@ -976,10 +793,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeCopy() : void { $testFile = __DIR__ . '/test.txt'; @@ -1003,10 +817,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeMove() : void { $testFile = __DIR__ . '/test.txt'; @@ -1026,10 +837,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeExists() : void { $file = new File(new HttpUri(self::BASE . __DIR__ . '/dirtest/test.txt'), self::$con); @@ -1039,10 +847,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertFalse($file2->isExisting()); } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeParent() : void { $file = new File(new HttpUri(self::BASE . __DIR__ . '/dirtest/test.txt'), self::$con); @@ -1050,10 +855,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals('Ftp', $file->getParent()->getName()); } - /** - * @covers phpOMS\System\File\Ftp\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeDirectory() : void { $file = new File(new HttpUri(self::BASE . __DIR__ . '/dirtest/test.txt'), self::$con); diff --git a/tests/System/File/Ftp/FtpStorageTest.php b/tests/System/File/Ftp/FtpStorageTest.php index 57ea442f0..4e0de874a 100755 --- a/tests/System/File/Ftp/FtpStorageTest.php +++ b/tests/System/File/Ftp/FtpStorageTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,10 +21,10 @@ use phpOMS\System\File\Ftp\FtpStorage; use phpOMS\Uri\HttpUri; /** - * @testdox phpOMS\tests\System\File\Ftp\FtpStorageTest: Directory & File handler for local file system - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\System\File\Ftp\FtpStorage::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\System\File\Ftp\FtpStorageTest: Directory & File handler for local file system')] final class FtpStorageTest extends \PHPUnit\Framework\TestCase { public const BASE = 'ftp://test:123456@127.0.0.1:21'; @@ -80,11 +80,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox A directory can be created - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be created')] public function testStaticCreateDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -94,22 +91,16 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase Directory::delete(self::$con, $dirPath); } - /** - * @testdox A directory can be checked for existence - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be checked for existence')] public function testStaticExistsDirectory() : void { self::assertTrue(FtpStorage::exists(__DIR__)); self::assertFalse(FtpStorage::exists(__DIR__ . '/invalid/path/here')); } - /** - * @testdox An existing directory cannot be overwritten - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An existing directory cannot be overwritten')] public function testInvalidStaticOverwriteDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -119,11 +110,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase Directory::delete(self::$con, $dirPath); } - /** - * @testdox A directory can be forced to be created recursively - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be forced to be created recursively')] public function testStaticSubdirDirectory() : void { $dirPath = __DIR__ . '/test/sub/path'; @@ -135,11 +123,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase Directory::delete(self::$con, __DIR__ . '/test'); } - /** - * @testdox The name of a directory is just its name without its path - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The name of a directory is just its name without its path')] public function testStaticNameDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -147,11 +132,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', FtpStorage::name($dirPath)); } - /** - * @testdox The basename is the same as the name of the directory - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The basename is the same as the name of the directory')] public function testStaticBasenameDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -159,11 +141,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', FtpStorage::basename($dirPath)); } - /** - * @testdox The dirname is the same as the name of the directory - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The dirname is the same as the name of the directory')] public function testStaticDirnameDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -171,11 +150,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', FtpStorage::dirname($dirPath)); } - /** - * @testdox The parent of a directory can be returned - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The parent of a directory can be returned')] public function testStaticParentDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -183,11 +159,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals(\strtr(\realpath(__DIR__), '\\', '/'), FtpStorage::parent($dirPath)); } - /** - * @testdox The full absolute path of a directory can be returned - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The full absolute path of a directory can be returned')] public function testStaticDirectoryPathDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -195,11 +168,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals($dirPath, FtpStorage::dirpath($dirPath)); } - /** - * @testdox The directories creation date can be returned - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The directories creation date can be returned')] public function testStaticCreatedAtDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -214,11 +184,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase Directory::delete(self::$con, $dirPath); } - /** - * @testdox The directories last change date can be returned - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The directories last change date can be returned')] public function testStaticChangedAtDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -233,11 +200,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase Directory::delete(self::$con, $dirPath); } - /** - * @testdox A directory can be deleted - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be deleted')] public function testStaticDeleteDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -247,11 +211,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertFalse(FtpStorage::exists($dirPath)); } - /** - * @testdox A none-existing directory cannot be deleted - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing directory cannot be deleted')] public function testInvalidStaticDeleteDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -259,66 +220,48 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertFalse(FtpStorage::delete($dirPath)); } - /** - * @testdox The size of a directory can be returned - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The size of a directory can be returned')] public function testStaticSizeRecursiveDirectory() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertGreaterThan(0, FtpStorage::size($dirTestPath)); } - /** - * @testdox The size of a none-existing directory is negative - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The size of a none-existing directory is negative')] public function testInvalidStaticSizeRecursiveDirectory() : void { $dirTestPath = __DIR__ . '/invalid/test/here'; self::assertEquals(-1, FtpStorage::size($dirTestPath)); } - /** - * @testdox The recursive size of a directory is equals or greater than the size of the same directory none-recursive - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The recursive size of a directory is equals or greater than the size of the same directory none-recursive')] public function testStaticSizeDirectory() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertGreaterThan(FtpStorage::size($dirTestPath, false), FtpStorage::size($dirTestPath)); } - /** - * @testdox The permission of a directory can be returned - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission of a directory can be returned')] public function testStaticPermissionDirectory() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertGreaterThan(0, FtpStorage::permission($dirTestPath)); } - /** - * @testdox The permission of a none-existing directory is negative - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission of a none-existing directory is negative')] public function testInvalidStaticPermissionDirectory() : void { $dirTestPath = __DIR__ . '/invalid/test/here'; self::assertEquals(-1, FtpStorage::permission($dirTestPath)); } - /** - * @testdox A directory can be copied recursively - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be copied recursively')] public function testStaticCopyDirectory() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -328,11 +271,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase FtpStorage::delete(__DIR__ . '/newdirtest'); } - /** - * @testdox A directory can be moved/renamed to a different path - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be moved/renamed to a different path')] public function testStaticMoveDirectory() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -343,85 +283,61 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase FtpStorage::move(__DIR__ . '/newdirtest', $dirTestPath); } - /** - * @testdox The amount of files in a directory can be returned recursively - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The amount of files in a directory can be returned recursively')] public function testStaticCountRecursiveDirectory() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertEquals(4, FtpStorage::count($dirTestPath)); } - /** - * @testdox The amount of files in a directory can be returned none-recursively - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The amount of files in a directory can be returned none-recursively')] public function testStaticCountDirectory() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertEquals(1, FtpStorage::count($dirTestPath, false)); } - /** - * @testdox The amount of files of a none-existing directory is negative - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The amount of files of a none-existing directory is negative')] public function testInvalidStaticCountDirectory() : void { $dirTestPath = __DIR__ . '/invalid/path/here'; self::assertEquals(-1, FtpStorage::count($dirTestPath, false)); } - /** - * @testdox All files and sub-directories of a directory can be listed - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All files and sub-directories of a directory can be listed')] public function testStaticListFilesDirectory() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertCount(6, FtpStorage::list($dirTestPath, '*', true)); } - /** - * @testdox A none-existing directory returns a empty list of files and sub-directories - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing directory returns a empty list of files and sub-directories')] public function testInvalidListPathDirectory() : void { self::assertEquals([], FtpStorage::list(__DIR__ . '/invalid/path/here')); } - /** - * @testdox A invalid directory cannot be copied to a new destination - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid directory cannot be copied to a new destination')] public function testInvalidCopyPathDirectory() : void { self::assertFalse(FtpStorage::copy(__DIR__ . '/invalid', __DIR__ . '/invalid2')); } - /** - * @testdox A invalid directory cannot be moved to a new destination - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid directory cannot be moved to a new destination')] public function testInvalidMovePathDirectory() : void { self::assertFalse(FtpStorage::move(__DIR__ . '/invalid', __DIR__ . '/invalid2')); } - /** - * @testdox Reading the creation date of a none-existing directory throws a PathException - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the creation date of a none-existing directory throws a PathException')] public function testInvalidCreatedPathDirectory() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -429,11 +345,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase FtpStorage::created(__DIR__ . '/invalid'); } - /** - * @testdox Reading the last change date of a none-existing directory throws a PathException - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the last change date of a none-existing directory throws a PathException')] public function testInvalidChangedPathDirectory() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -441,11 +354,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase FtpStorage::changed(__DIR__ . '/invalid'); } - /** - * @testdox Reading the owner of a none-existing directory throws a PathException - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the owner of a none-existing directory throws a PathException')] public function testInvalidOwnerPathDirectory() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -453,11 +363,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase FtpStorage::owner(__DIR__ . '/invalid'); } - /** - * @testdox A file without content can be created - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file without content can be created')] public function testStaticCreateFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -468,11 +375,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file cannot be created if it already exists - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file cannot be created if it already exists')] public function testInvalidStaticCreateFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -483,11 +387,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file with content can be created - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file with content can be created')] public function testStaticPutFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -498,11 +399,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file cannot be replaced if it doesn't exists - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A file cannot be replaced if it doesn't exists")] public function testInvalidStaticCreateReplaceFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -510,11 +408,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertfalse(\is_file($testFile)); } - /** - * @testdox A file cannot be appended if it doesn't exists - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A file cannot be appended if it doesn't exists")] public function testInvalidStaticCreateAppendFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -522,11 +417,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertfalse(\is_file($testFile)); } - /** - * @testdox A file cannot be prepended if it doesn't exists - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A file cannot be prepended if it doesn't exists")] public function testInvalidStaticCreatePrependFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -534,22 +426,16 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertfalse(\is_file($testFile)); } - /** - * @testdox A file can be checked for existence - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be checked for existence')] public function testStaticExistsFile() : void { self::assertTrue(FtpStorage::exists(__DIR__ . '/FileTest.php')); self::assertFalse(FtpStorage::exists(__DIR__ . '/invalid/file.txt')); } - /** - * @testdox A file can be replaced with a new one - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be replaced with a new one')] public function testStaticReplaceFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -561,11 +447,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The set alias works like the replace flag - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The set alias works like the replace flag')] public function testStaticSetAliasFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -577,11 +460,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file can be appended with additional content - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be appended with additional content')] public function testStaticAppendFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -593,11 +473,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The append alias works like the append flag - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The append alias works like the append flag')] public function testStaticAppendAliasFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -609,11 +486,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file can be prepended with additional content - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be prepended with additional content')] public function testStaticPrependFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -625,11 +499,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The prepend alias works like the prepend flag - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The prepend alias works like the prepend flag')] public function testStaticPrependAliasFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -641,11 +512,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The content of a file can be read - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The content of a file can be read')] public function testStaticGetFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -655,11 +523,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The parent directory of a file can be returned - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The parent directory of a file can be returned')] public function testStaticParentFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -667,11 +532,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals(\strtr(\realpath(__DIR__ . '/../'), '\\', '/'), FtpStorage::parent($testFile)); } - /** - * @testdox The extension of a file can be returned - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The extension of a file can be returned')] public function testStaticExtensionFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -679,11 +541,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals('txt', FtpStorage::extension($testFile)); } - /** - * @testdox The name of a file can be returned - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The name of a file can be returned')] public function testStaticNameFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -691,11 +550,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', FtpStorage::name($testFile)); } - /** - * @testdox The basename of a file can be returned - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The basename of a file can be returned')] public function testStaticBaseNameFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -703,11 +559,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals('test.txt', FtpStorage::basename($testFile)); } - /** - * @testdox The file name of a file can be returned - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The file name of a file can be returned')] public function testStaticDirnameFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -715,11 +568,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals(\basename(\realpath(__DIR__)), FtpStorage::dirname($testFile)); } - /** - * @testdox The file path of a file can be returned - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The file path of a file can be returned')] public function testStaticDirectoryPathFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -727,11 +577,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals(\realpath(__DIR__), FtpStorage::dirpath($testFile)); } - /** - * @testdox The count of a file is always 1 - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The count of a file is always 1')] public function testStaticCountFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -739,11 +586,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals(1, FtpStorage::count($testFile)); } - /** - * @testdox The directories creation date can be returned - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The directories creation date can be returned')] public function testStaticCreatedAtFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -755,11 +599,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The directories last change date can be returned - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The directories last change date can be returned')] public function testStaticChangedAtFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -771,11 +612,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file can be deleted - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be deleted')] public function testStaticDeleteFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -785,11 +623,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertFalse(FtpStorage::exists($testFile)); } - /** - * @testdox A none-existing file cannot be deleted - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing file cannot be deleted')] public function testInvalidStaticDeleteFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -797,11 +632,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertFalse(FtpStorage::delete($testFile)); } - /** - * @testdox The size of a file can be returned - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The size of a file can be returned')] public function testStaticSizeFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -812,11 +644,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The permission of a file can be returned - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission of a file can be returned')] public function testStaticPermissionFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -827,22 +656,16 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The permission of a none-existing file is negative - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission of a none-existing file is negative')] public function testInvalidStaticPermissionFile() : void { $testFile = __DIR__ . '/test.txt'; self::assertEquals(-1, FtpStorage::permission($testFile)); } - /** - * @testdox A file can be copied to a different location - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be copied to a different location')] public function testStaticCopyFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -861,11 +684,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox A file cannot be copied to a different location if the destination already exists - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file cannot be copied to a different location if the destination already exists')] public function testInvalidStaticCopyFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -881,11 +701,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox A file can be forced to be copied to a different location even if the destination already exists - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be forced to be copied to a different location even if the destination already exists')] public function testStaticCopyOverwriteFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -901,11 +718,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox A file can be moved to a different location - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be moved to a different location')] public function testStaticMoveFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -923,11 +737,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase Directory::delete(self::$con, __DIR__ . '/sub/'); } - /** - * @testdox A file cannot be moved to a different location if the destination already exists - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file cannot be moved to a different location if the destination already exists')] public function testInvalidStaticMoveFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -944,11 +755,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $testFile); } - /** - * @testdox A file can be forced to be moved to a different location even if the destination already exists - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be forced to be moved to a different location even if the destination already exists')] public function testStaticMoveOverwriteFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -965,60 +773,42 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase File::delete(self::$con, $newPath); } - /** - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSanitize() : void { self::assertEquals(':/some/test/[path', FtpStorage::sanitize(':#&^$/some%/test/[path!')); } - /** - * @testdox The size of a none-existing file is negative - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The size of a none-existing file is negative')] public function testInvalidSizePathFile() : void { self::assertEquals(-1, FtpStorage::size(__DIR__ . '/invalid.txt')); } - /** - * @testdox A none-existing file cannot be copied - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing file cannot be copied')] public function testInvalidCopyPathFile() : void { self::assertFalse(FtpStorage::copy(__DIR__ . '/invalid.txt', __DIR__ . '/invalid2.txt')); } - /** - * @testdox A none-existing file cannot be moved - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing file cannot be moved')] public function testInvalidMovePathFile() : void { self::assertFalse(FtpStorage::move(__DIR__ . '/invalid.txt', __DIR__ . '/invalid2.txt')); } - /** - * @testdox Reading the content of a none-existing file returns an empty result - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the content of a none-existing file returns an empty result')] public function testInvalidGetPathFile() : void { self::assertEquals('', FtpStorage::get(__DIR__ . '/invalid.txt')); } - /** - * @testdox Reading the created date of a none-existing file throws a PathException - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the created date of a none-existing file throws a PathException')] public function testInvalidCreatedPathFile() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -1026,11 +816,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase FtpStorage::created(__DIR__ . '/invalid.txt'); } - /** - * @testdox Reading the last change date of a none-existing file throws a PathException - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the last change date of a none-existing file throws a PathException')] public function testInvalidChangedPathFile() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -1038,11 +825,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase FtpStorage::changed(__DIR__ . '/invalid.txt'); } - /** - * @testdox Reading the owner of a none-existing file throws a PathException - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the owner of a none-existing file throws a PathException')] public function testInvalidOwnerPathFile() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -1050,11 +834,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase FtpStorage::owner(__DIR__ . '/invalid.txt'); } - /** - * @testdox Writing data to a destination which looks like a directory throws a PathException - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Writing data to a destination which looks like a directory throws a PathException')] public function testInvalidPutPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -1062,11 +843,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase FtpStorage::put(__DIR__, 'Test'); } - /** - * @testdox Reading data from a directory throws a PathException - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading data from a directory throws a PathException')] public function testInvalidGetPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -1074,11 +852,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase FtpStorage::get(__DIR__); } - /** - * @testdox Trying to run list on a file throws a PathException - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Trying to run list on a file throws a PathException')] public function testInvalidListPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -1086,11 +861,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase FtpStorage::list(__DIR__ . '/FtpStorageTest.php'); } - /** - * @testdox Setting data to a destination which looks like a directory throws a PathException - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Setting data to a destination which looks like a directory throws a PathException')] public function testInvalidSetPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -1098,11 +870,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase FtpStorage::set(__DIR__, 'Test'); } - /** - * @testdox Appending data to a destination which looks like a directory throws a PathException - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Appending data to a destination which looks like a directory throws a PathException')] public function testInvalidAppendPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -1110,11 +879,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase FtpStorage::append(__DIR__, 'Test'); } - /** - * @testdox Prepending data to a destination which looks like a directory throws a PathException - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Prepending data to a destination which looks like a directory throws a PathException')] public function testInvalidPrependPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -1122,11 +888,8 @@ final class FtpStorageTest extends \PHPUnit\Framework\TestCase FtpStorage::prepend(__DIR__, 'Test'); } - /** - * @testdox Reading the extension of a destination which looks like a directory throws a PathException - * @covers phpOMS\System\File\Ftp\FtpStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the extension of a destination which looks like a directory throws a PathException')] public function testInvalidExtensionPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); diff --git a/tests/System/File/Local/DirectoryTest.php b/tests/System/File/Local/DirectoryTest.php index 10dfe8cf6..4e8d631bb 100755 --- a/tests/System/File/Local/DirectoryTest.php +++ b/tests/System/File/Local/DirectoryTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\System\File\Local; use phpOMS\System\File\Local\Directory; /** - * @testdox phpOMS\tests\System\File\Local\DirectoryTest: Directory handler for local file system - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\System\File\Local\Directory::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\System\File\Local\DirectoryTest: Directory handler for local file system')] final class DirectoryTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A directory can be created - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be created')] public function testStaticCreate() : void { $dirPath = __DIR__ . '/test'; @@ -37,22 +34,16 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir($dirPath); } - /** - * @testdox A directory can be checked for existence - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be checked for existence')] public function testStaticExists() : void { self::assertTrue(Directory::exists(__DIR__)); self::assertFalse(Directory::exists(__DIR__ . '/invalid/path/here')); } - /** - * @testdox An existing directory cannot be overwritten - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An existing directory cannot be overwritten')] public function testInvalidStaticOverwrite() : void { $dirPath = __DIR__ . '/test'; @@ -62,11 +53,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir($dirPath); } - /** - * @testdox A directory can be forced to be created recursively - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be forced to be created recursively')] public function testStaticSubdir() : void { $dirPath = __DIR__ . '/test/sub/path'; @@ -78,21 +66,15 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir(__DIR__ . '/test'); } - /** - * @testdox By default a directory is not created recursively - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('By default a directory is not created recursively')] public function testInvalidStaticSubdir() : void { self::assertFalse(Directory::create(__DIR__ . '/invalid/path/here')); } - /** - * @testdox The name of a directory is just its name without its path - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The name of a directory is just its name without its path')] public function testStaticName() : void { $dirPath = __DIR__ . '/test'; @@ -100,11 +82,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', Directory::name($dirPath)); } - /** - * @testdox The basename is the same as the name of the directory - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The basename is the same as the name of the directory')] public function testStaticBasename() : void { $dirPath = __DIR__ . '/test'; @@ -112,11 +91,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', Directory::basename($dirPath)); } - /** - * @testdox The dirname is the same as the name of the directory - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The dirname is the same as the name of the directory')] public function testStaticDirname() : void { $dirPath = __DIR__ . '/test'; @@ -124,11 +100,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', Directory::dirname($dirPath)); } - /** - * @testdox The parent of a directory can be returned - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The parent of a directory can be returned')] public function testStaticParent() : void { $dirPath = __DIR__ . '/test'; @@ -136,11 +109,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals(\strtr(\realpath(__DIR__), '\\', '/'), Directory::parent($dirPath)); } - /** - * @testdox The full absolute path of a directory can be returned - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The full absolute path of a directory can be returned')] public function testStaticDirectoryPath() : void { $dirPath = __DIR__ . '/test'; @@ -148,11 +118,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals($dirPath, Directory::dirpath($dirPath)); } - /** - * @testdox The directories creation date can be returned - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The directories creation date can be returned')] public function testStaticCreatedAt() : void { $dirPath = __DIR__ . '/test'; @@ -165,11 +132,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir($dirPath); } - /** - * @testdox The directories last change date can be returned - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The directories last change date can be returned')] public function testStaticChangedAt() : void { $dirPath = __DIR__ . '/test'; @@ -182,11 +146,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir($dirPath); } - /** - * @testdox A directory can be deleted - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be deleted')] public function testStaticDelete() : void { $dirPath = __DIR__ . '/test'; @@ -196,11 +157,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertFalse(Directory::exists($dirPath)); } - /** - * @testdox A none-existing directory cannot be deleted - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing directory cannot be deleted')] public function testInvalidStaticDelete() : void { $dirPath = __DIR__ . '/test'; @@ -208,66 +166,48 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertFalse(Directory::delete($dirPath)); } - /** - * @testdox The size of a directory can be returned - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The size of a directory can be returned')] public function testStaticSizeRecursive() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertGreaterThan(0, Directory::size($dirTestPath)); } - /** - * @testdox The size of a none-existing directory is negative - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The size of a none-existing directory is negative')] public function testInvalidStaticSizeRecursive() : void { $dirTestPath = __DIR__ . '/invalid/test/here'; self::assertEquals(-1, Directory::size($dirTestPath)); } - /** - * @testdox The recursive size of a directory is equals or greater than the size of the same directory none-recursive - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The recursive size of a directory is equals or greater than the size of the same directory none-recursive')] public function testStaticSize() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertGreaterThan(Directory::size($dirTestPath, false), Directory::size($dirTestPath)); } - /** - * @testdox The permission of a directory can be returned - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission of a directory can be returned')] public function testStaticPermission() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertGreaterThan(0, Directory::permission($dirTestPath)); } - /** - * @testdox The permission of a none-existing directory is negative - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission of a none-existing directory is negative')] public function testInvalidStaticPermission() : void { $dirTestPath = __DIR__ . '/invalid/test/here'; self::assertEquals(-1, Directory::permission($dirTestPath)); } - /** - * @testdox A directory can be copied recursively - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be copied recursively')] public function testStaticCopy() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -277,11 +217,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::delete(__DIR__ . '/newdirtest'); } - /** - * @testdox A directory can be forced to be copied to a different location even if the destination already exists - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be forced to be copied to a different location even if the destination already exists')] public function testStaticCopyOverwrite() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -293,11 +230,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::delete(__DIR__ . '/newdirtest'); } - /** - * @testdox By default a directory is not overwritten on copy - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('By default a directory is not overwritten on copy')] public function testStaticInvalidCopyOverwrite() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -307,11 +241,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::delete(__DIR__ . '/newdirtest'); } - /** - * @testdox A directory can be moved/renamed to a different path - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be moved/renamed to a different path')] public function testStaticMove() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -323,11 +254,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir(__DIR__ . '/parent'); } - /** - * @testdox By default a directory is not overwritten on move - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('By default a directory is not overwritten on move')] public function testStaticInvalidMoveOverwrite() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -338,11 +266,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::move(__DIR__ . '/newdirtest', $dirTestPath); } - /** - * @testdox A directory can be forced to be moved/renamed to a different path even if the destination already exists - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be forced to be moved/renamed to a different path even if the destination already exists')] public function testStaticMoveOverwrite() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -356,44 +281,32 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::move(__DIR__ . '/newdirtest', $dirTestPath); } - /** - * @testdox The amount of files in a directory can be returned recursively - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The amount of files in a directory can be returned recursively')] public function testStaticCountRecursive() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertEquals(4, Directory::count($dirTestPath)); } - /** - * @testdox The amount of files in a directory can be returned none-recursively - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The amount of files in a directory can be returned none-recursively')] public function testStaticCount() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertEquals(1, Directory::count($dirTestPath, false)); } - /** - * @testdox The amount of files of a none-existing directory is negative - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The amount of files of a none-existing directory is negative')] public function testInvalidStaticCount() : void { $dirTestPath = __DIR__ . '/invalid/path/here'; self::assertEquals(-1, Directory::count($dirTestPath, false)); } - /** - * @testdox All files and sub-directories of a directory can be listed - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All files and sub-directories of a directory can be listed')] public function testStaticListFiles() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -403,83 +316,59 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertCount(2, Directory::list($dirTestPath, '*', false)); } - /** - * @testdox All files of a directory can be listed by file extension - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All files of a directory can be listed by file extension')] public function testStaticListFilesByExtension() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertCount(3, Directory::listByExtension($dirTestPath, 'txt')); } - /** - * @testdox The owner of a directory can be returned - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The owner of a directory can be returned')] public function testStaticOwner() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertNotEmpty(Directory::owner($dirTestPath)); } - /** - * @testdox Invalid directory names and paths can be sanitized - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid directory names and paths can be sanitized')] public function testDirectoryNameSanitizing() : void { self::assertEquals(':/some/test/[path', Directory::sanitize(':#&^$/some%/test/[path!')); } - /** - * @testdox A none-existing directory returns a empty list of files and sub-directories - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing directory returns a empty list of files and sub-directories')] public function testInvalidListPath() : void { self::assertEquals([], Directory::list(__DIR__ . '/invalid/path/here')); } - /** - * @testdox A none-existing directory returns a empty list of files for the extension - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing directory returns a empty list of files for the extension')] public function testInvalidListFilesByExtension() : void { self::assertEquals([], Directory::listByExtension(__DIR__ . '/invalid/path/here', 'txt')); } - /** - * @testdox A invalid directory cannot be copied to a new destination - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid directory cannot be copied to a new destination')] public function testInvalidCopyPath() : void { self::assertFalse(Directory::copy(__DIR__ . '/invalid', __DIR__ . '/invalid2')); } - /** - * @testdox A invalid directory cannot be moved to a new destination - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid directory cannot be moved to a new destination')] public function testInvalidMovePath() : void { self::assertFalse(Directory::move(__DIR__ . '/invalid', __DIR__ . '/invalid2')); } - /** - * @testdox Reading the creation date of a none-existing directory throws a PathException - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the creation date of a none-existing directory throws a PathException')] public function testInvalidCreatedPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -487,11 +376,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::created(__DIR__ . '/invalid'); } - /** - * @testdox Reading the last change date of a none-existing directory throws a PathException - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the last change date of a none-existing directory throws a PathException')] public function testInvalidChangedPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -499,11 +385,8 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::changed(__DIR__ . '/invalid'); } - /** - * @testdox Reading the owner of a none-existing directory throws a PathException - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the owner of a none-existing directory throws a PathException')] public function testInvalidOwnerPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -511,10 +394,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase Directory::owner(__DIR__ . '/invalid'); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testList() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -526,10 +406,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase ], $dir->getList()); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeOutput() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -538,10 +415,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf(Directory::class, $dir->getNode('sub')); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeCreate() : void { $dir = new Directory(__DIR__); @@ -557,10 +431,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir(__DIR__ . '/nodedir2'); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeDelete() : void { $dir = new Directory(__DIR__); @@ -571,10 +442,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertFalse(\is_dir(__DIR__ . '/nodedir')); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeCopy() : void { $dir = new Directory(__DIR__); @@ -587,10 +455,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir(__DIR__ . '/nodedir2'); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeMove() : void { $dir = new Directory(__DIR__); @@ -603,10 +468,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir(__DIR__ . '/nodedir2'); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeExists() : void { $dir = new Directory(__DIR__); @@ -616,10 +478,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertFalse($dir->isExisting('invalid')); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testParentOutput() : void { $dir = new Directory(__DIR__ . '/dirtest'); @@ -627,10 +486,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals(__DIR__, $dir->getParent()->getPath()); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeNext() : void { $dir = new Directory(__DIR__ . '/dirtest'); @@ -639,10 +495,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals(__DIR__ . '/dirtest/test.txt', $dir->current()->getPath()); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeCurrent() : void { $dir = new Directory(__DIR__ . '/dirtest'); @@ -650,10 +503,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals(__DIR__ . '/dirtest/sub', $dir->current()->getPath()); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeKey() : void { $dir = new Directory(__DIR__ . '/dirtest'); @@ -664,10 +514,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('test.txt', $dir->key()); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeArrayRead() : void { $dir = new Directory(__DIR__ . '/dirtest'); @@ -675,10 +522,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', $dir['test.txt']->getName()); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeArraySet() : void { $dir = new Directory(__DIR__); @@ -693,10 +537,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir(__DIR__ . '/nodedir'); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeArrayRemove() : void { $dir = new Directory(__DIR__); @@ -707,10 +548,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertFalse(\is_dir(__DIR__ . '/nodedir')); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeArrayExists() : void { $dir = new Directory(__DIR__); @@ -719,10 +557,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertFalse(isset($dir['invalid'])); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeCreatedAt() : void { $dirPath = __DIR__ . '/test'; @@ -736,10 +571,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir($dirPath); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeChangedAt() : void { $dirPath = __DIR__ . '/test'; @@ -753,10 +585,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase \rmdir($dirPath); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeOwner() : void { $dir = new Directory(__DIR__ . '/dirtest'); @@ -764,10 +593,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertNotEmpty($dir->getOwner()); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodePermission() : void { $dir = new Directory(__DIR__ . '/dirtest'); @@ -775,10 +601,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertGreaterThan(0, $dir->getPermission()); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDirname() : void { $dir = new Directory(__DIR__ . '/dirtest'); @@ -787,10 +610,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('dirtest', $dir->current()->getDirName()); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testName() : void { $dir = new Directory(__DIR__ . '/dirtest'); @@ -799,10 +619,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', $dir->current()->getName()); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testBaseame() : void { $dir = new Directory(__DIR__ . '/dirtest'); @@ -811,10 +628,7 @@ final class DirectoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('test.txt', $dir->current()->getBasename()); } - /** - * @covers phpOMS\System\File\Local\Directory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDirpath() : void { $dir = new Directory(__DIR__ . '/dirtest'); diff --git a/tests/System/File/Local/FileTest.php b/tests/System/File/Local/FileTest.php index 47a0b6c23..137edb5e9 100755 --- a/tests/System/File/Local/FileTest.php +++ b/tests/System/File/Local/FileTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,17 +18,14 @@ use phpOMS\System\File\ContentPutMode; use phpOMS\System\File\Local\File; /** - * @testdox phpOMS\tests\System\File\Local\FileTest: File handler for local file system - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\System\File\Local\File::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\System\File\Local\FileTest: File handler for local file system')] final class FileTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A file without content can be created - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file without content can be created')] public function testStaticCreate() : void { $testFile = __DIR__ . '/path/test.txt'; @@ -48,11 +45,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase \rmdir(__DIR__ . '/path'); } - /** - * @testdox A file cannot be created if it already exists - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file cannot be created if it already exists')] public function testInvalidStaticCreate() : void { $testFile = __DIR__ . '/test.txt'; @@ -67,11 +61,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file with content can be created - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file with content can be created')] public function testStaticPut() : void { $testFile = __DIR__ . '/path/test.txt'; @@ -91,11 +82,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase \rmdir(__DIR__ . '/path'); } - /** - * @testdox A file cannot be replaced if it doesn't exists - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A file cannot be replaced if it doesn't exists")] public function testInvalidStaticCreateReplace() : void { $testFile = __DIR__ . '/test.txt'; @@ -107,11 +95,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertfalse(\is_file($testFile)); } - /** - * @testdox A file cannot be appended if it doesn't exists - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A file cannot be appended if it doesn't exists")] public function testInvalidStaticCreateAppend() : void { $testFile = __DIR__ . '/test.txt'; @@ -123,11 +108,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertfalse(\is_file($testFile)); } - /** - * @testdox A file cannot be prepended if it doesn't exists - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A file cannot be prepended if it doesn't exists")] public function testInvalidStaticCreatePrepend() : void { $testFile = __DIR__ . '/test.txt'; @@ -139,22 +121,16 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertfalse(\is_file($testFile)); } - /** - * @testdox A file can be checked for existence - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be checked for existence')] public function testStaticExists() : void { self::assertTrue(File::exists(__DIR__ . '/FileTest.php')); self::assertFalse(File::exists(__DIR__ . '/invalid/file.txt')); } - /** - * @testdox A file can be replaced with a new one - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be replaced with a new one')] public function testStaticReplace() : void { $testFile = __DIR__ . '/test.txt'; @@ -170,11 +146,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The set alias works like the replace flag - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The set alias works like the replace flag')] public function testStaticSetAlias() : void { $testFile = __DIR__ . '/test.txt'; @@ -190,11 +163,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file can be appended with additional content - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be appended with additional content')] public function testStaticAppend() : void { $testFile = __DIR__ . '/test.txt'; @@ -210,11 +180,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The append alias works like the append flag - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The append alias works like the append flag')] public function testStaticAppendAlias() : void { $testFile = __DIR__ . '/test.txt'; @@ -230,11 +197,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file can be prepended with additional content - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be prepended with additional content')] public function testStaticPrepend() : void { $testFile = __DIR__ . '/test.txt'; @@ -250,11 +214,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The prepend alias works like the prepend flag - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The prepend alias works like the prepend flag')] public function testStaticPrependAlias() : void { $testFile = __DIR__ . '/test.txt'; @@ -270,11 +231,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The content of a file can be read - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The content of a file can be read')] public function testStaticGet() : void { $testFile = __DIR__ . '/test.txt'; @@ -288,11 +246,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The parent directory of a file can be returned - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The parent directory of a file can be returned')] public function testStaticParent() : void { $testFile = __DIR__ . '/test.txt'; @@ -300,11 +255,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals(\strtr(\realpath(__DIR__ . '/../'), '\\', '/'), File::parent($testFile)); } - /** - * @testdox The extension of a file can be returned - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The extension of a file can be returned')] public function testStaticExtension() : void { $testFile = __DIR__ . '/test.txt'; @@ -312,11 +264,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals('txt', File::extension($testFile)); } - /** - * @testdox The name of a file can be returned - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The name of a file can be returned')] public function testStaticName() : void { $testFile = __DIR__ . '/test.txt'; @@ -324,11 +273,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', File::name($testFile)); } - /** - * @testdox The basename of a file can be returned - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The basename of a file can be returned')] public function testStaticBaseName() : void { $testFile = __DIR__ . '/test.txt'; @@ -336,11 +282,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals('test.txt', File::basename($testFile)); } - /** - * @testdox The file name of a file can be returned - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The file name of a file can be returned')] public function testStaticDirname() : void { $testFile = __DIR__ . '/test.txt'; @@ -348,11 +291,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals(\basename(\realpath(__DIR__)), File::dirname($testFile)); } - /** - * @testdox The file path of a file can be returned - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The file path of a file can be returned')] public function testStaticDirectoryPath() : void { $testFile = __DIR__ . '/test.txt'; @@ -360,11 +300,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals(\realpath(__DIR__), File::dirpath($testFile)); } - /** - * @testdox The count of a file is always 1 - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The count of a file is always 1')] public function testStaticCount() : void { $testFile = __DIR__ . '/test.txt'; @@ -372,11 +309,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals(1, File::count($testFile)); } - /** - * @testdox The directories creation date can be returned - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The directories creation date can be returned')] public function testStaticCreatedAt() : void { $testFile = __DIR__ . '/test.txt'; @@ -388,11 +322,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The directories last change date can be returned - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The directories last change date can be returned')] public function testStaticChangedAt() : void { $testFile = __DIR__ . '/test.txt'; @@ -404,11 +335,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file can be deleted - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be deleted')] public function testStaticDelete() : void { $testFile = __DIR__ . '/test.txt'; @@ -418,11 +346,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertFalse(File::exists($testFile)); } - /** - * @testdox A none-existing file cannot be deleted - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing file cannot be deleted')] public function testInvalidStaticDelete() : void { $testFile = __DIR__ . '/test.txt'; @@ -430,11 +355,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertFalse(File::delete($testFile)); } - /** - * @testdox The size of a file can be returned - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The size of a file can be returned')] public function testStaticSize() : void { $testFile = __DIR__ . '/test.txt'; @@ -449,11 +371,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The permission of a file can be returned - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission of a file can be returned')] public function testStaticPermission() : void { $testFile = __DIR__ . '/test.txt'; @@ -468,21 +387,15 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The permission of a none-existing file is negative - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission of a none-existing file is negative')] public function testInvalidStaticPermission() : void { $testFile = __DIR__ . '/test.txt'; self::assertEquals(-1, File::permission($testFile)); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testPathInfo() : void { $testFile = __DIR__ . '/test.txt'; @@ -496,11 +409,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A file can be copied to a different location - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be copied to a different location')] public function testStaticCopy() : void { $testFile = __DIR__ . '/test.txt'; @@ -523,11 +433,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file cannot be copied to a different location if the destination already exists - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file cannot be copied to a different location if the destination already exists')] public function testInvalidStaticCopy() : void { $testFile = __DIR__ . '/test.txt'; @@ -550,11 +457,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file can be forced to be copied to a different location even if the destination already exists - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be forced to be copied to a different location even if the destination already exists')] public function testStaticCopyOverwrite() : void { $testFile = __DIR__ . '/test.txt'; @@ -577,11 +481,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file can be moved to a different location - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be moved to a different location')] public function testStaticMove() : void { $testFile = __DIR__ . '/test.txt'; @@ -603,11 +504,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase \rmdir(__DIR__ . '/sub/'); } - /** - * @testdox A file cannot be moved to a different location if the destination already exists - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file cannot be moved to a different location if the destination already exists')] public function testInvalidStaticMove() : void { $testFile = __DIR__ . '/test.txt'; @@ -628,11 +526,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file can be forced to be moved to a different location even if the destination already exists - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be forced to be moved to a different location even if the destination already exists')] public function testStaticMoveOverwrite() : void { $testFile = __DIR__ . '/test.txt'; @@ -652,60 +547,42 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($newPath); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testStaticOwner() : void { $dirTestPath = __DIR__ . '/dirtest/test.txt'; self::assertNotEmpty(File::owner($dirTestPath)); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testFileNameSanitizing() : void { self::assertEquals('/some/test/[path.txt', File::sanitize(':#&^$/some%/test/[path!.txt')); } - /** - * @testdox The size of a none-existing file is negative - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The size of a none-existing file is negative')] public function testInvalidSizePath() : void { self::assertEquals(-1, File::size(__DIR__ . '/invalid.txt')); } - /** - * @testdox A none-existing file cannot be copied - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing file cannot be copied')] public function testInvalidCopyPath() : void { self::assertFalse(File::copy(__DIR__ . '/invalid.txt', __DIR__ . '/invalid2.txt')); } - /** - * @testdox A none-existing file cannot be moved - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing file cannot be moved')] public function testInvalidMovePath() : void { self::assertFalse(File::move(__DIR__ . '/invalid.txt', __DIR__ . '/invalid2.txt')); } - /** - * @testdox Reading the content of a none-existing file throws a PathException - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the content of a none-existing file throws a PathException')] public function testInvalidGetPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -713,11 +590,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::get(__DIR__ . '/invalid.txt'); } - /** - * @testdox Reading the created date of a none-existing file throws a PathException - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the created date of a none-existing file throws a PathException')] public function testInvalidCreatedPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -725,11 +599,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::created(__DIR__ . '/invalid.txt'); } - /** - * @testdox Reading the last change date of a none-existing file throws a PathException - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the last change date of a none-existing file throws a PathException')] public function testInvalidChangedPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -737,11 +608,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::changed(__DIR__ . '/invalid.txt'); } - /** - * @testdox Reading the owner of a none-existing file throws a PathException - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the owner of a none-existing file throws a PathException')] public function testInvalidOwnerPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -749,10 +617,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase File::owner(__DIR__ . '/invalid.txt'); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeInputOutput() : void { $testFile = __DIR__ . '/test.txt'; @@ -767,10 +632,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeReplace() : void { $testFile = __DIR__ . '/test.txt'; @@ -786,10 +648,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeAppend() : void { $testFile = __DIR__ . '/test.txt'; @@ -805,10 +664,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodePrepend() : void { $testFile = __DIR__ . '/test.txt'; @@ -824,10 +680,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeExtension() : void { $testFile = __DIR__ . '/test.txt'; @@ -836,10 +689,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals('txt', $file->getExtension()); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeCreatedAt() : void { $testFile = __DIR__ . '/test.txt'; @@ -857,10 +707,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeChangedAt() : void { $testFile = __DIR__ . '/test.txt'; @@ -878,10 +725,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeOwner() : void { $testFile = __DIR__ . '/dirtest/test.txt'; @@ -890,10 +734,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertNotEmpty($file->getOwner()); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodePermission() : void { $testFile = __DIR__ . '/dirtest/test.txt'; @@ -902,10 +743,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertGreaterThan(0, $file->getPermission()); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDirname() : void { $testFile = __DIR__ . '/dirtest/test.txt'; @@ -914,10 +752,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals('dirtest', $file->getDirname()); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testName() : void { $testFile = __DIR__ . '/dirtest/test.txt'; @@ -926,10 +761,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', $file->getName()); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testBaseame() : void { $testFile = __DIR__ . '/dirtest/test.txt'; @@ -938,10 +770,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals('test.txt', $file->getBasename()); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testDirpath() : void { $testFile = __DIR__ . '/dirtest/test.txt'; @@ -950,10 +779,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals(__DIR__ . '/dirtest', $file->getDirPath()); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testParentOutput() : void { $testFile = __DIR__ . '/dirtest/test.txt'; @@ -962,10 +788,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals(__DIR__ . '/dirtest', $file->getDirPath()); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeCreate() : void { $testFile = __DIR__ . '/test.txt'; @@ -981,10 +804,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeDelete() : void { $testFile = __DIR__ . '/test.txt'; @@ -1000,10 +820,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertFalse(\is_file($testFile)); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeCopy() : void { $testFile = __DIR__ . '/test.txt'; @@ -1022,10 +839,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink(__DIR__ . '/test2.txt'); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeMove() : void { $testFile = __DIR__ . '/test.txt'; @@ -1043,10 +857,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase \unlink(__DIR__ . '/test2.txt'); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeExists() : void { $file = new File(__DIR__ . '/dirtest/test.txt'); @@ -1056,10 +867,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertFalse($file2->isExisting()); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeParent() : void { $file = new File(__DIR__ . '/dirtest/test.txt'); @@ -1067,10 +875,7 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals('Local', $file->getParent()->getName()); } - /** - * @covers phpOMS\System\File\Local\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testNodeDirectory() : void { $file = new File(__DIR__ . '/dirtest/test.txt'); diff --git a/tests/System/File/Local/LocalStorageTest.php b/tests/System/File/Local/LocalStorageTest.php index eddd691a3..854fc18fe 100755 --- a/tests/System/File/Local/LocalStorageTest.php +++ b/tests/System/File/Local/LocalStorageTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,17 +18,14 @@ use phpOMS\System\File\ContentPutMode; use phpOMS\System\File\Local\LocalStorage; /** - * @testdox phpOMS\tests\System\File\Local\LocalStorageTest: Directory & File handler for local file system - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\System\File\Local\LocalStorage::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\System\File\Local\LocalStorageTest: Directory & File handler for local file system')] final class LocalStorageTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A directory can be created - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be created')] public function testStaticCreateDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -38,22 +35,16 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \rmdir($dirPath); } - /** - * @testdox A directory can be checked for existence - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be checked for existence')] public function testStaticExistsDirectory() : void { self::assertTrue(LocalStorage::exists(__DIR__)); self::assertFalse(LocalStorage::exists(__DIR__ . '/invalid/path/here')); } - /** - * @testdox An existing directory cannot be overwritten - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An existing directory cannot be overwritten')] public function testInvalidStaticOverwriteDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -63,11 +54,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \rmdir($dirPath); } - /** - * @testdox A directory can be forced to be created recursively - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be forced to be created recursively')] public function testStaticSubdirDirectory() : void { $dirPath = __DIR__ . '/test/sub/path'; @@ -79,11 +67,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \rmdir(__DIR__ . '/test'); } - /** - * @testdox The name of a directory is just its name without its path - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The name of a directory is just its name without its path')] public function testStaticNameDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -91,11 +76,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', LocalStorage::name($dirPath)); } - /** - * @testdox The basename is the same as the name of the directory - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The basename is the same as the name of the directory')] public function testStaticBasenameDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -103,11 +85,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', LocalStorage::basename($dirPath)); } - /** - * @testdox The dirname is the same as the name of the directory - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The dirname is the same as the name of the directory')] public function testStaticDirnameDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -115,11 +94,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', LocalStorage::dirname($dirPath)); } - /** - * @testdox The parent of a directory can be returned - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The parent of a directory can be returned')] public function testStaticParentDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -127,11 +103,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals(\strtr(\realpath(__DIR__), '\\', '/'), LocalStorage::parent($dirPath)); } - /** - * @testdox The full absolute path of a directory can be returned - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The full absolute path of a directory can be returned')] public function testStaticDirectoryPathDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -139,11 +112,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals($dirPath, LocalStorage::dirpath($dirPath)); } - /** - * @testdox The directories creation date can be returned - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The directories creation date can be returned')] public function testStaticCreatedAtDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -156,11 +126,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \rmdir($dirPath); } - /** - * @testdox The directories last change date can be returned - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The directories last change date can be returned')] public function testStaticChangedAtDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -173,11 +140,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \rmdir($dirPath); } - /** - * @testdox A directory can be deleted - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be deleted')] public function testStaticDeleteDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -187,11 +151,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertFalse(LocalStorage::exists($dirPath)); } - /** - * @testdox A none-existing directory cannot be deleted - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing directory cannot be deleted')] public function testInvalidStaticDeleteDirectory() : void { $dirPath = __DIR__ . '/test'; @@ -199,66 +160,48 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertFalse(LocalStorage::delete($dirPath)); } - /** - * @testdox The size of a directory can be returned - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The size of a directory can be returned')] public function testStaticSizeRecursiveDirectory() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertGreaterThan(0, LocalStorage::size($dirTestPath)); } - /** - * @testdox The size of a none-existing directory is negative - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The size of a none-existing directory is negative')] public function testInvalidStaticSizeRecursiveDirectory() : void { $dirTestPath = __DIR__ . '/invalid/test/here'; self::assertEquals(-1, LocalStorage::size($dirTestPath)); } - /** - * @testdox The recursive size of a directory is equals or greater than the size of the same directory none-recursive - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The recursive size of a directory is equals or greater than the size of the same directory none-recursive')] public function testStaticSizeDirectory() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertGreaterThan(LocalStorage::size($dirTestPath, false), LocalStorage::size($dirTestPath)); } - /** - * @testdox The permission of a directory can be returned - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission of a directory can be returned')] public function testStaticPermissionDirectory() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertGreaterThan(0, LocalStorage::permission($dirTestPath)); } - /** - * @testdox The permission of a none-existing directory is negative - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission of a none-existing directory is negative')] public function testInvalidStaticPermissionDirectory() : void { $dirTestPath = __DIR__ . '/invalid/test/here'; self::assertEquals(-1, LocalStorage::permission($dirTestPath)); } - /** - * @testdox A directory can be copied recursively - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be copied recursively')] public function testStaticCopyDirectory() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -268,11 +211,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase LocalStorage::delete(__DIR__ . '/newdirtest'); } - /** - * @testdox A directory can be moved/renamed to a different path - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A directory can be moved/renamed to a different path')] public function testStaticMoveDirectory() : void { $dirTestPath = __DIR__ . '/dirtest'; @@ -283,85 +223,61 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase LocalStorage::move(__DIR__ . '/newdirtest', $dirTestPath); } - /** - * @testdox The amount of files in a directory can be returned recursively - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The amount of files in a directory can be returned recursively')] public function testStaticCountRecursiveDirectory() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertEquals(4, LocalStorage::count($dirTestPath)); } - /** - * @testdox The amount of files in a directory can be returned none-recursively - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The amount of files in a directory can be returned none-recursively')] public function testStaticCountDirectory() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertEquals(1, LocalStorage::count($dirTestPath, false)); } - /** - * @testdox The amount of files of a none-existing directory is negative - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The amount of files of a none-existing directory is negative')] public function testInvalidStaticCountDirectory() : void { $dirTestPath = __DIR__ . '/invalid/path/here'; self::assertEquals(-1, LocalStorage::count($dirTestPath, false)); } - /** - * @testdox All files and sub-directories of a directory can be listed - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All files and sub-directories of a directory can be listed')] public function testStaticListFilesDirectory() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertCount(6, LocalStorage::list($dirTestPath, '*', true)); } - /** - * @testdox A none-existing directory returns a empty list of files and sub-directories - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing directory returns a empty list of files and sub-directories')] public function testInvalidListPathDirectory() : void { self::assertEquals([], LocalStorage::list(__DIR__ . '/invalid/path/here')); } - /** - * @testdox A invalid directory cannot be copied to a new destination - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid directory cannot be copied to a new destination')] public function testInvalidCopyPathDirectory() : void { self::assertFalse(LocalStorage::copy(__DIR__ . '/invalid', __DIR__ . '/invalid2')); } - /** - * @testdox A invalid directory cannot be moved to a new destination - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid directory cannot be moved to a new destination')] public function testInvalidMovePathDirectory() : void { self::assertFalse(LocalStorage::move(__DIR__ . '/invalid', __DIR__ . '/invalid2')); } - /** - * @testdox Reading the creation date of a none-existing directory throws a PathException - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the creation date of a none-existing directory throws a PathException')] public function testInvalidCreatedPathDirectory() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -369,11 +285,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase LocalStorage::created(__DIR__ . '/invalid'); } - /** - * @testdox Reading the last change date of a none-existing directory throws a PathException - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the last change date of a none-existing directory throws a PathException')] public function testInvalidChangedPathDirectory() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -381,11 +294,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase LocalStorage::changed(__DIR__ . '/invalid'); } - /** - * @testdox Reading the owner of a none-existing directory throws a PathException - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the owner of a none-existing directory throws a PathException')] public function testInvalidOwnerPathDirectory() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -393,11 +303,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase LocalStorage::owner(__DIR__ . '/invalid'); } - /** - * @testdox A file without content can be created - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file without content can be created')] public function testStaticCreateFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -408,11 +315,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file cannot be created if it already exists - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file cannot be created if it already exists')] public function testInvalidStaticCreateFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -423,11 +327,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file with content can be created - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file with content can be created')] public function testStaticPutFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -438,11 +339,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file cannot be replaced if it doesn't exists - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A file cannot be replaced if it doesn't exists")] public function testInvalidStaticCreateReplaceFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -450,11 +348,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertfalse(\is_file($testFile)); } - /** - * @testdox A file cannot be appended if it doesn't exists - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A file cannot be appended if it doesn't exists")] public function testInvalidStaticCreateAppendFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -462,11 +357,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertfalse(\is_file($testFile)); } - /** - * @testdox A file cannot be prepended if it doesn't exists - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A file cannot be prepended if it doesn't exists")] public function testInvalidStaticCreatePrependFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -474,22 +366,16 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertfalse(\is_file($testFile)); } - /** - * @testdox A file can be checked for existence - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be checked for existence')] public function testStaticExistsFile() : void { self::assertTrue(LocalStorage::exists(__DIR__ . '/FileTest.php')); self::assertFalse(LocalStorage::exists(__DIR__ . '/invalid/file.txt')); } - /** - * @testdox A file can be replaced with a new one - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be replaced with a new one')] public function testStaticReplaceFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -501,11 +387,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The set alias works like the replace flag - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The set alias works like the replace flag')] public function testStaticSetAliasFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -517,11 +400,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file can be appended with additional content - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be appended with additional content')] public function testStaticAppendFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -533,11 +413,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The append alias works like the append flag - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The append alias works like the append flag')] public function testStaticAppendAliasFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -549,11 +426,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file can be prepended with additional content - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be prepended with additional content')] public function testStaticPrependFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -565,11 +439,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The prepend alias works like the prepend flag - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The prepend alias works like the prepend flag')] public function testStaticPrependAliasFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -581,11 +452,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The content of a file can be read - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The content of a file can be read')] public function testStaticGetFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -595,11 +463,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The parent directory of a file can be returned - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The parent directory of a file can be returned')] public function testStaticParentFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -607,11 +472,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals(\strtr(\realpath(__DIR__ . '/../'), '\\', '/'), LocalStorage::parent($testFile)); } - /** - * @testdox The extension of a file can be returned - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The extension of a file can be returned')] public function testStaticExtensionFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -619,11 +481,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals('txt', LocalStorage::extension($testFile)); } - /** - * @testdox The name of a file can be returned - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The name of a file can be returned')] public function testStaticNameFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -631,11 +490,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', LocalStorage::name($testFile)); } - /** - * @testdox The basename of a file can be returned - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The basename of a file can be returned')] public function testStaticBaseNameFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -643,11 +499,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals('test.txt', LocalStorage::basename($testFile)); } - /** - * @testdox The file name of a file can be returned - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The file name of a file can be returned')] public function testStaticDirnameFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -655,11 +508,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals(\basename(\realpath(__DIR__)), LocalStorage::dirname($testFile)); } - /** - * @testdox The file path of a file can be returned - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The file path of a file can be returned')] public function testStaticDirectoryPathFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -667,11 +517,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals(\realpath(__DIR__), LocalStorage::dirpath($testFile)); } - /** - * @testdox The count of a file is always 1 - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The count of a file is always 1')] public function testStaticCountFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -679,11 +526,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertEquals(1, LocalStorage::count($testFile)); } - /** - * @testdox The directories creation date can be returned - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The directories creation date can be returned')] public function testStaticCreatedAtFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -695,11 +539,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The directories last change date can be returned - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The directories last change date can be returned')] public function testStaticChangedAtFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -711,11 +552,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file can be deleted - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be deleted')] public function testStaticDeleteFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -725,11 +563,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertFalse(LocalStorage::exists($testFile)); } - /** - * @testdox A none-existing file cannot be deleted - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing file cannot be deleted')] public function testInvalidStaticDeleteFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -737,11 +572,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertFalse(LocalStorage::delete($testFile)); } - /** - * @testdox The size of a file can be returned - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The size of a file can be returned')] public function testStaticSizeFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -752,11 +584,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The permission of a file can be returned - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission of a file can be returned')] public function testStaticPermissionFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -767,22 +596,16 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox The permission of a none-existing file is negative - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The permission of a none-existing file is negative')] public function testInvalidStaticPermissionFile() : void { $testFile = __DIR__ . '/test.txt'; self::assertEquals(-1, LocalStorage::permission($testFile)); } - /** - * @testdox A file can be copied to a different location - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be copied to a different location')] public function testStaticCopyFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -801,11 +624,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file cannot be copied to a different location if the destination already exists - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file cannot be copied to a different location if the destination already exists')] public function testInvalidStaticCopyFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -821,11 +641,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file can be forced to be copied to a different location even if the destination already exists - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be forced to be copied to a different location even if the destination already exists')] public function testStaticCopyOverwriteFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -841,11 +658,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file can be moved to a different location - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be moved to a different location')] public function testStaticMoveFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -863,11 +677,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \rmdir(__DIR__ . '/sub/'); } - /** - * @testdox A file cannot be moved to a different location if the destination already exists - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file cannot be moved to a different location if the destination already exists')] public function testInvalidStaticMoveFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -884,11 +695,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($testFile); } - /** - * @testdox A file can be forced to be moved to a different location even if the destination already exists - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be forced to be moved to a different location even if the destination already exists')] public function testStaticMoveOverwriteFile() : void { $testFile = __DIR__ . '/test.txt'; @@ -904,50 +712,35 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase \unlink($newPath); } - /** - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSanitize() : void { self::assertEquals(':/some/test/[path', LocalStorage::sanitize(':#&^$/some%/test/[path!')); } - /** - * @testdox The size of a none-existing file is negative - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The size of a none-existing file is negative')] public function testInvalidSizePathFile() : void { self::assertEquals(-1, LocalStorage::size(__DIR__ . '/invalid.txt')); } - /** - * @testdox A none-existing file cannot be copied - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing file cannot be copied')] public function testInvalidCopyPathFile() : void { self::assertFalse(LocalStorage::copy(__DIR__ . '/invalid.txt', __DIR__ . '/invalid2.txt')); } - /** - * @testdox A none-existing file cannot be moved - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing file cannot be moved')] public function testInvalidMovePathFile() : void { self::assertFalse(LocalStorage::move(__DIR__ . '/invalid.txt', __DIR__ . '/invalid2.txt')); } - /** - * @testdox Reading the content of a none-existing file throws a PathException - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the content of a none-existing file throws a PathException')] public function testInvalidGetPathFile() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -955,11 +748,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase LocalStorage::get(__DIR__ . '/invalid.txt'); } - /** - * @testdox Reading the created date of a none-existing file throws a PathException - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the created date of a none-existing file throws a PathException')] public function testInvalidCreatedPathFile() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -967,11 +757,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase LocalStorage::created(__DIR__ . '/invalid.txt'); } - /** - * @testdox Reading the last change date of a none-existing file throws a PathException - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the last change date of a none-existing file throws a PathException')] public function testInvalidChangedPathFile() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -979,11 +766,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase LocalStorage::changed(__DIR__ . '/invalid.txt'); } - /** - * @testdox Reading the owner of a none-existing file throws a PathException - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the owner of a none-existing file throws a PathException')] public function testInvalidOwnerPathFile() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -991,11 +775,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase LocalStorage::owner(__DIR__ . '/invalid.txt'); } - /** - * @testdox Writing data to a destination which looks like a directory throws a PathException - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Writing data to a destination which looks like a directory throws a PathException')] public function testInvalidPutPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -1003,11 +784,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase LocalStorage::put(__DIR__, 'Test'); } - /** - * @testdox Reading data from a directory throws a PathException - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading data from a directory throws a PathException')] public function testInvalidGetPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -1015,11 +793,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase LocalStorage::get(__DIR__); } - /** - * @testdox Trying to run list on a file throws a PathException - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Trying to run list on a file throws a PathException')] public function testInvalidListPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -1027,11 +802,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase LocalStorage::list(__DIR__ . '/LocalStorageTest.php'); } - /** - * @testdox Setting data to a destination which looks like a directory throws a PathException - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Setting data to a destination which looks like a directory throws a PathException')] public function testInvalidSetPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -1039,11 +811,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase LocalStorage::set(__DIR__, 'Test'); } - /** - * @testdox Appending data to a destination which looks like a directory throws a PathException - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Appending data to a destination which looks like a directory throws a PathException')] public function testInvalidAppendPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -1051,11 +820,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase LocalStorage::append(__DIR__, 'Test'); } - /** - * @testdox Prepending data to a destination which looks like a directory throws a PathException - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Prepending data to a destination which looks like a directory throws a PathException')] public function testInvalidPrependPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); @@ -1063,11 +829,8 @@ final class LocalStorageTest extends \PHPUnit\Framework\TestCase LocalStorage::prepend(__DIR__, 'Test'); } - /** - * @testdox Reading the extension of a destination which looks like a directory throws a PathException - * @covers phpOMS\System\File\Local\LocalStorage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Reading the extension of a destination which looks like a directory throws a PathException')] public function testInvalidExtensionPath() : void { $this->expectException(\phpOMS\System\File\PathException::class); diff --git a/tests/System/File/PathExceptionTest.php b/tests/System/File/PathExceptionTest.php index 0bbc6e203..5292bc580 100755 --- a/tests/System/File/PathExceptionTest.php +++ b/tests/System/File/PathExceptionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\System\File\PathException; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\System\File\PathException::class)] final class PathExceptionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\System\File\PathException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testConstructor() : void { $e = new PathException('test.file'); diff --git a/tests/System/File/PermissionExceptionTest.php b/tests/System/File/PermissionExceptionTest.php index c4e27b819..32a9fb5fb 100755 --- a/tests/System/File/PermissionExceptionTest.php +++ b/tests/System/File/PermissionExceptionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\System\File\PermissionException; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\System\File\PermissionException::class)] final class PermissionExceptionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\System\File\PermissionException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testConstructor() : void { $e = new PermissionException('test.file'); diff --git a/tests/System/File/StorageTest.php b/tests/System/File/StorageTest.php index 8b8decfe7..322dab188 100755 --- a/tests/System/File/StorageTest.php +++ b/tests/System/File/StorageTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,38 +18,29 @@ use phpOMS\System\File\Local\LocalStorage; use phpOMS\System\File\Storage; /** - * @testdox phpOMS\tests\System\File\StorageTest: Storage handler for the different storage handler types - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\System\File\Storage::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\System\File\StorageTest: Storage handler for the different storage handler types')] final class StorageTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox By default the local storage handler is returned - * @covers phpOMS\System\File\Storage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('By default the local storage handler is returned')] public function testStorageDefault() : void { self::assertInstanceOf('\phpOMS\System\File\Local\LocalStorage', Storage::env()); } - /** - * @testdox The pre-defined storage handlers can be returned by their name - * @covers phpOMS\System\File\Storage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The pre-defined storage handlers can be returned by their name')] public function testStoragePreDefined() : void { self::assertInstanceOf('\phpOMS\System\File\Local\LocalStorage', Storage::env('local')); self::assertInstanceOf('\phpOMS\System\File\Ftp\FtpStorage', Storage::env('ftp')); } - /** - * @testdox Storages can be registered and returned - * @covers phpOMS\System\File\Storage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Storages can be registered and returned')] public function testInputOutput() : void { self::assertTrue(Storage::register('ftps', '\phpOMS\System\File\Ftp\FtpStorage')); @@ -58,22 +49,16 @@ final class StorageTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\phpOMS\System\File\Local\LocalStorage', Storage::env('test')); } - /** - * @testdox Registered storage handlers cannot be overwritten - * @covers phpOMS\System\File\Storage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Registered storage handlers cannot be overwritten')] public function testInvalidRegister() : void { self::assertTrue(Storage::register('test2', new LocalStorage())); self::assertFalse(Storage::register('test2', new LocalStorage())); } - /** - * @testdox A invalid or none-existing storage throws a Exception - * @covers phpOMS\System\File\Storage - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid or none-existing storage throws a Exception')] public function testInvalidStorage() : void { $this->expectException(\Exception::class); diff --git a/tests/System/MimeTypeTest.php b/tests/System/MimeTypeTest.php index c5cdab4da..1d3f9fe74 100755 --- a/tests/System/MimeTypeTest.php +++ b/tests/System/MimeTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,15 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\System\MimeType; /** - * @testdox phpOMS\tests\System\MimeTypeTest: MimeType * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\System\MimeType::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\System\MimeTypeTest: MimeType')] final class MimeTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The mime type enum vales have the correct format - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The mime type enum vales have the correct format')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { $enums = MimeType::getConstants(); @@ -42,21 +41,15 @@ final class MimeTypeTest extends \PHPUnit\Framework\TestCase self::assertTrue(true); } - /** - * @testdox The mime type enum vales can be retreived by extension - * @covers phpOMS\System\MimeType - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The mime type enum vales can be retreived by extension')] public function testExtensionToMime() : void { self::assertEquals('application/pdf', MimeType::extensionToMime('pdf')); } - /** - * @testdox A unknown extension returns application/octet-stream - * @covers phpOMS\System\MimeType - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A unknown extension returns application/octet-stream')] public function testInvalidExtensionToMime() : void { self::assertEquals('application/octet-stream', MimeType::extensionToMime('INVALID')); diff --git a/tests/System/OperatingSystemTest.php b/tests/System/OperatingSystemTest.php index 67a47950f..f8a7228be 100755 --- a/tests/System/OperatingSystemTest.php +++ b/tests/System/OperatingSystemTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,16 +20,14 @@ use phpOMS\System\OperatingSystem; use phpOMS\System\SystemType; /** - * @testdox phpOMS\tests\System\OperatingSystemTest: Operating system * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\System\OperatingSystem::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\System\OperatingSystemTest: Operating system')] final class OperatingSystemTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The current operating system can be returned - * @covers phpOMS\System\OperatingSystem - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The current operating system can be returned')] public function testSystem() : void { self::assertNotEquals(SystemType::UNKNOWN, OperatingSystem::getSystem()); diff --git a/tests/System/Search/StringSearchTest.php b/tests/System/Search/StringSearchTest.php index 58404ac25..65b59a28a 100755 --- a/tests/System/Search/StringSearchTest.php +++ b/tests/System/Search/StringSearchTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,61 +17,43 @@ namespace phpOMS\tests\System\Search; use phpOMS\System\Search\StringSearch; /** - * @testdox phpOMS\tests\System\Search\StringSearchTest: Search utilities - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\System\Search\StringSearch::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\System\Search\StringSearchTest: Search utilities')] final class StringSearchTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\System\Search\StringSearch - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testKnutMorrisPrattSearch() : void { self::assertEquals(15, StringSearch::knuthMorrisPrattSearch('ABCDABD', 'ABC ABCDAB ABCDABCDABDE')); } - /** - * @covers phpOMS\System\Search\StringSearch - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidKnutMorrisPrattSearch() : void { self::assertEquals(-1, StringSearch::knuthMorrisPrattSearch('ABCDABDZ', 'ABC ABCDAB ABCDABCDABDE')); } - /** - * @covers phpOMS\System\Search\StringSearch - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testBoyerMooreHorspoolSimpleSearch() : void { self::assertEquals(15, StringSearch::boyerMooreHorspoolSimpleSearch('ABCDABD', 'ABC ABCDAB ABCDABCDABDE')); } - /** - * @covers phpOMS\System\Search\StringSearch - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidBoyerMooreHorspoolSimpleSearch() : void { self::assertEquals(-1, StringSearch::boyerMooreHorspoolSimpleSearch('ABCDABDZ', 'ABC ABCDAB ABCDABCDABDE')); } - /** - * @covers phpOMS\System\Search\StringSearch - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testBoyerMooreHorspoolSearch() : void { self::assertEquals(15, StringSearch::boyerMooreHorspoolSearch('ABCDABD', 'ABC ABCDAB ABCDABCDABDE')); } - /** - * @covers phpOMS\System\Search\StringSearch - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidBoyerMooreHorspoolSearch() : void { self::assertEquals(-1, StringSearch::boyerMooreHorspoolSearch('ABCDABDZ', 'ABC ABCDAB ABCDABCDABDE')); diff --git a/tests/System/SystemTypeTest.php b/tests/System/SystemTypeTest.php index c5414c446..f11337502 100755 --- a/tests/System/SystemTypeTest.php +++ b/tests/System/SystemTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,36 +19,30 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\System\SystemType; /** - * @testdox phpOMS\tests\System\SystemTypeTest: System type * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\System\SystemTypeTest: System type')] final class SystemTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The system type enum has the correct amount of values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The system type enum has the correct amount of values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(4, SystemType::getConstants()); } - /** - * @testdox The system type enum has only unique values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The system type enum has only unique values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(SystemType::getConstants(), \array_unique(SystemType::getConstants())); } - /** - * @testdox The system type enum has the correct values - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The system type enum has the correct values')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(1, SystemType::UNKNOWN); diff --git a/tests/System/SystemUtilsTest.php b/tests/System/SystemUtilsTest.php index 61750bee2..846662cce 100755 --- a/tests/System/SystemUtilsTest.php +++ b/tests/System/SystemUtilsTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,35 +19,21 @@ use phpOMS\System\SystemUtils; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\System\SystemUtilsTest: System information - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\System\SystemUtils::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\System\SystemUtilsTest: System information')] final class SystemUtilsTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Test if it is possible to get information about the available RAM and usage - * @covers phpOMS\System\SystemUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Test if it is possible to get information about the available RAM and usage')] public function testRAM() : void { - self::assertGreaterThan(0, SystemUtils::getRAM()); - - if (\stristr(\PHP_OS, 'WIN')) { - self::assertEquals(0, SystemUtils::getRAMUsage()); - } - - if (!\stristr(\PHP_OS, 'WIN')) { - self::assertGreaterThan(0, SystemUtils::getRAMUsage()); - } + self::assertTrue(SystemUtils::getRAM() >= 0); } - /** - * @testdox Test if it is possible to get information about the CPU usage - * @covers phpOMS\System\SystemUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Test if it is possible to get information about the CPU usage')] public function testCPUUsage() : void { self::assertGreaterThan(0, SystemUtils::getCpuUsage()); diff --git a/tests/TestLoad.php b/tests/TestLoad.php index 8ceecc1e6..6a1be9f78 100755 --- a/tests/TestLoad.php +++ b/tests/TestLoad.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package Tests\PHPUnit * @copyright Dennis Eichhorn diff --git a/tests/TestLoad2.php b/tests/TestLoad2.php index 88ed62bec..85e44da13 100755 --- a/tests/TestLoad2.php +++ b/tests/TestLoad2.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package Tests\PHPUnit * @copyright Dennis Eichhorn diff --git a/tests/TestLoad3.php b/tests/TestLoad3.php index 154cab9a3..98c108846 100755 --- a/tests/TestLoad3.php +++ b/tests/TestLoad3.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package Tests\PHPUnit * @copyright Dennis Eichhorn diff --git a/tests/TestLoad4.php b/tests/TestLoad4.php index 882072e28..932b5b859 100755 --- a/tests/TestLoad4.php +++ b/tests/TestLoad4.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package Tests\PHPUnit * @copyright Dennis Eichhorn diff --git a/tests/UnhandledHandlerTest.php b/tests/UnhandledHandlerTest.php deleted file mode 100755 index b8341ae72..000000000 --- a/tests/UnhandledHandlerTest.php +++ /dev/null @@ -1,39 +0,0 @@ -getBase()); } - /** - * @testdox The path can be parsed correctly from a uri - * @covers phpOMS\Uri\Argument - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The path can be parsed correctly from a uri')] public function testParsePathInputOutput() : void { $obj = new Argument(':modules/admin/test/path.php ?para1=abc ?para2=2 #frag'); @@ -77,11 +68,8 @@ final class ArgumentTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The path can be set and returned - * @covers phpOMS\Uri\Argument - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The path can be set and returned')] public function testPathInputOutput() : void { $obj = new Argument(':modules/admin/test/path.php ?para1=abc ?para2=2 #frag'); @@ -90,11 +78,8 @@ final class ArgumentTest extends \PHPUnit\Framework\TestCase self::assertEquals('modules/admin/new/path', $obj->getPath()); } - /** - * @testdox The path offset can be set and returned - * @covers phpOMS\Uri\Argument - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The path offset can be set and returned')] public function testPathOffsetInputOutput() : void { $obj = new Argument(); @@ -103,11 +88,8 @@ final class ArgumentTest extends \PHPUnit\Framework\TestCase self::assertEquals(2, $obj->getPathOffset()); } - /** - * @testdox The route can be parsed correctly from a uri - * @covers phpOMS\Uri\Argument - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The route can be parsed correctly from a uri')] public function testRouteInputOutput() : void { $obj = new Argument(':modules/admin/test/path.php ?para1=abc ?para2=2 #frag'); @@ -115,11 +97,8 @@ final class ArgumentTest extends \PHPUnit\Framework\TestCase self::assertEquals('/:modules/admin/test/path.php ?para1=abc ?para2=2 #frag', $obj->getRoute()); } - /** - * @testdox The query data can be parsed correctly from a uri - * @covers phpOMS\Uri\Argument - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The query data can be parsed correctly from a uri')] public function testQueryInputOutput() : void { $obj = new Argument(':modules/admin/test/path.php ?para1=abc ?para2=2 #frag'); @@ -129,11 +108,8 @@ final class ArgumentTest extends \PHPUnit\Framework\TestCase self::assertEquals('?para2=2', $obj->getQuery('1')); } - /** - * @testdox The fragment can be parsed correctly from a uri - * @covers phpOMS\Uri\Argument - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The fragment can be parsed correctly from a uri')] public function testFragmentInputOutput() : void { $obj = new Argument(':modules/admin/test/path.php ?para1=abc ?para2=2 #frag'); @@ -144,11 +120,8 @@ final class ArgumentTest extends \PHPUnit\Framework\TestCase self::assertEquals('frag2', $obj->fragment); } - /** - * @testdox The uri can be turned into a string - * @covers phpOMS\Uri\Argument - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The uri can be turned into a string')] public function testStringify() : void { $obj = new Argument($uri = ':modules/admin/test/path.php ?para1=abc ?para2=2 #frag'); @@ -156,11 +129,8 @@ final class ArgumentTest extends \PHPUnit\Framework\TestCase self::assertEquals($uri, $obj->__toString()); } - /** - * @testdox The root path can be set and returned - * @covers phpOMS\Uri\Argument - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The root path can be set and returned')] public function testRootPathInputOutput() : void { $obj = new Argument(':modules/admin/test/path.php ?para1=abc ?para2=2 #frag'); diff --git a/tests/Uri/HttpUriTest.php b/tests/Uri/HttpUriTest.php index 0e8e604cf..cbfb6ff42 100755 --- a/tests/Uri/HttpUriTest.php +++ b/tests/Uri/HttpUriTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Uri\HttpUri; /** - * @testdox phpOMS\tests\Uri\HttpUriTest: Http uri / url - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Uri\HttpUri::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Uri\HttpUriTest: Http uri / url')] final class HttpUriTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A url can be validated - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A url can be validated')] public function testValidator() : void { self::assertTrue(HttpUri::isValid('http://www.google.de')); @@ -38,11 +35,8 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertFalse(HttpUri::isValid('https:/google.de')); } - /** - * @testdox The http url has the expected default values after initialization - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The http url has the expected default values after initialization')] public function testDefault() : void { $obj = new HttpUri('https://www.google.com/test/path.php?para1=abc¶2=2#frag'); @@ -55,11 +49,8 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertEquals(0, $obj->getPathOffset()); } - /** - * @testdox The url schema can be parsed correctly from a url and overwritten - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The url schema can be parsed correctly from a url and overwritten')] public function testSchemeInputOutput() : void { $obj = new HttpUri('https://www.google.com/test/path.php?para1=abc¶2=2#frag'); @@ -70,11 +61,8 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertEquals('ftp', $obj->scheme); } - /** - * @testdox The port can be parsed correctly from a url and overwritten - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The port can be parsed correctly from a url and overwritten')] public function testPortInputOutput() : void { $obj = new HttpUri('https://www.google.com:21/test/path.php?para1=abc¶2=2#frag'); @@ -85,11 +73,8 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertEquals(123, $obj->port); } - /** - * @testdox The host can be parsed correctly from a url - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The host can be parsed correctly from a url')] public function testHostInputOutput() : void { $obj = new HttpUri('https://www.google.com/test/path.php?para1=abc¶2=2#frag'); @@ -100,11 +85,8 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertEquals('127.0.0.1', $obj->host); } - /** - * @testdox The username can be parsed correctly from a url - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The username can be parsed correctly from a url')] public function testUsernameInputOutput() : void { $obj = new HttpUri('https://username:password@google.com/test/path.php?para1=abc¶2=2#frag'); @@ -115,11 +97,8 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertEquals('user', $obj->user); } - /** - * @testdox The password can be parsed correctly from a url - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The password can be parsed correctly from a url')] public function testPasswordInputOutput() : void { $obj = new HttpUri('https://username:password@google.com/test/path.php?para1=abc¶2=2#frag'); @@ -130,11 +109,8 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertEquals('pass', $obj->pass); } - /** - * @testdox The base can be parsed correctly from a url - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The base can be parsed correctly from a url')] public function testBaseInputOutput() : void { $obj = new HttpUri('https://www.google.com/test/path.php?para1=abc¶2=2#frag'); @@ -142,11 +118,8 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertEquals('https://www.google.com', $obj->getBase()); } - /** - * @testdox The url can be turned into a string - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The url can be turned into a string')] public function testStringify() : void { $obj = new HttpUri($uri = 'https://www.google.com/test/path.php?para1=abc¶2=2#frag'); @@ -154,11 +127,8 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertEquals($uri, $obj->__toString()); } - /** - * @testdox The authority can be parsed correctly from a url - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The authority can be parsed correctly from a url')] public function testAuthorityInputOutput() : void { $obj = new HttpUri('https://www.google.com/test/path.php?para1=abc¶2=2#frag'); @@ -166,11 +136,8 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertEquals('www.google.com:80', $obj->getAuthority()); } - /** - * @testdox The user info can be parsed correctly from a url - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The user info can be parsed correctly from a url')] public function testUserinfoInputOutput() : void { $obj = new HttpUri('https://username:password@google.com/test/path.php?para1=abc¶2=2#frag'); @@ -178,11 +145,8 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertEquals('username:password', $obj->getUserInfo()); } - /** - * @testdox The root path can be set and returned - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The root path can be set and returned')] public function testRootPathInputOutput() : void { $obj = new HttpUri('https://www.google.com/test/path.php?para1=abc¶2=2#frag'); @@ -191,11 +155,8 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertEquals('a', $obj->getRootPath()); } - /** - * @testdox A path can be overwritten - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A path can be overwritten')] public function testPathInputOutput() : void { $obj = new HttpUri('https://www.google.com/test/path.php?para1=abc¶2=2#frag'); @@ -204,11 +165,8 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertEquals('new', $obj->getPath()); } - /** - * @testdox The path elements can be parsed from a url and overwritten - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The path elements can be parsed from a url and overwritten')] public function testPathElementInputOutput() : void { $obj = new HttpUri('https://www.google.com/test/second/path.php?para1=abc¶2=2#frag'); @@ -219,11 +177,8 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertEquals(['new', 'test'], $obj->getPathElements()); } - /** - * @testdox The path offset can be set and returned - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The path offset can be set and returned')] public function testPathOffsetInputOutput() : void { $obj = new HttpUri('https://www.google.com/test/path.php?para1=abc¶2=2#frag'); @@ -232,11 +187,8 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertEquals(2, $obj->getPathOffset()); } - /** - * @testdox The subdomain can be parsed correctly from a url - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The subdomain can be parsed correctly from a url')] public function testSubdmonain() : void { $obj = new HttpUri('https://www.google.com/test/path.php?para1=abc¶2=2#frag'); @@ -249,11 +201,8 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertEquals('test.www', $obj->getSubdomain()); } - /** - * @testdox The query data can be parsed correctly from a url - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The query data can be parsed correctly from a url')] public function testQueryData() : void { $obj = new HttpUri('https://www.google.com/test/path.php?para1=abc¶2=2#frag'); @@ -262,11 +211,8 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertEquals('2', $obj->getQuery('para2')); } - /** - * @testdox The fragment data can be parsed correctly from a url - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The fragment data can be parsed correctly from a url')] public function testFragment() : void { $obj = new HttpUri('https://www.google.com/test/path.php?para1=abc¶2=2#frag'); @@ -276,11 +222,8 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertEquals('frag2', $obj->fragment); } - /** - * @testdox The path data can be parsed correctly from a url - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The path data can be parsed correctly from a url')] public function testPathData() : void { $obj = new HttpUri('https://www.google.com/test/path.php?para1=abc¶2=2#frag'); @@ -289,22 +232,16 @@ final class HttpUriTest extends \PHPUnit\Framework\TestCase self::assertEquals('test', $obj->getPathElement(0)); } - /** - * @testdox The route can be parsed correctly from a url - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The route can be parsed correctly from a url')] public function testRouteInputOutput() : void { $obj = new HttpUri('https://www.google.com/test/path.php?para1=abc¶2=2#frag'); self::assertEquals('/test/path?para1=abc¶2=2', $obj->getRoute()); } - /** - * @testdox A invalid uri cannot get parsed - * @covers phpOMS\Uri\HttpUri - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid uri cannot get parsed')] public function testInvalidUri() : void { $obj = new HttpUri('http:///03*l.2/test?abc=d'); diff --git a/tests/Uri/InvalidUriExceptionTest.php b/tests/Uri/InvalidUriExceptionTest.php index fe0e89b88..aef7b22a6 100755 --- a/tests/Uri/InvalidUriExceptionTest.php +++ b/tests/Uri/InvalidUriExceptionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,16 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Uri\InvalidUriException; /** - * @testdox phpOMS\tests\Uri\InvalidUriExceptionTest: Invalid uri exception * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Uri\InvalidUriException::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Uri\InvalidUriExceptionTest: Invalid uri exception')] final class InvalidUriExceptionTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The invalid uri exception is an unexpected value exception - * @covers phpOMS\Uri\InvalidUriException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The invalid uri exception is an unexpected value exception')] public function testException() : void { self::assertInstanceOf(\UnexpectedValueException::class, new InvalidUriException('')); diff --git a/tests/Uri/UriFactoryTest.php b/tests/Uri/UriFactoryTest.php index b0f95fb28..1e7ee6e0a 100755 --- a/tests/Uri/UriFactoryTest.php +++ b/tests/Uri/UriFactoryTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,39 +20,30 @@ use phpOMS\Uri\UriFactory; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Uri\UriFactoryTest: Http uri / url factory - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Uri\UriFactory::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Uri\UriFactoryTest: Http uri / url factory')] final class UriFactoryTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The http url factory has the expected default values after initialization - * @covers phpOMS\Uri\UriFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The http url factory has the expected default values after initialization')] public function testDefault() : void { self::assertNull(UriFactory::getQuery('Invalid')); self::assertFalse(UriFactory::clear('Valid5')); } - /** - * @testdox Data can be set to the factory and returned - * @covers phpOMS\Uri\UriFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be set to the factory and returned')] public function testQueryInputOutput() : void { self::assertTrue(UriFactory::setQuery('Valid', 'query1')); self::assertEquals('query1', UriFactory::getQuery('Valid')); } - /** - * @testdox Data can be forcefully overwritten - * @covers phpOMS\Uri\UriFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be forcefully overwritten')] public function testOverwrite() : void { UriFactory::setQuery('Valid2', 'query1'); @@ -60,11 +51,8 @@ final class UriFactoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('query2', UriFactory::getQuery('Valid2')); } - /** - * @testdox By default data is not overwritten in the factory - * @covers phpOMS\Uri\UriFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('By default data is not overwritten in the factory')] public function testInvalidOverwrite() : void { UriFactory::setQuery('Valid3', 'query1'); @@ -72,11 +60,8 @@ final class UriFactoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('query1', UriFactory::getQuery('Valid3')); } - /** - * @testdox Data can be removed/cleared from the factory - * @covers phpOMS\Uri\UriFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be removed/cleared from the factory')] public function testClearing() : void { UriFactory::setQuery('Valid4', 'query1'); @@ -84,11 +69,8 @@ final class UriFactoryTest extends \PHPUnit\Framework\TestCase self::assertNull(UriFactory::getQuery('Valid4')); } - /** - * @testdox None-existing data cannot be cleared from the factory - * @covers phpOMS\Uri\UriFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('None-existing data cannot be cleared from the factory')] public function testInvalidClearing() : void { UriFactory::setQuery('Valid5', 'query1'); @@ -96,11 +78,8 @@ final class UriFactoryTest extends \PHPUnit\Framework\TestCase self::assertFalse(UriFactory::clear('Valid5')); } - /** - * @testdox Data can be removed from the factory by category - * @covers phpOMS\Uri\UriFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be removed from the factory by category')] public function testClean() : void { UriFactory::setQuery('\Valid6', 'query1'); @@ -110,11 +89,8 @@ final class UriFactoryTest extends \PHPUnit\Framework\TestCase self::assertNull(UriFactory::getQuery('\Valid7')); } - /** - * @testdox All data can be removed from the factory with a wildcard - * @covers phpOMS\Uri\UriFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All data can be removed from the factory with a wildcard')] public function testCleanWildcard() : void { UriFactory::setQuery('\Valid8', 'query1'); @@ -124,11 +100,8 @@ final class UriFactoryTest extends \PHPUnit\Framework\TestCase self::assertNull(UriFactory::getQuery('.Valid9')); } - /** - * @testdox Data can be removed from the factory with regular expression matches - * @covers phpOMS\Uri\UriFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be removed from the factory with regular expression matches')] public function testClearingLike() : void { UriFactory::setQuery('/abc', 'query1'); @@ -141,11 +114,8 @@ final class UriFactoryTest extends \PHPUnit\Framework\TestCase self::assertEquals('query1', UriFactory::getQuery('/abc')); } - /** - * @testdox Data which doesn't match the regular expression is not removed - * @covers phpOMS\Uri\UriFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("Data which doesn't match the regular expression is not removed")] public function testInvalidClearingLike() : void { UriFactory::setQuery('/def', 'query1'); @@ -154,11 +124,8 @@ final class UriFactoryTest extends \PHPUnit\Framework\TestCase self::assertFalse(UriFactory::clearLike('\d+')); } - /** - * @testdox A url can be build with the defined factory data and/or build specific data - * @covers phpOMS\Uri\UriFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A url can be build with the defined factory data and/or build specific data')] public function testBuilder() : void { $uri = 'www.test-uri.com?id={@ID}&test={.mTest}&two={/path}&hash={#hash}&none=#none&found={/not}&v={/valid2}'; @@ -177,11 +144,8 @@ final class UriFactoryTest extends \PHPUnit\Framework\TestCase self::assertEquals($expected, UriFactory::build($uri, $vars)); } - /** - * @testdox The uri factory can be set up with default values from a url and build with these default values - * @covers phpOMS\Uri\UriFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The uri factory can be set up with default values from a url and build with these default values')] public function testSetupBuild() : void { $uri = 'http://www.test-uri.com/path/here?id=123&ab=c#fragi'; @@ -194,11 +158,8 @@ final class UriFactoryTest extends \PHPUnit\Framework\TestCase self::assertEquals($uri, UriFactory::build('{/tld}{/rootPath}{/}?{?}#{#}')); } - /** - * @testdox In case of duplicated query elements the last element is used - * @covers phpOMS\Uri\UriFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('In case of duplicated query elements the last element is used')] public function testDuplicatedQueryElements() : void { $uri = '/path/here?id=123&ab=c&id=456#fragi'; @@ -209,11 +170,8 @@ final class UriFactoryTest extends \PHPUnit\Framework\TestCase self::assertEquals($expected, UriFactory::build('{/base}{/rootPath}{/}?id={?id}&ab={?ab}#{#}')); } - /** - * @testdox The uri variables can be unescaped - * @covers phpOMS\Uri\UriFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The uri variables can be unescaped')] public function testVariableUnescape() : void { $uri = '/path/here?id=123&ab=c#fragi'; @@ -225,11 +183,8 @@ final class UriFactoryTest extends \PHPUnit\Framework\TestCase self::assertEquals($unescaped, UriFactory::build($escaped)); } - /** - * @testdox In case of missing ? for query the builder automatically fixes it - * @covers phpOMS\Uri\UriFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('In case of missing ? for query the builder automatically fixes it')] public function testMissingQueryIdentifier() : void { $uri = '/path/here?id=123&ab=c#fragi'; @@ -239,11 +194,8 @@ final class UriFactoryTest extends \PHPUnit\Framework\TestCase self::assertEquals($uri, UriFactory::build('{/base}{/rootPath}{/}&id={?id}&ab={?ab}#{#}')); } - /** - * @testdox A normal url will not be changed - * @covers phpOMS\Uri\UriFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A normal url will not be changed')] public function testNormalUrlParsing() : void { $uri = 'http://www.test-uri.com/path/here?id=123&ab=c#fragi'; diff --git a/tests/Uri/UriSchemeTest.php b/tests/Uri/UriSchemeTest.php index 6f0239d9a..0c0ffa38d 100755 --- a/tests/Uri/UriSchemeTest.php +++ b/tests/Uri/UriSchemeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -23,10 +23,8 @@ use phpOMS\Uri\UriScheme; */ final class UriSchemeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertTrue(\defined('phpOMS\Uri\UriScheme::HTTP')); @@ -46,10 +44,8 @@ final class UriSchemeTest extends \PHPUnit\Framework\TestCase self::assertTrue(\defined('phpOMS\Uri\UriScheme::ITMS')); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumUnique() : void { $values = UriScheme::getConstants(); diff --git a/tests/Utils/ArrayUtilsTest.php b/tests/Utils/ArrayUtilsTest.php index e6298b35b..eb7338f99 100755 --- a/tests/Utils/ArrayUtilsTest.php +++ b/tests/Utils/ArrayUtilsTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ use phpOMS\Utils\ArrayUtils; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Utils\ArrayUtilsTest: Array utilities - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\ArrayUtils::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\ArrayUtilsTest: Array utilities')] final class ArrayUtilsTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Array values can be set and returned with a path - * @covers phpOMS\Utils\ArrayUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Array values can be set and returned with a path')] public function testArrayInputOutput() : void { $expected = [ @@ -61,11 +58,8 @@ final class ArrayUtilsTest extends \PHPUnit\Framework\TestCase self::assertEquals('ab0', ArrayUtils::getArray('a/ab/1', $expected)); } - /** - * @testdox A invalid array path returns null - * @covers phpOMS\Utils\ArrayUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid array path returns null')] public function testArrayInvalidArrayPath() : void { $expected = [ @@ -87,11 +81,8 @@ final class ArrayUtilsTest extends \PHPUnit\Framework\TestCase self::assertNull(ArrayUtils::getArray('a/zzz/1', $expected)); } - /** - * @testdox Test recursively if a value is in an array - * @covers phpOMS\Utils\ArrayUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Test recursively if a value is in an array')] public function testArrayInRecursive() : void { $expected = [ @@ -111,11 +102,8 @@ final class ArrayUtilsTest extends \PHPUnit\Framework\TestCase self::assertFalse(ArrayUtils::inArrayRecursive('2a', $expected, 3)); } - /** - * @testdox An array element can be removed by its path - * @covers phpOMS\Utils\ArrayUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An array element can be removed by its path')] public function testArrayDelete() : void { $expected = [ @@ -132,11 +120,8 @@ final class ArrayUtilsTest extends \PHPUnit\Framework\TestCase self::assertFalse(ArrayUtils::inArrayRecursive('aba', ArrayUtils::unsetArray('a/ab', $expected, '/'))); } - /** - * @testdox Deleting an invalid array path returns the original array - * @covers phpOMS\Utils\ArrayUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Deleting an invalid array path returns the original array')] public function testInvalidArrayDelete() : void { $expected = [ @@ -153,22 +138,16 @@ final class ArrayUtilsTest extends \PHPUnit\Framework\TestCase self::assertEquals($expected, ArrayUtils::unsetArray('a/zzz', $expected, '/')); } - /** - * @testdox The recursive sum of all values in an array can be calculated - * @covers phpOMS\Utils\ArrayUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The recursive sum of all values in an array can be calculated')] public function testArrayRecursiveSum() : void { $numArrRec = [1, [2, [3, 4]]]; self::assertEquals(10, ArrayUtils::arraySumRecursive($numArrRec)); } - /** - * @testdox A multi-dimensional array can be flatten to a one-dimensional array - * @covers phpOMS\Utils\ArrayUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A multi-dimensional array can be flatten to a one-dimensional array')] public function testArrayFlatten() : void { $numArr = [1, 2, 3, 4]; @@ -176,11 +155,8 @@ final class ArrayUtilsTest extends \PHPUnit\Framework\TestCase self::assertEquals($numArr, ArrayUtils::arrayFlatten($numArrRec)); } - /** - * @testdox The sum of an array can be calculated - * @covers phpOMS\Utils\ArrayUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The sum of an array can be calculated')] public function testArraySum() : void { $numArr = [1, 2, 3, 4]; @@ -189,11 +165,8 @@ final class ArrayUtilsTest extends \PHPUnit\Framework\TestCase self::assertEquals(5, ArrayUtils::arraySum($numArr, 1, 2)); } - /** - * @testdox An array can be checked if it contains multiple defined elements - * @covers phpOMS\Utils\ArrayUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An array can be checked if it contains multiple defined elements')] public function testArrayAllIn() : void { $numArr = [1, 2, 3, 4]; @@ -203,11 +176,8 @@ final class ArrayUtilsTest extends \PHPUnit\Framework\TestCase self::assertFalse(ArrayUtils::allInArray([1, 5, 3], $numArr)); } - /** - * @testdox An array can be checked if it contains any of the defined elements - * @covers phpOMS\Utils\ArrayUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An array can be checked if it contains any of the defined elements')] public function testArrayAnyIn() : void { $numArr = [1, 2, 3, 4]; @@ -215,11 +185,8 @@ final class ArrayUtilsTest extends \PHPUnit\Framework\TestCase self::assertFalse(ArrayUtils::anyInArray($numArr, [10, 22])); } - /** - * @testdox An array can be turned into a csv string - * @covers phpOMS\Utils\ArrayUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An array can be turned into a csv string')] public function testArrayToCsv() : void { $csvArr = [ @@ -235,11 +202,8 @@ final class ArrayUtilsTest extends \PHPUnit\Framework\TestCase ArrayUtils::arrayToCsv($csvArr)); } - /** - * @testdox An array can be checked if it has an element and returns its index - * @covers phpOMS\Utils\ArrayUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An array can be checked if it has an element and returns its index')] public function testArgHas() : void { if (ArrayUtils::getArg('--configuration', $_SERVER['argv'] ?? []) !== null) { @@ -247,21 +211,15 @@ final class ArrayUtilsTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox A none-existing argument in an array returns a negative value - * @covers phpOMS\Utils\ArrayUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing argument in an array returns a negative value')] public function testInvalidArgHas() : void { self::assertEquals(-1, ArrayUtils::hasArg('--testNull', $_SERVER['argv'] ?? [])); } - /** - * @testdox The argument value in an array can be returned - * @covers phpOMS\Utils\ArrayUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The argument value in an array can be returned')] public function testArgGet() : void { if (ArrayUtils::getArg('--configuration', $_SERVER['argv'] ?? []) !== null) { @@ -269,22 +227,15 @@ final class ArrayUtilsTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox A none-existing argument in an array returns null - * @covers phpOMS\Utils\ArrayUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing argument in an array returns null')] public function testInvalidArgGet() : void { self::assertNull(ArrayUtils::getArg('--testNull', $_SERVER['argv'] ?? [])); } - /** - * @testdox All array values in an array can be potentiated by a numeric value - * @covers phpOMS\Utils\ArrayUtils - * - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All array values in an array can be potentiated by a numeric value')] public function test() : void { self::assertEquals([4, 9, 16], ArrayUtils::power([2, 3, 4], 2)); @@ -294,31 +245,22 @@ final class ArrayUtilsTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta([2.0, 3.0, 4.0], ArrayUtils::power([8, 27, 64], 1 / 3), 0.01); } - /** - * @testdox All array values in an array can be square rooted - * @covers phpOMS\Utils\ArrayUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All array values in an array can be square rooted')] public function testSqrt() : void { self::assertEqualsWithDelta([2, 3, 4], ArrayUtils::sqrt([4, 9, 16]), 0.01); } - /** - * @testdox All array values in an array can be turned into their absolute value - * @covers phpOMS\Utils\ArrayUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('All array values in an array can be turned into their absolute value')] public function testAbs() : void { self::assertEquals([1, 3, 4], ArrayUtils::abs([-1, 3, -4])); } - /** - * @testdox The difference of two arrays can be evaluated recursively - * @covers phpOMS\Utils\ArrayUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The difference of two arrays can be evaluated recursively')] public function testArrayDiffAssocResursive() : void { self::assertEquals( diff --git a/tests/Utils/Barcode/AztecTest.php b/tests/Utils/Barcode/AztecTest.php index a1f6143fe..f9e3191f7 100755 --- a/tests/Utils/Barcode/AztecTest.php +++ b/tests/Utils/Barcode/AztecTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Utils/Barcode/BarAbstractTest.php b/tests/Utils/Barcode/BarAbstractTest.php index 7851e91a3..c71ba6d45 100755 --- a/tests/Utils/Barcode/BarAbstractTest.php +++ b/tests/Utils/Barcode/BarAbstractTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,6 +19,7 @@ use phpOMS\Utils\Barcode\BarAbstract; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Barcode\CodeAbstract::class)] final class BarAbstractTest extends \PHPUnit\Framework\TestCase { protected $obj = null; @@ -31,20 +32,14 @@ final class BarAbstractTest extends \PHPUnit\Framework\TestCase $this->obj = new class() extends BarAbstract {}; } - /** - * @covers phpOMS\Utils\Barcode\CodeAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testSetGet() : void { $this->obj->setContent('abc'); self::assertEquals('abc', $this->obj->getContent()); } - /** - * @covers phpOMS\Utils\Barcode\CodeAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidDimensionWidth() : void { $this->expectException(\OutOfBoundsException::class); @@ -52,10 +47,7 @@ final class BarAbstractTest extends \PHPUnit\Framework\TestCase $this->obj->setDimension(-2, 1); } - /** - * @covers phpOMS\Utils\Barcode\CodeAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidDimensionHeight() : void { $this->expectException(\OutOfBoundsException::class); @@ -63,10 +55,7 @@ final class BarAbstractTest extends \PHPUnit\Framework\TestCase $this->obj->setDimension(1, -2); } - /** - * @covers phpOMS\Utils\Barcode\CodeAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidOrientation() : void { $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); diff --git a/tests/Utils/Barcode/C128aTest.php b/tests/Utils/Barcode/C128aTest.php index 7e605d4a3..7a865ac8a 100755 --- a/tests/Utils/Barcode/C128aTest.php +++ b/tests/Utils/Barcode/C128aTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,6 +20,7 @@ use phpOMS\Utils\Barcode\OrientationType; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Barcode\C128a::class)] final class C128aTest extends \PHPUnit\Framework\TestCase { protected function setUp() : void @@ -31,10 +32,7 @@ final class C128aTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\Utils\Barcode\C128a - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testImagePng() : void { $path = __DIR__ . '/c128a.png'; @@ -48,10 +46,7 @@ final class C128aTest extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\C128a - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testImageJpg() : void { $path = __DIR__ . '/c128a.jpg'; @@ -65,10 +60,7 @@ final class C128aTest extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\C128a - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testOrientationAndMargin() : void { $path = __DIR__ . '/c128a_vertical.png'; @@ -83,10 +75,7 @@ final class C128aTest extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\C128a - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testValidString() : void { self::assertTrue(C128a::isValidString('ABCDEFG0123+-')); diff --git a/tests/Utils/Barcode/C128bTest.php b/tests/Utils/Barcode/C128bTest.php index ad331460a..a7c32797e 100755 --- a/tests/Utils/Barcode/C128bTest.php +++ b/tests/Utils/Barcode/C128bTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,6 +20,7 @@ use phpOMS\Utils\Barcode\OrientationType; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Barcode\C128b::class)] final class C128bTest extends \PHPUnit\Framework\TestCase { protected function setUp() : void @@ -31,10 +32,7 @@ final class C128bTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\Utils\Barcode\C128b - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testImagePng() : void { $path = __DIR__ . '/c128b.png'; @@ -48,10 +46,7 @@ final class C128bTest extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\C128b - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testImageJpg() : void { $path = __DIR__ . '/c128b.jpg'; @@ -65,10 +60,7 @@ final class C128bTest extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\C128b - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testOrientationAndMargin() : void { $path = __DIR__ . '/c128b_vertical.png'; @@ -83,10 +75,7 @@ final class C128bTest extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\C128b - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testValidString() : void { self::assertTrue(C128b::isValidString('ABCDE~FG0123+-')); diff --git a/tests/Utils/Barcode/C128cTest.php b/tests/Utils/Barcode/C128cTest.php index f2f0cfc26..a93284856 100755 --- a/tests/Utils/Barcode/C128cTest.php +++ b/tests/Utils/Barcode/C128cTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,6 +20,7 @@ use phpOMS\Utils\Barcode\OrientationType; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Barcode\C128c::class)] final class C128cTest extends \PHPUnit\Framework\TestCase { protected function setUp() : void @@ -31,10 +32,7 @@ final class C128cTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\Utils\Barcode\C128c - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testImagePng() : void { $path = __DIR__ . '/c128c.png'; @@ -48,10 +46,7 @@ final class C128cTest extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\C128c - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testImageJpg() : void { $path = __DIR__ . '/c128c.jpg'; @@ -65,10 +60,7 @@ final class C128cTest extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\C128c - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testOrientationAndMargin() : void { $path = __DIR__ . '/c128c_vertical.png'; diff --git a/tests/Utils/Barcode/C25Test.php b/tests/Utils/Barcode/C25Test.php index 54c280d62..923f86302 100755 --- a/tests/Utils/Barcode/C25Test.php +++ b/tests/Utils/Barcode/C25Test.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,6 +20,7 @@ use phpOMS\Utils\Barcode\OrientationType; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Barcode\C25::class)] final class C25Test extends \PHPUnit\Framework\TestCase { protected function setUp() : void @@ -31,10 +32,7 @@ final class C25Test extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\Utils\Barcode\C25 - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testImagePng() : void { $path = __DIR__ . '/c25.png'; @@ -48,10 +46,7 @@ final class C25Test extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\C25 - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testImageJpg() : void { $path = __DIR__ . '/c25.jpg'; @@ -65,10 +60,7 @@ final class C25Test extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\C25 - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testOrientationAndMargin() : void { $path = __DIR__ . '/c25_vertical.png'; @@ -83,20 +75,14 @@ final class C25Test extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\C25 - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testValidString() : void { self::assertTrue(C25::isValidString('1234567890')); self::assertFalse(C25::isValidString('1234567A890')); } - /** - * @covers phpOMS\Utils\Barcode\C25 - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testInvalidOrientation() : void { $this->expectException(\InvalidArgumentException::class); diff --git a/tests/Utils/Barcode/C39Test.php b/tests/Utils/Barcode/C39Test.php index 35b520ccb..597745f75 100755 --- a/tests/Utils/Barcode/C39Test.php +++ b/tests/Utils/Barcode/C39Test.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,6 +20,7 @@ use phpOMS\Utils\Barcode\OrientationType; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Barcode\C39::class)] final class C39Test extends \PHPUnit\Framework\TestCase { protected function setUp() : void @@ -31,10 +32,7 @@ final class C39Test extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\Utils\Barcode\C39 - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testImagePng() : void { $path = __DIR__ . '/c39.png'; @@ -48,10 +46,7 @@ final class C39Test extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\C39 - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testImageJpg() : void { $path = __DIR__ . '/c39.jpg'; @@ -65,10 +60,7 @@ final class C39Test extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\C39 - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testOrientationAndMargin() : void { $path = __DIR__ . '/c39_vertical.png'; @@ -83,10 +75,7 @@ final class C39Test extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\C39 - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testValidString() : void { self::assertTrue(C39::isValidString('ABCDEFG0123+-')); diff --git a/tests/Utils/Barcode/CodebarTest.php b/tests/Utils/Barcode/CodebarTest.php index 8cbe0830c..1a1713c76 100755 --- a/tests/Utils/Barcode/CodebarTest.php +++ b/tests/Utils/Barcode/CodebarTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,6 +20,7 @@ use phpOMS\Utils\Barcode\OrientationType; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Barcode\Codebar::class)] final class CodebarTest extends \PHPUnit\Framework\TestCase { protected function setUp() : void @@ -31,10 +32,7 @@ final class CodebarTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\Utils\Barcode\Codebar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testImagePng() : void { $path = __DIR__ . '/codebar.png'; @@ -48,10 +46,7 @@ final class CodebarTest extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\Codebar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testImageJpg() : void { $path = __DIR__ . '/codebar.jpg'; @@ -65,10 +60,7 @@ final class CodebarTest extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\Codebar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testOrientationAndMargin() : void { $path = __DIR__ . '/ccodebar_vertical.png'; @@ -83,10 +75,7 @@ final class CodebarTest extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\Codebar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testValidString() : void { self::assertTrue(Codebar::isValidString('412163')); diff --git a/tests/Utils/Barcode/DatamatrixTest.php b/tests/Utils/Barcode/DatamatrixTest.php index f133c1f6a..50432a492 100755 --- a/tests/Utils/Barcode/DatamatrixTest.php +++ b/tests/Utils/Barcode/DatamatrixTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,6 +19,7 @@ use phpOMS\Utils\Barcode\Datamatrix; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Barcode\Datamatrix::class)] final class DatamatrixTest extends \PHPUnit\Framework\TestCase { protected function setUp() : void @@ -30,10 +31,7 @@ final class DatamatrixTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\Utils\Barcode\Datamatrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testImagePng() : void { $path = __DIR__ . '/datamatrix.png'; @@ -47,10 +45,7 @@ final class DatamatrixTest extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\Datamatrix - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testImageJpg() : void { $path = __DIR__ . '/datamatrix.jpg'; diff --git a/tests/Utils/Barcode/HIBCCTest.php b/tests/Utils/Barcode/HIBCCTest.php index a3ec0a33f..1f7730ff4 100755 --- a/tests/Utils/Barcode/HIBCCTest.php +++ b/tests/Utils/Barcode/HIBCCTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Utils/Barcode/OrientationTypeTest.php b/tests/Utils/Barcode/OrientationTypeTest.php index 3ba59493a..54f5de240 100755 --- a/tests/Utils/Barcode/OrientationTypeTest.php +++ b/tests/Utils/Barcode/OrientationTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Utils\Barcode\OrientationType; */ final class OrientationTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(2, OrientationType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(OrientationType::getConstants(), \array_unique(OrientationType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(0, OrientationType::HORIZONTAL); diff --git a/tests/Utils/Barcode/QRTest.php b/tests/Utils/Barcode/QRTest.php index 9e6ac628d..91c35d87c 100755 --- a/tests/Utils/Barcode/QRTest.php +++ b/tests/Utils/Barcode/QRTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,6 +19,7 @@ use phpOMS\Utils\Barcode\QR; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Barcode\QR::class)] final class QRTest extends \PHPUnit\Framework\TestCase { protected function setUp() : void @@ -30,10 +31,7 @@ final class QRTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers phpOMS\Utils\Barcode\QR - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testImagePng() : void { $path = __DIR__ . '/qr.png'; @@ -47,10 +45,7 @@ final class QRTest extends \PHPUnit\Framework\TestCase self::assertFileExists($path); } - /** - * @covers phpOMS\Utils\Barcode\QR - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testImageJpg() : void { $path = __DIR__ . '/qr.jpg'; diff --git a/tests/Utils/Barcode/datamatrix.jpg b/tests/Utils/Barcode/datamatrix.jpg index 506195b73..154345e94 100644 Binary files a/tests/Utils/Barcode/datamatrix.jpg and b/tests/Utils/Barcode/datamatrix.jpg differ diff --git a/tests/Utils/Barcode/datamatrix.png b/tests/Utils/Barcode/datamatrix.png index 8d7bd896e..138094f92 100644 Binary files a/tests/Utils/Barcode/datamatrix.png and b/tests/Utils/Barcode/datamatrix.png differ diff --git a/tests/Utils/ColorUtilsTest.php b/tests/Utils/ColorUtilsTest.php index 2247c495d..d89f4ee38 100755 --- a/tests/Utils/ColorUtilsTest.php +++ b/tests/Utils/ColorUtilsTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,27 +19,21 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Utils\ColorUtils; /** - * @testdox phpOMS\tests\Utils\ColorUtilsTest: Color utilities - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\ColorUtils::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\ColorUtilsTest: Color utilities')] final class ColorUtilsTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A integer can be converted to rgb - * @covers phpOMS\Utils\ColorUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A integer can be converted to rgb')] public function testIntToRgb() : void { self::assertEquals(['r' => 0xbc, 'g' => 0x39, 'b' => 0x6c], ColorUtils::intToRgb(12335468)); } - /** - * @testdox Rgb can be converted to a integer - * @covers phpOMS\Utils\ColorUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Rgb can be converted to a integer')] public function testRgbToInt() : void { self::assertEquals(12335468, ColorUtils::rgbToInt(['r' => 0xbc, 'g' => 0x39, 'b' => 0x6c])); diff --git a/tests/Utils/Compression/LZWTest.php b/tests/Utils/Compression/LZWTest.php index d2dd953a7..761afbecc 100755 --- a/tests/Utils/Compression/LZWTest.php +++ b/tests/Utils/Compression/LZWTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\Compression; use phpOMS\Utils\Compression\LZW; /** - * @testdox phpOMS\tests\Utils\Compression\LZWTest: LZW compression - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Compression\LZW::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Compression\LZWTest: LZW compression')] final class LZWTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A string can be LZW compressed and uncompressed - * @covers phpOMS\Utils\Compression\LZW - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A string can be LZW compressed and uncompressed')] public function testLZW() : void { $expected = 'This is a test'; diff --git a/tests/Utils/Converter/AngleTypeTest.php b/tests/Utils/Converter/AngleTypeTest.php index 629f8c4b7..db6ae9822 100755 --- a/tests/Utils/Converter/AngleTypeTest.php +++ b/tests/Utils/Converter/AngleTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Utils\Converter\AngleType; */ final class AngleTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(10, AngleType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(AngleType::getConstants(), \array_unique(AngleType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('deg', AngleType::DEGREE); diff --git a/tests/Utils/Converter/AreaTypeTest.php b/tests/Utils/Converter/AreaTypeTest.php index 925123373..e118eee5d 100755 --- a/tests/Utils/Converter/AreaTypeTest.php +++ b/tests/Utils/Converter/AreaTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Utils\Converter\AreaType; */ final class AreaTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(13, AreaType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(AreaType::getConstants(), \array_unique(AreaType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('ft', AreaType::SQUARE_FEET); diff --git a/tests/Utils/Converter/CurrencyTest.php b/tests/Utils/Converter/CurrencyTest.php index f43b662a7..222d62351 100755 --- a/tests/Utils/Converter/CurrencyTest.php +++ b/tests/Utils/Converter/CurrencyTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -22,10 +22,10 @@ use phpOMS\Uri\HttpUri; use phpOMS\Utils\Converter\Currency; /** - * @testdox phpOMS\tests\Utils\Converter\CurrencyTest: Currency converter - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Converter\Currency::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Converter\CurrencyTest: Currency converter')] final class CurrencyTest extends \PHPUnit\Framework\TestCase { private static $reachable; @@ -54,62 +54,44 @@ final class CurrencyTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox A currency can be converted from euro to another currency - * @covers phpOMS\Utils\Converter\Currency - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A currency can be converted from euro to another currency')] public function testCurrencyFromEur() : void { self::assertGreaterThan(0, Currency::fromEurTo(1, ISO4217CharEnum::_USD)); } - /** - * @testdox A currency can be converted to euro from another currency - * @covers phpOMS\Utils\Converter\Currency - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A currency can be converted to euro from another currency')] public function testCurrencyToEur() : void { self::assertGreaterThan(0, Currency::fromToEur(1, ISO4217CharEnum::_USD)); } - /** - * @testdox A currency can be converted from one currency to another currency - * @covers phpOMS\Utils\Converter\Currency - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A currency can be converted from one currency to another currency')] public function testCurrency() : void { Currency::resetCurrencies(); self::assertGreaterThan(0, Currency::convertCurrency(1, ISO4217CharEnum::_USD, ISO4217CharEnum::_GBP)); } - /** - * @testdox A currency conversion from eur to a invalid currency throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Currency - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A currency conversion from eur to a invalid currency throws a InvalidArgumentException')] public function testInvalidFromEur() : void { self::assertLessThan(0, Currency::fromEurTo(1, 'ERROR')); } - /** - * @testdox A currency conversion from a invalid currency to eur throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Currency - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A currency conversion from a invalid currency to eur throws a InvalidArgumentException')] public function testInvalidToEur() : void { self::assertLessThan(0, Currency::fromToEur(1, 'ERROR')); } - /** - * @testdox A currency conversion from a invalid currency to a invalid currency throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Currency - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A currency conversion from a invalid currency to a invalid currency throws a InvalidArgumentException')] public function testInvalidConvert() : void { self::assertLessThan(0, Currency::convertCurrency(1, 'ERROR', 'TEST')); diff --git a/tests/Utils/Converter/EnergyPowerTypeTest.php b/tests/Utils/Converter/EnergyPowerTypeTest.php index e8b3106e0..0bdc3cf15 100755 --- a/tests/Utils/Converter/EnergyPowerTypeTest.php +++ b/tests/Utils/Converter/EnergyPowerTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Utils\Converter\EnergyPowerType; */ final class EnergyPowerTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(9, EnergyPowerType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(EnergyPowerType::getConstants(), \array_unique(EnergyPowerType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('kWh', EnergyPowerType::KILOWATT_HOURS); diff --git a/tests/Utils/Converter/FileSizeTypeTest.php b/tests/Utils/Converter/FileSizeTypeTest.php index be341a410..d84e4d958 100755 --- a/tests/Utils/Converter/FileSizeTypeTest.php +++ b/tests/Utils/Converter/FileSizeTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,34 +17,28 @@ namespace phpOMS\tests\Utils\Converter; use phpOMS\Utils\Converter\FileSizeType; /** - * @testdox phpOMS\tests\Utils\Converter\FileSizeTypeTest: File size types - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Converter\FileSizeType::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Converter\FileSizeTypeTest: File size types')] final class FileSizeTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(10, FileSizeType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(FileSizeType::getConstants(), \array_unique(FileSizeType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('TB', FileSizeType::TERRABYTE); @@ -59,11 +53,8 @@ final class FileSizeTypeTest extends \PHPUnit\Framework\TestCase self::assertEquals('bit', FileSizeType::BIT); } - /** - * @testdox File sizes can get automatically formatted according to their size - * @covers phpOMS\Utils\Converter\FileSizeType - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('File sizes can get automatically formatted according to their size')] public function testAutoFormat() : void { self::assertEquals( diff --git a/tests/Utils/Converter/FileTest.php b/tests/Utils/Converter/FileTest.php index 23670377d..2ae1733b1 100755 --- a/tests/Utils/Converter/FileTest.php +++ b/tests/Utils/Converter/FileTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\Converter; use phpOMS\Utils\Converter\File; /** - * @testdox phpOMS\tests\Utils\Converter\FileTest: File size converter - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Converter\File::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Converter\FileTest: File size converter')] final class FileTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A byte number can be converted to a string representation - * @covers phpOMS\Utils\Converter\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A byte number can be converted to a string representation')] public function testByteSizeToString() : void { self::assertEquals('400b', File::byteSizeToString(400)); @@ -36,11 +33,8 @@ final class FileTest extends \PHPUnit\Framework\TestCase self::assertEquals('1.5gb', File::byteSizeToString(1500000000)); } - /** - * @testdox A kilobyte number can be converted to a string representation - * @covers phpOMS\Utils\Converter\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A kilobyte number can be converted to a string representation')] public function testKilobyteSizeToString() : void { self::assertEquals('500kb', File::kilobyteSizeToString(500)); diff --git a/tests/Utils/Converter/IpTest.php b/tests/Utils/Converter/IpTest.php index 020f7ce1e..9df88a87b 100755 --- a/tests/Utils/Converter/IpTest.php +++ b/tests/Utils/Converter/IpTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\Converter; use phpOMS\Utils\Converter\Ip; /** - * @testdox phpOMS\tests\Utils\Converter\IpTest: IP converter - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Converter\Ip::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Converter\IpTest: IP converter')] final class IpTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox An ip can be converted to a float - * @covers phpOMS\Utils\Converter\Ip - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An ip can be converted to a float')] public function testIp() : void { self::assertTrue(\abs(1527532998.0 - Ip::ip2Float('91.12.77.198')) < 1); diff --git a/tests/Utils/Converter/LengthTypeTest.php b/tests/Utils/Converter/LengthTypeTest.php index d9adffb63..3d9639ed7 100755 --- a/tests/Utils/Converter/LengthTypeTest.php +++ b/tests/Utils/Converter/LengthTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Utils\Converter\LengthType; */ final class LengthTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(22, LengthType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(LengthType::getConstants(), \array_unique(LengthType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('mi', LengthType::MILES); diff --git a/tests/Utils/Converter/MeasurementTest.php b/tests/Utils/Converter/MeasurementTest.php index 5b49243cf..da0e71fba 100755 --- a/tests/Utils/Converter/MeasurementTest.php +++ b/tests/Utils/Converter/MeasurementTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -28,17 +28,14 @@ use phpOMS\Utils\Converter\VolumeType; use phpOMS\Utils\Converter\WeightType; /** - * @testdox phpOMS\tests\Utils\Converter\MeasurementTest: Measurement converter - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Converter\Measurement::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Converter\MeasurementTest: Measurement converter')] final class MeasurementTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Temperatures can be converted - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Temperatures can be converted')] public function testTemperature() : void { $temps = TemperatureType::getConstants(); @@ -55,11 +52,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase self::assertTrue(true); } - /** - * @testdox Weights can be converted - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Weights can be converted')] public function testWeight() : void { $weights = WeightType::getConstants(); @@ -76,11 +70,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase self::assertTrue(true); } - /** - * @testdox Lengths can be converted - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Lengths can be converted')] public function testLength() : void { $lengths = LengthType::getConstants(); @@ -97,11 +88,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase self::assertTrue(true); } - /** - * @testdox Areas can be converted - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Areas can be converted')] public function testArea() : void { $areas = AreaType::getConstants(); @@ -118,11 +106,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase self::assertTrue(true); } - /** - * @testdox Volumes can be converted - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Volumes can be converted')] public function testVolume() : void { $volumes = VolumeType::getConstants(); @@ -139,11 +124,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase self::assertTrue(true); } - /** - * @testdox Speeds can be converted - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Speeds can be converted')] public function testSpeed() : void { $speeds = SpeedType::getConstants(); @@ -160,11 +142,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase self::assertTrue(true); } - /** - * @testdox Times can be converted - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Times can be converted')] public function testTime() : void { $times = TimeType::getConstants(); @@ -181,11 +160,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase self::assertTrue(true); } - /** - * @testdox Angles can be converted - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Angles can be converted')] public function testAngle() : void { $angles = AngleType::getConstants(); @@ -202,11 +178,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase self::assertTrue(true); } - /** - * @testdox Pressures can be converted - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Pressures can be converted')] public function testPressure() : void { $pressures = PressureType::getConstants(); @@ -223,11 +196,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase self::assertTrue(true); } - /** - * @testdox Energies can be converted - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Energies can be converted')] public function testEnergy() : void { $energies = EnergyPowerType::getConstants(); @@ -244,11 +214,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase self::assertTrue(true); } - /** - * @testdox File sizes can be converted - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('File sizes can be converted')] public function testFileSize() : void { $fileSizes = FileSizeType::getConstants(); @@ -265,11 +232,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase self::assertTrue(true); } - /** - * @testdox Invalid conversion from unknown temperature throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion from unknown temperature throws a InvalidArgumentException')] public function testInvalidTemperatureFrom() : void { $this->expectException(\InvalidArgumentException::class); @@ -277,11 +241,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertTemperature(1.1, 'invalid', TemperatureType::CELSIUS); } - /** - * @testdox Invalid conversion to unknown temperature throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion to unknown temperature throws a InvalidArgumentException')] public function testInvalidTemperatureTo() : void { $this->expectException(\InvalidArgumentException::class); @@ -289,11 +250,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertTemperature(1.1, TemperatureType::CELSIUS, 'invalid'); } - /** - * @testdox Invalid conversion from unknown weight throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion from unknown weight throws a InvalidArgumentException')] public function testInvalidWeightFrom() : void { $this->expectException(\InvalidArgumentException::class); @@ -301,11 +259,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertWeight(1.1, 'invalid', WeightType::KILOGRAM); } - /** - * @testdox Invalid conversion to unknown weight throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion to unknown weight throws a InvalidArgumentException')] public function testInvalidWeightTo() : void { $this->expectException(\InvalidArgumentException::class); @@ -313,11 +268,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertWeight(1.1, WeightType::KILOGRAM, 'invalid'); } - /** - * @testdox Invalid conversion from unknown length throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion from unknown length throws a InvalidArgumentException')] public function testInvalidLengthFrom() : void { $this->expectException(\InvalidArgumentException::class); @@ -325,11 +277,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertLength(1.1, 'invalid', LengthType::METERS); } - /** - * @testdox Invalid conversion to unknown length throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion to unknown length throws a InvalidArgumentException')] public function testInvalidLengthTo() : void { $this->expectException(\InvalidArgumentException::class); @@ -337,11 +286,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertLength(1.1, LengthType::METERS, 'invalid'); } - /** - * @testdox Invalid conversion from unknown area throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion from unknown area throws a InvalidArgumentException')] public function testInvalidAreaFrom() : void { $this->expectException(\InvalidArgumentException::class); @@ -349,11 +295,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertArea(1.1, 'invalid', AreaType::SQUARE_METERS); } - /** - * @testdox Invalid conversion to unknown area throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion to unknown area throws a InvalidArgumentException')] public function testInvalidAreaTo() : void { $this->expectException(\InvalidArgumentException::class); @@ -361,11 +304,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertArea(1.1, AreaType::SQUARE_METERS, 'invalid'); } - /** - * @testdox Invalid conversion from unknown volume throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion from unknown volume throws a InvalidArgumentException')] public function testInvalidVolumeFrom() : void { $this->expectException(\InvalidArgumentException::class); @@ -373,11 +313,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertVolume(1.1, 'invalid', VolumeType::LITER); } - /** - * @testdox Invalid conversion to unknown volume throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion to unknown volume throws a InvalidArgumentException')] public function testInvalidVolumeTo() : void { $this->expectException(\InvalidArgumentException::class); @@ -385,11 +322,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertVolume(1.1, VolumeType::LITER, 'invalid'); } - /** - * @testdox Invalid conversion from unknown speed throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion from unknown speed throws a InvalidArgumentException')] public function testInvalidSpeedFrom() : void { $this->expectException(\InvalidArgumentException::class); @@ -397,11 +331,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertSpeed(1.1, 'invalid', SpeedType::KILOMETERS_PER_HOUR); } - /** - * @testdox Invalid conversion to unknown speed throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion to unknown speed throws a InvalidArgumentException')] public function testInvalidSpeedTo() : void { $this->expectException(\InvalidArgumentException::class); @@ -409,11 +340,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertSpeed(1.1, SpeedType::KILOMETERS_PER_HOUR, 'invalid'); } - /** - * @testdox Invalid conversion from unknown time throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion from unknown time throws a InvalidArgumentException')] public function testInvalidTimeFrom() : void { $this->expectException(\InvalidArgumentException::class); @@ -421,11 +349,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertTime(1.1, 'invalid', TimeType::HOURS); } - /** - * @testdox Invalid conversion to unknown time throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion to unknown time throws a InvalidArgumentException')] public function testInvalidTimeTo() : void { $this->expectException(\InvalidArgumentException::class); @@ -433,11 +358,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertTime(1.1, TimeType::HOURS, 'invalid'); } - /** - * @testdox Invalid conversion from unknown angle throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion from unknown angle throws a InvalidArgumentException')] public function testInvalidAngleFrom() : void { $this->expectException(\InvalidArgumentException::class); @@ -445,11 +367,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertAngle(1.1, 'invalid', AngleType::RADIAN); } - /** - * @testdox Invalid conversion to unknown angle throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion to unknown angle throws a InvalidArgumentException')] public function testInvalidAngleTo() : void { $this->expectException(\InvalidArgumentException::class); @@ -457,11 +376,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertAngle(1.1, AngleType::RADIAN, 'invalid'); } - /** - * @testdox Invalid conversion from unknown pressure throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion from unknown pressure throws a InvalidArgumentException')] public function testInvalidPressureFrom() : void { $this->expectException(\InvalidArgumentException::class); @@ -469,11 +385,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertPressure(1.1, 'invalid', PressureType::BAR); } - /** - * @testdox Invalid conversion to unknown pressure throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion to unknown pressure throws a InvalidArgumentException')] public function testInvalidPressureTo() : void { $this->expectException(\InvalidArgumentException::class); @@ -481,11 +394,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertPressure(1.1, PressureType::BAR, 'invalid'); } - /** - * @testdox Invalid conversion from unknown energy throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion from unknown energy throws a InvalidArgumentException')] public function testInvalidEnergyPowerFrom() : void { $this->expectException(\InvalidArgumentException::class); @@ -493,11 +403,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertEnergy(1.1, 'invalid', EnergyPowerType::JOULES); } - /** - * @testdox Invalid conversion to unknown energy throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion to unknown energy throws a InvalidArgumentException')] public function testInvalidEnergyPowerTo() : void { $this->expectException(\InvalidArgumentException::class); @@ -505,11 +412,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertEnergy(1.1, EnergyPowerType::JOULES, 'invalid'); } - /** - * @testdox Invalid conversion from unknown filesize throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion from unknown filesize throws a InvalidArgumentException')] public function testInvalidFileSizeFrom() : void { $this->expectException(\InvalidArgumentException::class); @@ -517,11 +421,8 @@ final class MeasurementTest extends \PHPUnit\Framework\TestCase Measurement::convertFileSize(1.1, 'invalid', FileSizeType::KILOBYTE); } - /** - * @testdox Invalid conversion to unknown filesize throws a InvalidArgumentException - * @covers phpOMS\Utils\Converter\Measurement - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid conversion to unknown filesize throws a InvalidArgumentException')] public function testInvalidFileSizeTo() : void { $this->expectException(\InvalidArgumentException::class); diff --git a/tests/Utils/Converter/NumericTest.php b/tests/Utils/Converter/NumericTest.php index 0d56f5410..56734a196 100755 --- a/tests/Utils/Converter/NumericTest.php +++ b/tests/Utils/Converter/NumericTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\Converter; use phpOMS\Utils\Converter\Numeric; /** - * @testdox phpOMS\tests\Utils\Converter\NumericTest: Numeric converter - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Converter\Numeric::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Converter\NumericTest: Numeric converter')] final class NumericTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Arabic numbers can be converted to roman numbers - * @covers phpOMS\Utils\Converter\Numeric - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Arabic numbers can be converted to roman numbers')] public function testArabicToRoman() : void { $rand = \mt_rand(1, 9999); @@ -39,11 +36,8 @@ final class NumericTest extends \PHPUnit\Framework\TestCase self::assertEquals('XI', Numeric::arabicToRoman(11)); } - /** - * @testdox Roman numbers can be converted to arabic numbers - * @covers phpOMS\Utils\Converter\Numeric - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Roman numbers can be converted to arabic numbers')] public function testRomanToArabic() : void { self::assertEquals(8, Numeric::romanToArabic('VIII')); @@ -52,11 +46,8 @@ final class NumericTest extends \PHPUnit\Framework\TestCase self::assertEquals(11, Numeric::romanToArabic('XI')); } - /** - * @testdox Letters can be converted to numbers - * @covers phpOMS\Utils\Converter\Numeric - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Letters can be converted to numbers')] public function testAlphaToNumeric() : void { self::assertEquals(0, Numeric::alphaToNumeric('A')); @@ -64,11 +55,8 @@ final class NumericTest extends \PHPUnit\Framework\TestCase self::assertEquals(53, Numeric::alphaToNumeric('BB')); } - /** - * @testdox Numbers can be converted to letters - * @covers phpOMS\Utils\Converter\Numeric - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Numbers can be converted to letters')] public function testNumericToAlpha() : void { self::assertEquals('A', Numeric::numericToAlpha(0)); @@ -76,11 +64,8 @@ final class NumericTest extends \PHPUnit\Framework\TestCase self::assertEquals('BB', Numeric::numericToAlpha(53)); } - /** - * @testdox Numbers can be converted between bases - * @covers phpOMS\Utils\Converter\Numeric - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Numbers can be converted between bases')] public function testBase() : void { self::assertEquals('443', Numeric::convertBase('123', '0123456789', '01234')); diff --git a/tests/Utils/Converter/PressureTypeTest.php b/tests/Utils/Converter/PressureTypeTest.php index c2a3fb310..56947d849 100755 --- a/tests/Utils/Converter/PressureTypeTest.php +++ b/tests/Utils/Converter/PressureTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Utils\Converter\PressureType; */ final class PressureTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(13, PressureType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(PressureType::getConstants(), \array_unique(PressureType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('Pa', PressureType::PASCALS); diff --git a/tests/Utils/Converter/SpeedTypeTest.php b/tests/Utils/Converter/SpeedTypeTest.php index caed1eb23..7bbb5f167 100755 --- a/tests/Utils/Converter/SpeedTypeTest.php +++ b/tests/Utils/Converter/SpeedTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Utils\Converter\SpeedType; */ final class SpeedTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(34, SpeedType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(SpeedType::getConstants(), \array_unique(SpeedType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('mpd', SpeedType::MILES_PER_DAY); diff --git a/tests/Utils/Converter/TemperatureTypeTest.php b/tests/Utils/Converter/TemperatureTypeTest.php index dac1b3af0..e3645cc2e 100755 --- a/tests/Utils/Converter/TemperatureTypeTest.php +++ b/tests/Utils/Converter/TemperatureTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Utils\Converter\TemperatureType; */ final class TemperatureTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(8, TemperatureType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(TemperatureType::getConstants(), \array_unique(TemperatureType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('celsius', TemperatureType::CELSIUS); diff --git a/tests/Utils/Converter/TimeTypeTest.php b/tests/Utils/Converter/TimeTypeTest.php index 1f2f81016..20e848e46 100755 --- a/tests/Utils/Converter/TimeTypeTest.php +++ b/tests/Utils/Converter/TimeTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Utils\Converter\TimeType; */ final class TimeTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(9, TimeType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(TimeType::getConstants(), \array_unique(TimeType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('ms', TimeType::MILLISECONDS); diff --git a/tests/Utils/Converter/VolumeTypeTest.php b/tests/Utils/Converter/VolumeTypeTest.php index 673213d29..991036991 100755 --- a/tests/Utils/Converter/VolumeTypeTest.php +++ b/tests/Utils/Converter/VolumeTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Utils\Converter\VolumeType; */ final class VolumeTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(38, VolumeType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(VolumeType::getConstants(), \array_unique(VolumeType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('UK gal', VolumeType::UK_GALLON); diff --git a/tests/Utils/Converter/WeightTypeTest.php b/tests/Utils/Converter/WeightTypeTest.php index bca9e508c..e00813f14 100755 --- a/tests/Utils/Converter/WeightTypeTest.php +++ b/tests/Utils/Converter/WeightTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Utils\Converter\WeightType; */ final class WeightTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(14, WeightType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(WeightType::getConstants(), \array_unique(WeightType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals('mg', WeightType::MICROGRAM); diff --git a/tests/Utils/Encoding/CaesarTest.php b/tests/Utils/Encoding/CaesarTest.php index 93116c09e..9d88fa75a 100755 --- a/tests/Utils/Encoding/CaesarTest.php +++ b/tests/Utils/Encoding/CaesarTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,16 +18,14 @@ use phpOMS\Utils\Encoding\Caesar; use phpOMS\Utils\RnG\StringUtils; /** - * @testdox phpOMS\tests\Utils\Encoding\CaesarTest: Caesar text encoding/decoding * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Encoding\Caesar::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Encoding\CaesarTest: Caesar text encoding/decoding')] final class CaesarTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Text can be encoded and decoded with the ceasar encoding - * @covers phpOMS\Utils\Encoding\Caesar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Text can be encoded and decoded with the ceasar encoding')] public function testEncoding() : void { $raw = StringUtils::generateString(11, 100); diff --git a/tests/Utils/Encoding/GrayTest.php b/tests/Utils/Encoding/GrayTest.php index 537c77c2e..abcc5d100 100755 --- a/tests/Utils/Encoding/GrayTest.php +++ b/tests/Utils/Encoding/GrayTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\Encoding; use phpOMS\Utils\Encoding\Gray; /** - * @testdox phpOMS\tests\Utils\Encoding\GrayTest: Gray text encoding/decoding - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Encoding\Gray::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Encoding\GrayTest: Gray text encoding/decoding')] final class GrayTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Text can be encoded and decoded with the gray encoding - * @covers phpOMS\Utils\Encoding\Gray - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Text can be encoded and decoded with the gray encoding')] public function testEncoding() : void { self::assertEquals(55, Gray::encode(37)); diff --git a/tests/Utils/Encoding/Huffman/DictionaryTest.php b/tests/Utils/Encoding/Huffman/DictionaryTest.php index c2e8a0ffc..c2002fbc9 100755 --- a/tests/Utils/Encoding/Huffman/DictionaryTest.php +++ b/tests/Utils/Encoding/Huffman/DictionaryTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\Encoding\Huffman; use phpOMS\Utils\Encoding\Huffman\Dictionary; /** - * @testdox phpOMS\tests\Utils\Encoding\Huffman\DictionaryTest: Dictionary for the huffman encoding - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Encoding\Huffman\Dictionary::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Encoding\Huffman\DictionaryTest: Dictionary for the huffman encoding')] final class DictionaryTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Only single characters can be returned from the dictionary. Multiple characters throw a InvalidArgumentException - * @covers phpOMS\Utils\Encoding\Huffman\Dictionary - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Only single characters can be returned from the dictionary. Multiple characters throw a InvalidArgumentException')] public function testInvalidGetCharacter() : void { $this->expectException(\InvalidArgumentException::class); @@ -36,11 +33,8 @@ final class DictionaryTest extends \PHPUnit\Framework\TestCase $dict->get('as'); } - /** - * @testdox A none-existing character throws a InvalidArgumentException - * @covers phpOMS\Utils\Encoding\Huffman\Dictionary - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing character throws a InvalidArgumentException')] public function testNotExistingGetCharacter() : void { $this->expectException(\InvalidArgumentException::class); @@ -49,11 +43,8 @@ final class DictionaryTest extends \PHPUnit\Framework\TestCase $dict->get('a'); } - /** - * @testdox Only single characters can be set in the dictionary. Multiple characters throw a InvalidArgumentException - * @covers phpOMS\Utils\Encoding\Huffman\Dictionary - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Only single characters can be set in the dictionary. Multiple characters throw a InvalidArgumentException')] public function testInvalidSetCharacter() : void { $this->expectException(\InvalidArgumentException::class); @@ -62,11 +53,8 @@ final class DictionaryTest extends \PHPUnit\Framework\TestCase $dict->set('as', 'test'); } - /** - * @testdox Dictionary elements cannot be overwritten and throw a InvalidArgumentException - * @covers phpOMS\Utils\Encoding\Huffman\Dictionary - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Dictionary elements cannot be overwritten and throw a InvalidArgumentException')] public function testInvalidSetDuplicateCharacter() : void { $this->expectException(\InvalidArgumentException::class); @@ -76,11 +64,8 @@ final class DictionaryTest extends \PHPUnit\Framework\TestCase $dict->set('a', '1'); } - /** - * @testdox Invalid dictionary values throw a InvalidArgumentException - * @covers phpOMS\Utils\Encoding\Huffman\Dictionary - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid dictionary values throw a InvalidArgumentException')] public function testInvalidFormattedValue() : void { $this->expectException(\InvalidArgumentException::class); diff --git a/tests/Utils/Encoding/Huffman/HuffmanTest.php b/tests/Utils/Encoding/Huffman/HuffmanTest.php index 7dc80b20a..fa9e8b5a7 100755 --- a/tests/Utils/Encoding/Huffman/HuffmanTest.php +++ b/tests/Utils/Encoding/Huffman/HuffmanTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,16 +17,13 @@ namespace phpOMS\tests\Utils\Encoding\Huffman; use phpOMS\Utils\Encoding\Huffman\Huffman; /** - * @testdox phpOMS\tests\Utils\Encoding\Huffman\HuffmanTest: Data can be encoded with huffman - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Encoding\Huffman\HuffmanTest: Data can be encoded with huffman')] final class HuffmanTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Encoding and decoding empty data results in an empty output - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Encoding and decoding empty data results in an empty output')] public function testEmpty() : void { $huff = new Huffman(); @@ -34,10 +31,8 @@ final class HuffmanTest extends \PHPUnit\Framework\TestCase self::assertEquals('', $huff->decode('')); } - /** - * @testdox Data can be huffman encoded and decoded - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be huffman encoded and decoded')] public function testHuffman() : void { $huff = new Huffman(); diff --git a/tests/Utils/Encoding/XorEncodingTest.php b/tests/Utils/Encoding/XorEncodingTest.php index 0341d36b4..ac9474305 100755 --- a/tests/Utils/Encoding/XorEncodingTest.php +++ b/tests/Utils/Encoding/XorEncodingTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\Encoding; use phpOMS\Utils\Encoding\XorEncoding; /** - * @testdox phpOMS\tests\Utils\Encoding\XorEncodingTest: XOR text encoding/decoding - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Encoding\XorEncoding::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Encoding\XorEncodingTest: XOR text encoding/decoding')] final class XorEncodingTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Text can be encoded and decoded with the xor encoding - * @covers phpOMS\Utils\Encoding\XorEncoding - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Text can be encoded and decoded with the xor encoding')] public function testEncoding() : void { $test = XorEncoding::encode('This is a test.', 'abcd'); diff --git a/tests/Utils/Excel/ExcelTest.php b/tests/Utils/Excel/ExcelTest.php index 0554bdd5e..f418e2579 100755 --- a/tests/Utils/Excel/ExcelTest.php +++ b/tests/Utils/Excel/ExcelTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Utils/Git/AuthorTest.php b/tests/Utils/Git/AuthorTest.php index d8aa0ed3f..fdbb0dfb8 100755 --- a/tests/Utils/Git/AuthorTest.php +++ b/tests/Utils/Git/AuthorTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\Git; use phpOMS\Utils\Git\Author; /** - * @testdox phpOMS\tests\Utils\Git\AuthorTest: Git author - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Git\Author::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Git\AuthorTest: Git author')] final class AuthorTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The author has the expected default values after initialization - * @covers phpOMS\Utils\Git\Author - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The author has the expected default values after initialization')] public function testDefault() : void { $author = new Author(); @@ -38,11 +35,8 @@ final class AuthorTest extends \PHPUnit\Framework\TestCase self::assertEquals(0, $author->getRemovalCount()); } - /** - * @testdox The author name and email can be set during initialization and returned - * @covers phpOMS\Utils\Git\Author - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The author name and email can be set during initialization and returned')] public function testConstructInputOutput() : void { $author = new Author('test', 'email'); @@ -50,11 +44,8 @@ final class AuthorTest extends \PHPUnit\Framework\TestCase self::assertEquals('email', $author->getEmail()); } - /** - * @testdox The commit count can be set and returned - * @covers phpOMS\Utils\Git\Author - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The commit count can be set and returned')] public function testCommitCountInputOutput() : void { $author = new Author('test', 'email'); @@ -63,11 +54,8 @@ final class AuthorTest extends \PHPUnit\Framework\TestCase self::assertEquals(1, $author->getCommitCount()); } - /** - * @testdox The addition count can be set and returned - * @covers phpOMS\Utils\Git\Author - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The addition count can be set and returned')] public function testAdditionCountInputOutput() : void { $author = new Author('test', 'email'); @@ -76,11 +64,8 @@ final class AuthorTest extends \PHPUnit\Framework\TestCase self::assertEquals(2, $author->getAdditionCount()); } - /** - * @testdox The removal count can be set and returned - * @covers phpOMS\Utils\Git\Author - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The removal count can be set and returned')] public function testRemovalCountInputOutput() : void { $author = new Author('test', 'email'); diff --git a/tests/Utils/Git/BranchTest.php b/tests/Utils/Git/BranchTest.php index 64df618e0..f08e53147 100755 --- a/tests/Utils/Git/BranchTest.php +++ b/tests/Utils/Git/BranchTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,28 +17,22 @@ namespace phpOMS\tests\Utils\Git; use phpOMS\Utils\Git\Branch; /** - * @testdox phpOMS\tests\Utils\Git\BranchTest: Git branch - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Git\Branch::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Git\BranchTest: Git branch')] final class BranchTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The branch has the expected default values after initialization - * @covers phpOMS\Utils\Git\Branch - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The branch has the expected default values after initialization')] public function testDefault() : void { $branch = new Branch(); self::assertEquals('', $branch->name); } - /** - * @testdox The branch name can be set during initialization and returned - * @covers phpOMS\Utils\Git\Branch - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The branch name can be set during initialization and returned')] public function testConstructInputOutput() : void { $branch = new Branch('test'); diff --git a/tests/Utils/Git/CommitTest.php b/tests/Utils/Git/CommitTest.php index d17cfb4e7..049792c86 100755 --- a/tests/Utils/Git/CommitTest.php +++ b/tests/Utils/Git/CommitTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,17 +21,14 @@ use phpOMS\Utils\Git\Repository; use phpOMS\Utils\Git\Tag; /** - * @testdox phpOMS\tests\Utils\Git\CommitTest: Git commit - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Git\Commit::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Git\CommitTest: Git commit')] final class CommitTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The commit has the expected default values after initialization - * @covers phpOMS\Utils\Git\Commit - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The commit has the expected default values after initialization')] public function testDefault() : void { $commit = new Commit(); @@ -45,11 +42,8 @@ final class CommitTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\DateTime', $commit->getDate()); } - /** - * @testdox A file can be added and returned - * @covers phpOMS\Utils\Git\Commit - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be added and returned')] public function testFileInputOutput() : void { $commit = new Commit(); @@ -62,11 +56,8 @@ final class CommitTest extends \PHPUnit\Framework\TestCase ], $commit->getFiles()); } - /** - * @testdox A file can only be added one time - * @covers phpOMS\Utils\Git\Commit - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can only be added one time')] public function testInvalidOverwrite() : void { $commit = new Commit(); @@ -75,11 +66,8 @@ final class CommitTest extends \PHPUnit\Framework\TestCase self::assertFalse($commit->addFile('/some/file/path')); } - /** - * @testdox A file can be removed - * @covers phpOMS\Utils\Git\Commit - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A file can be removed')] public function testRemoveFile() : void { $commit = new Commit(); @@ -93,11 +81,8 @@ final class CommitTest extends \PHPUnit\Framework\TestCase ], $commit->getFiles()); } - /** - * @testdox A none-existing file cannot be removed - * @covers phpOMS\Utils\Git\Commit - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing file cannot be removed')] public function testInvalidRemoveFile() : void { $commit = new Commit(); @@ -105,11 +90,8 @@ final class CommitTest extends \PHPUnit\Framework\TestCase self::assertFalse($commit->removeFile('/some/file/path3')); } - /** - * @testdox A change can be added and returned - * @covers phpOMS\Utils\Git\Commit - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A change can be added and returned')] public function testChangeInputOutput() : void { $commit = new Commit(); @@ -126,11 +108,8 @@ final class CommitTest extends \PHPUnit\Framework\TestCase ], $commit->getFiles()); } - /** - * @testdox Adding the same change throws a Exception - * @covers phpOMS\Utils\Git\Commit - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Adding the same change throws a Exception')] public function testDuplicateLineChange() : void { $this->expectException(\Exception::class); @@ -140,11 +119,8 @@ final class CommitTest extends \PHPUnit\Framework\TestCase $commit->addChanges(__DIR__ . '/CommitTest.php', 1, 'getMessage()); } - /** - * @testdox The author can be set and returned - * @covers phpOMS\Utils\Git\Commit - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The author can be set and returned')] public function testAuthorInputOutput() : void { $commit = new Commit(); @@ -166,11 +139,8 @@ final class CommitTest extends \PHPUnit\Framework\TestCase self::assertEquals('Orange', $commit->getAuthor()->name); } - /** - * @testdox The branch can be set and returned - * @covers phpOMS\Utils\Git\Commit - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The branch can be set and returned')] public function testBranchInputOutput() : void { $commit = new Commit(); @@ -179,11 +149,8 @@ final class CommitTest extends \PHPUnit\Framework\TestCase self::assertEquals('develop', $commit->getBranch()->name); } - /** - * @testdox The tag can be set and returned - * @covers phpOMS\Utils\Git\Commit - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The tag can be set and returned')] public function testTagInputOutput() : void { $commit = new Commit(); @@ -192,11 +159,8 @@ final class CommitTest extends \PHPUnit\Framework\TestCase self::assertEquals('1.0.0', $commit->getTag()->name); } - /** - * @testdox The date can be set and returned - * @covers phpOMS\Utils\Git\Commit - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The date can be set and returned')] public function testDateInputOutput() : void { $commit = new Commit(); @@ -205,11 +169,8 @@ final class CommitTest extends \PHPUnit\Framework\TestCase self::assertEquals($date->format('Y-m-d'), $commit->getDate()->format('Y-m-d')); } - /** - * @testdox The repository can be set and returned - * @covers phpOMS\Utils\Git\Commit - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The repository can be set and returned')] public function testRepositoryInputOutput() : void { $commit = new Commit(); diff --git a/tests/Utils/Git/GitTest.php b/tests/Utils/Git/GitTest.php index 2e3b7518b..d19a4d09b 100755 --- a/tests/Utils/Git/GitTest.php +++ b/tests/Utils/Git/GitTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\Git; use phpOMS\Utils\Git\Git; /** - * @testdox phpOMS\tests\Utils\Git\GitTest: Git utilities - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Git\Git::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Git\GitTest: Git utilities')] final class GitTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The git path can be returned - * @covers phpOMS\Utils\Git\Git - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The git path can be returned')] public function testBinary() : void { self::assertEquals('/usr/bin/git', Git::getBin()); diff --git a/tests/Utils/Git/RepositoryTest.php b/tests/Utils/Git/RepositoryTest.php index ea4f1963b..8a5a3238f 100755 --- a/tests/Utils/Git/RepositoryTest.php +++ b/tests/Utils/Git/RepositoryTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\Git; use phpOMS\Utils\Git\Repository; /** - * @testdox phpOMS\tests\Utils\Git\RepositoryTest: Git repository - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Git\Repository::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Git\RepositoryTest: Git repository')] final class RepositoryTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The repository has the expected default values after initialization - * @covers phpOMS\Utils\Git\Repository - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The repository has the expected default values after initialization')] public function testDefault() : void { $repo = new Repository(\realpath(__DIR__ . '/../../../')); diff --git a/tests/Utils/Git/TagTest.php b/tests/Utils/Git/TagTest.php index 943136861..478c7df6a 100755 --- a/tests/Utils/Git/TagTest.php +++ b/tests/Utils/Git/TagTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\Git; use phpOMS\Utils\Git\Tag; /** - * @testdox phpOMS\tests\Utils\Git\TagTest: Git tag - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Git\Tag::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Git\TagTest: Git tag')] final class TagTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The tag has the expected default values after initialization - * @covers phpOMS\Utils\Git\Tag - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The tag has the expected default values after initialization')] public function testDefault() : void { $tag = new Tag(); @@ -35,22 +32,16 @@ final class TagTest extends \PHPUnit\Framework\TestCase self::assertEquals('', $tag->getName()); } - /** - * @testdox The tag name can be set during initialization and returned - * @covers phpOMS\Utils\Git\Tag - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The tag name can be set during initialization and returned')] public function testConstructorInputOutput() : void { $tag = new Tag('test'); self::assertEquals('test', $tag->getName()); } - /** - * @testdox The message can be set and returned - * @covers phpOMS\Utils\Git\Tag - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The message can be set and returned')] public function testMessageInputOutput() : void { $tag = new Tag('test'); diff --git a/tests/Utils/IO/Csv/CsvSettingsTest.php b/tests/Utils/IO/Csv/CsvSettingsTest.php index 7b3ef1b7c..7f36ad81a 100755 --- a/tests/Utils/IO/Csv/CsvSettingsTest.php +++ b/tests/Utils/IO/Csv/CsvSettingsTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\IO\Csv; use phpOMS\Utils\IO\Csv\CsvSettings; /** - * @testdox phpOMS\tests\Utils\IO\Csv\CsvSettingsTest: Csv file settings - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\IO\Csv\CsvSettings::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\IO\Csv\CsvSettingsTest: Csv file settings')] final class CsvSettingsTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The delimiter in a csv file can be guessed - * @covers phpOMS\Utils\IO\Csv\CsvSettings - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The delimiter in a csv file can be guessed')] public function testFileDelimiter() : void { self::assertEquals(':', CsvSettings::getFileDelimiter(\fopen(__DIR__ . '/colon.csv', 'r'))); @@ -36,11 +33,8 @@ final class CsvSettingsTest extends \PHPUnit\Framework\TestCase self::assertEquals(';', CsvSettings::getFileDelimiter(\fopen(__DIR__ . '/semicolon.csv', 'r'))); } - /** - * @testdox The delimiter in a csv string can be guessed - * @covers phpOMS\Utils\IO\Csv\CsvSettings - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The delimiter in a csv string can be guessed')] public function testStringDelimiter() : void { self::assertEquals(':', CsvSettings::getStringDelimiter(\file_get_contents(__DIR__ . '/colon.csv'))); diff --git a/tests/Utils/IO/IODatabaseMapperTest.php b/tests/Utils/IO/IODatabaseMapperTest.php index 91ce83998..3adee6336 100755 --- a/tests/Utils/IO/IODatabaseMapperTest.php +++ b/tests/Utils/IO/IODatabaseMapperTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Utils/IO/Json/InvalidJsonExceptionTest.php b/tests/Utils/IO/Json/InvalidJsonExceptionTest.php index d3c580b7c..94acf480c 100755 --- a/tests/Utils/IO/Json/InvalidJsonExceptionTest.php +++ b/tests/Utils/IO/Json/InvalidJsonExceptionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,12 +19,10 @@ use phpOMS\Utils\IO\Json\InvalidJsonException; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\IO\Json\InvalidJsonException::class)] final class InvalidJsonExceptionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Utils\IO\Json\InvalidJsonException - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testException() : void { self::assertInstanceOf(\UnexpectedValueException::class, new InvalidJsonException('')); diff --git a/tests/Utils/IO/Spreadsheet/SpreadsheetDatabaseMapperTest.php b/tests/Utils/IO/Spreadsheet/SpreadsheetDatabaseMapperTest.php index ceb645d00..90f54af6a 100755 --- a/tests/Utils/IO/Spreadsheet/SpreadsheetDatabaseMapperTest.php +++ b/tests/Utils/IO/Spreadsheet/SpreadsheetDatabaseMapperTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,10 +21,10 @@ use phpOMS\Utils\IO\Spreadsheet\SpreadsheetDatabaseMapper; use phpOMS\Utils\StringUtils; /** - * @testdox phpOMS\tests\Utils\IO\Spreadsheet\SpreadsheetDatabaseMapperTest: Spreadsheet database mapper - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\IO\Spreadsheet\SpreadsheetDatabaseMapper::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\IO\Spreadsheet\SpreadsheetDatabaseMapperTest: Spreadsheet database mapper')] final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase { protected $sqlite; @@ -68,11 +68,8 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase $this->sqlite->close(); } - /** - * @testdox Data can be inserted into a database from an ods files - * @covers phpOMS\Utils\IO\Spreadsheet\SpreadsheetDatabaseMapper - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be inserted into a database from an ods files')] public function testInsertOds() : void { $mapper = new SpreadsheetDatabaseMapper($this->sqlite, __DIR__ . '/insert.ods'); @@ -103,11 +100,8 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Data can be inserted into a database from a xls files - * @covers phpOMS\Utils\IO\Spreadsheet\SpreadsheetDatabaseMapper::insert - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be inserted into a database from a xls files')] public function testInsertXls() : void { $mapper = new SpreadsheetDatabaseMapper($this->sqlite, __DIR__ . '/insert.xls'); @@ -138,11 +132,8 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Data can be inserted into a database from a xlsx files - * @covers phpOMS\Utils\IO\Spreadsheet\SpreadsheetDatabaseMapper::insert - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be inserted into a database from a xlsx files')] public function testInsertXlsx() : void { $mapper = new SpreadsheetDatabaseMapper($this->sqlite, __DIR__ . '/insert.xlsx'); @@ -173,11 +164,8 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Data can be updated in a database from an ods files - * @covers phpOMS\Utils\IO\Spreadsheet\SpreadsheetDatabaseMapper::update - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be updated in a database from an ods files')] public function testUpdateOds() : void { $mapper = new SpreadsheetDatabaseMapper($this->sqlite, __DIR__ . '/insert.ods'); @@ -235,11 +223,8 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Data can be updated in a database from a xls files - * @covers phpOMS\Utils\IO\Spreadsheet\SpreadsheetDatabaseMapper::update - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be updated in a database from a xls files')] public function testUpdateXls() : void { $mapper = new SpreadsheetDatabaseMapper($this->sqlite, __DIR__ . '/insert.xls'); @@ -297,11 +282,8 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Data can be updated in a database from a xlsx files - * @covers phpOMS\Utils\IO\Spreadsheet\SpreadsheetDatabaseMapper::update - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be updated in a database from a xlsx files')] public function testUpdateXlsx() : void { $mapper = new SpreadsheetDatabaseMapper($this->sqlite, __DIR__ . '/insert.xlsx'); @@ -359,11 +341,8 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Data can be inserted into an ods files from a database - * @covers phpOMS\Utils\IO\Spreadsheet\SpreadsheetDatabaseMapper::select - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be inserted into an ods files from a database')] public function testSelectOds() : void { if (\is_file(__DIR__ . '/select.ods')) { @@ -411,11 +390,8 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox Data can be inserted into a xls files from a database - * @covers phpOMS\Utils\IO\Spreadsheet\SpreadsheetDatabaseMapper::select - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be inserted into a xls files from a database')] public function testSelectXls() : void { if (\is_file(__DIR__ . '/select.xls')) { @@ -463,11 +439,8 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox Data can be inserted into a xlsx files from a database - * @covers phpOMS\Utils\IO\Spreadsheet\SpreadsheetDatabaseMapper::select - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be inserted into a xlsx files from a database')] public function testSelectXlsx() : void { if (\is_file(__DIR__ . '/select.xlsx')) { @@ -515,9 +488,7 @@ final class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase } } - /** - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\CoversNothing] private function compareSelectInsertSheet(string $pathSelect, string $pathInsert) : bool { $reader1 = null; diff --git a/tests/Utils/IO/Zip/GzTest.php b/tests/Utils/IO/Zip/GzTest.php index 94c56f54b..85ca8f938 100755 --- a/tests/Utils/IO/Zip/GzTest.php +++ b/tests/Utils/IO/Zip/GzTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\IO\Zip; use phpOMS\Utils\IO\Zip\Gz; /** - * @testdox phpOMS\tests\Utils\IO\Zip\GzTest: Gz archive - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\IO\Zip\Gz::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\IO\Zip\GzTest: Gz archive')] final class GzTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Data can be gz packed and unpacked - * @covers phpOMS\Utils\IO\Zip\Gz - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be gz packed and unpacked')] public function testGz() : void { self::assertTrue(Gz::pack( @@ -49,11 +46,8 @@ final class GzTest extends \PHPUnit\Framework\TestCase \unlink(__DIR__ . '/test.gz'); } - /** - * @testdox A gz archive cannot be overwritten by default - * @covers phpOMS\Utils\IO\Zip\Gz - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A gz archive cannot be overwritten by default')] public function testInvalidGz() : void { Gz::pack( @@ -69,21 +63,15 @@ final class GzTest extends \PHPUnit\Framework\TestCase \unlink(__DIR__ . '/test.gz'); } - /** - * @testdox A none-existing source cannot be unpacked - * @covers phpOMS\Utils\IO\Zip\Gz - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing source cannot be unpacked')] public function testInvalidUnpackSource() : void { self::assertFalse(Gz::unpack(__DIR__ . '/test.gz', __DIR__ . '/test c.txt')); } - /** - * @testdox A destination cannot be overwritten - * @covers phpOMS\Utils\IO\Zip\Gz - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A destination cannot be overwritten')] public function testInvalidUnpackDestination() : void { self::assertTrue(Gz::pack( diff --git a/tests/Utils/IO/Zip/TarGzTest.php b/tests/Utils/IO/Zip/TarGzTest.php index 1b00f2fc6..a461b540f 100755 --- a/tests/Utils/IO/Zip/TarGzTest.php +++ b/tests/Utils/IO/Zip/TarGzTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,10 @@ namespace phpOMS\tests\Utils\IO\Zip; use phpOMS\Utils\IO\Zip\TarGz; /** - * @testdox phpOMS\tests\Utils\IO\Zip\TarGzTest: TarGz archive - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\IO\Zip\TarGz::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\IO\Zip\TarGzTest: TarGz archive')] final class TarGzTest extends \PHPUnit\Framework\TestCase { protected function setUp() : void @@ -32,11 +32,8 @@ final class TarGzTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox Data can be tar gz packed and unpacked - * @covers phpOMS\Utils\IO\Zip\TarGz - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be tar gz packed and unpacked')] public function testTarGz() : void { self::assertTrue(TarGz::pack( @@ -83,11 +80,8 @@ final class TarGzTest extends \PHPUnit\Framework\TestCase \unlink(__DIR__ . '/test.tar.gz'); } - /** - * @testdox A tar gz archive cannot be overwritten by default - * @covers phpOMS\Utils\IO\Zip\TarGz - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A tar gz archive cannot be overwritten by default')] public function testInvalidTarGz() : void { TarGz::pack( @@ -120,21 +114,15 @@ final class TarGzTest extends \PHPUnit\Framework\TestCase )); } - /** - * @testdox A none-existing source cannot be unpacked - * @covers phpOMS\Utils\IO\Zip\TarGz - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing source cannot be unpacked')] public function testInvalidUnpackSource() : void { self::assertFalse(TarGz::unpack(__DIR__ . '/test.tar.gz', __DIR__)); } - /** - * @testdox A destination cannot be overwritten - * @covers phpOMS\Utils\IO\Zip\TarGz - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A destination cannot be overwritten')] public function testInvalidUnpackDestination() : void { self::assertTrue(TarGz::pack( diff --git a/tests/Utils/IO/Zip/TarTest.php b/tests/Utils/IO/Zip/TarTest.php index 0e9bda0da..a92b0ff3c 100755 --- a/tests/Utils/IO/Zip/TarTest.php +++ b/tests/Utils/IO/Zip/TarTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,10 @@ namespace phpOMS\tests\Utils\IO\Zip; use phpOMS\Utils\IO\Zip\Tar; /** - * @testdox phpOMS\tests\Utils\IO\Zip\TarTest: Tar archive - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\IO\Zip\Tar::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\IO\Zip\TarTest: Tar archive')] final class TarTest extends \PHPUnit\Framework\TestCase { protected function setUp() : void @@ -36,11 +36,8 @@ final class TarTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox Data can be tar packed and unpacked - * @covers phpOMS\Utils\IO\Zip\Tar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be tar packed and unpacked')] public function testTar() : void { self::assertTrue(Tar::pack( @@ -111,11 +108,8 @@ final class TarTest extends \PHPUnit\Framework\TestCase self::assertFalse(Tar::unpack(__DIR__ . '/malformed.tar', __DIR__)); } - /** - * @testdox Extracting invalid tar files fail - * @covers phpOMS\Utils\IO\Zip\Tar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Extracting invalid tar files fail')] public function testInvalidTarUnpack() : void { self::assertFalse(Tar::unpack( @@ -129,11 +123,8 @@ final class TarTest extends \PHPUnit\Framework\TestCase )); } - /** - * @testdox A tar archive cannot be overwritten by default - * @covers phpOMS\Utils\IO\Zip\Tar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A tar archive cannot be overwritten by default')] public function testInvalidTar() : void { Tar::pack( @@ -157,21 +148,15 @@ final class TarTest extends \PHPUnit\Framework\TestCase \unlink(__DIR__ . '/test3.tar'); } - /** - * @testdox A none-existing source cannot be unpacked - * @covers phpOMS\Utils\IO\Zip\Tar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing source cannot be unpacked')] public function testInvalidUnpackSource() : void { self::assertFalse(Tar::unpack(__DIR__ . '/test.tar', __DIR__)); } - /** - * @testdox A destination cannot be overwritten - * @covers phpOMS\Utils\IO\Zip\Tar - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A destination cannot be overwritten')] public function testInvalidUnpackDestination() : void { self::assertTrue(Tar::pack( diff --git a/tests/Utils/IO/Zip/ZipTest.php b/tests/Utils/IO/Zip/ZipTest.php index f01fa8946..e7160577f 100755 --- a/tests/Utils/IO/Zip/ZipTest.php +++ b/tests/Utils/IO/Zip/ZipTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,10 +17,10 @@ namespace phpOMS\tests\Utils\IO\Zip; use phpOMS\Utils\IO\Zip\Zip; /** - * @testdox phpOMS\tests\Utils\IO\Zip\ZipTest: Zip archive - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\IO\Zip\Zip::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\IO\Zip\ZipTest: Zip archive')] final class ZipTest extends \PHPUnit\Framework\TestCase { protected function setUp() : void @@ -36,11 +36,8 @@ final class ZipTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox Data can be zip packed and unpacked - * @covers phpOMS\Utils\IO\Zip\Zip - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Data can be zip packed and unpacked')] public function testZip() : void { self::assertTrue(Zip::pack( @@ -107,11 +104,8 @@ final class ZipTest extends \PHPUnit\Framework\TestCase \unlink(__DIR__ . '/test.zip'); } - /** - * @testdox The output of the zip archive needs to be properly defined - * @covers phpOMS\Utils\IO\Zip\Zip - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The output of the zip archive needs to be properly defined')] public function testInvalidZipDestination() : void { self::assertFalse(Zip::pack( @@ -124,11 +118,8 @@ final class ZipTest extends \PHPUnit\Framework\TestCase )); } - /** - * @testdox Extracting invalid zip files fail - * @covers phpOMS\Utils\IO\Zip\Zip - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Extracting invalid zip files fail')] public function testInvalidZipUnpack() : void { self::assertFalse(Zip::unpack( @@ -142,11 +133,8 @@ final class ZipTest extends \PHPUnit\Framework\TestCase )); } - /** - * @testdox A zip archive cannot be overwritten by default - * @covers phpOMS\Utils\IO\Zip\Zip - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A zip archive cannot be overwritten by default')] public function testInvalidZip() : void { Zip::pack( @@ -175,21 +163,15 @@ final class ZipTest extends \PHPUnit\Framework\TestCase self::assertFalse(Zip::unpack(__DIR__ . '/malformed.zip', __DIR__)); } - /** - * @testdox A none-existing source cannot be unpacked - * @covers phpOMS\Utils\IO\Zip\Zip - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing source cannot be unpacked')] public function testInvalidUnpackSource() : void { self::assertFalse(Zip::unpack(__DIR__ . '/test.zip', __DIR__)); } - /** - * @testdox A destination cannot be overwritten - * @covers phpOMS\Utils\IO\Zip\Zip - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A destination cannot be overwritten')] public function testInvalidUnpackDestination() : void { self::assertTrue(Zip::pack( diff --git a/tests/Utils/ImageUtilsTest.php b/tests/Utils/ImageUtilsTest.php index fb8b84c33..4af6e9d5e 100755 --- a/tests/Utils/ImageUtilsTest.php +++ b/tests/Utils/ImageUtilsTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,10 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Utils\ImageUtils; /** - * @testdox phpOMS\tests\Utils\ImageUtilsTest: Image utilities - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\ImageUtils::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\ImageUtilsTest: Image utilities')] final class ImageUtilsTest extends \PHPUnit\Framework\TestCase { public function testLightness() : void @@ -43,10 +43,7 @@ final class ImageUtilsTest extends \PHPUnit\Framework\TestCase self::assertTrue(\is_file(__DIR__ . '/img/logo_resized.png')); } - /** - * @covers phpOMS\Utils\ImageUtils - * @group slow - */ + #[\PHPUnit\Framework\Attributes\Group('slow')] public function testDifference() : void { foreach (['png', 'gif'] as $type) { @@ -57,11 +54,8 @@ final class ImageUtilsTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox Base64 image data can be decoded to an image - * @covers phpOMS\Utils\ImageUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Base64 image data can be decoded to an image')] public function testImage() : void { self::assertEquals( diff --git a/tests/Utils/MbStringUtilsTest.php b/tests/Utils/MbStringUtilsTest.php index 9f7ff817c..c4582eced 100755 --- a/tests/Utils/MbStringUtilsTest.php +++ b/tests/Utils/MbStringUtilsTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,38 +19,29 @@ use phpOMS\Utils\MbStringUtils; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Utils\MbStringUtilsTest: Multi-Byte string utilities - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\MbStringUtils::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\MbStringUtilsTest: Multi-Byte string utilities')] final class MbStringUtilsTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The entropy of a string can be calculated - * @covers phpOMS\Utils\MbStringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The entropy of a string can be calculated')] public function testEntropy() : void { self::assertEqualsWithDelta(2.75, MbStringUtils::mb_entropy('akj@!©¥j'), 0.1); } - /** - * @testdox A string can be checked for multi-byte characters - * @covers phpOMS\Utils\MbStringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A string can be checked for multi-byte characters')] public function testHasMultiBytes() : void { self::assertTrue(MbStringUtils::hasMultiBytes('akj@!Â¥aj')); self::assertFalse(MbStringUtils::hasMultiBytes('akjc!aj')); } - /** - * @testdox A multi-byte string can be checked if it starts with a defined string - * @covers phpOMS\Utils\MbStringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A multi-byte string can be checked if it starts with a defined string')] public function testStartsMb() : void { $string = 'This is a test string.'; @@ -58,11 +49,8 @@ final class MbStringUtilsTest extends \PHPUnit\Framework\TestCase self::assertFalse(MbStringUtils::mb_startsWith($string, 'Thss ')); } - /** - * @testdox A multi-byte string can be checked if it ends with a defined string - * @covers phpOMS\Utils\MbStringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A multi-byte string can be checked if it ends with a defined string')] public function testEndsMb() : void { $string = 'This is a test string.'; @@ -70,33 +58,24 @@ final class MbStringUtilsTest extends \PHPUnit\Framework\TestCase self::assertFalse(MbStringUtils::mb_endsWith($string, 'strng.')); } - /** - * @testdox The first character of a multi-byte string can be turned into upper case - * @covers phpOMS\Utils\MbStringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The first character of a multi-byte string can be turned into upper case')] public function testTransformUpperCase() : void { self::assertEquals('This ', MbStringUtils::mb_ucfirst('this ')); self::assertNotEquals('this ', MbStringUtils::mb_ucfirst('this ')); } - /** - * @testdox The first character of a multi-byte string can be turned into lower case - * @covers phpOMS\Utils\MbStringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The first character of a multi-byte string can be turned into lower case')] public function testTransformLowerCase() : void { self::assertEquals('thss', MbStringUtils::mb_lcfirst('Thss')); self::assertNotEquals('Thss', MbStringUtils::mb_lcfirst('Thss')); } - /** - * @testdox A multi-byte string can be trimmed - * @covers phpOMS\Utils\MbStringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A multi-byte string can be trimmed')] public function testTrim() : void { $string = 'This is a test string.'; @@ -107,33 +86,24 @@ final class MbStringUtilsTest extends \PHPUnit\Framework\TestCase self::assertEquals('asdf', MbStringUtils::mb_trim('%asdf%', '%')); } - /** - * @testdox A multi-byte string can be right-trimmed - * @covers phpOMS\Utils\MbStringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A multi-byte string can be right-trimmed')] public function testRTrim() : void { self::assertEquals(' asdf', MbStringUtils::mb_rtrim(' asdf ')); self::assertEquals('%asdf', MbStringUtils::mb_rtrim('%asdf%', '%')); } - /** - * @testdox A multi-byte string can be left-trimmed - * @covers phpOMS\Utils\MbStringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A multi-byte string can be left-trimmed')] public function testLTrim() : void { self::assertEquals('asdf ', MbStringUtils::mb_ltrim(' asdf ')); self::assertEquals('asdf%', MbStringUtils::mb_ltrim('%asdf%', '%')); } - /** - * @testdox A multi-byte string can be checked if it contains at least one defined string element - * @covers phpOMS\Utils\MbStringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A multi-byte string can be checked if it contains at least one defined string element')] public function testContainsMb() : void { $string = 'This is a test string.'; @@ -142,21 +112,15 @@ final class MbStringUtilsTest extends \PHPUnit\Framework\TestCase self::assertFalse(MbStringUtils::mb_contains($string, ['iss', 'nothing', 'false'])); } - /** - * @testdox The characters of a multi-byte string can be counted - * @covers phpOMS\Utils\MbStringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The characters of a multi-byte string can be counted')] public function testCountMb() : void { self::assertEquals(5, MbStringUtils::mb_count_chars('αααααΕεΙιΜμΨψ')['α']); } - /** - * @testdox The previous boundary of a utf-8 encoded quoted printable is identified correctly - * @covers phpOMS\Utils\MbStringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The previous boundary of a utf-8 encoded quoted printable is identified correctly')] public function testUtf8CharBoundary() : void { self::assertEquals(10, MbStringUtils::utf8CharBoundary('H=E4tten H=FCte ein =DF im Namen, w=E4ren sie m=F6glicherweise k', 12)); diff --git a/tests/Utils/NumericUtilsTest.php b/tests/Utils/NumericUtilsTest.php index 92b970576..30c7ee5ea 100755 --- a/tests/Utils/NumericUtilsTest.php +++ b/tests/Utils/NumericUtilsTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ use phpOMS\Utils\NumericUtils; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Utils\NumericUtilsTest: Numeric utilities - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\NumericUtils::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\NumericUtilsTest: Numeric utilities')] final class NumericUtilsTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Integers can be unsigned right shifted - * @covers phpOMS\Utils\NumericUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Integers can be unsigned right shifted')] public function testShift() : void { self::assertEquals(10, NumericUtils::uRightShift(10, 0)); diff --git a/tests/Utils/PDF/PdfTest.php b/tests/Utils/PDF/PdfTest.php index a5a2c81da..324396b46 100755 --- a/tests/Utils/PDF/PdfTest.php +++ b/tests/Utils/PDF/PdfTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Utils/Parser/Calendar/ICalParserTest.php b/tests/Utils/Parser/Calendar/ICalParserTest.php index 64ddafac2..2ddbcbbdb 100644 --- a/tests/Utils/Parser/Calendar/ICalParserTest.php +++ b/tests/Utils/Parser/Calendar/ICalParserTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Utils/Parser/Document/DocumentWriterTest.php b/tests/Utils/Parser/Document/DocumentWriterTest.php index a6814807c..ba6f584a3 100644 --- a/tests/Utils/Parser/Document/DocumentWriterTest.php +++ b/tests/Utils/Parser/Document/DocumentWriterTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -24,6 +24,20 @@ use phpOMS\Utils\Parser\Document\DocumentWriter; */ final class DocumentWriterTest extends \PHPUnit\Framework\TestCase { + protected function setUp() : void + { + if (\is_file(__DIR__ . '/data/WordMpdf.pdf')) { + \unlink(__DIR__ . '/data/WordMpdf.pdf'); + } + } + + protected function tearDown() : void + { + if (\is_file(__DIR__ . '/data/WordMpdf.pdf')) { + \unlink(__DIR__ . '/data/WordMpdf.pdf'); + } + } + public function testParsing() : void { $doc = IOFactory::load(__DIR__ . '/data/Word.docx'); diff --git a/tests/Utils/Parser/Markdown/MarkdownTest.php b/tests/Utils/Parser/Markdown/MarkdownTest.php index 47a4c3c3c..390b603e9 100755 --- a/tests/Utils/Parser/Markdown/MarkdownTest.php +++ b/tests/Utils/Parser/Markdown/MarkdownTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -22,12 +22,10 @@ use phpOMS\Utils\Parser\Markdown\Markdown; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Parser\Markdown\Markdown::class)] final class MarkdownTest extends \PHPUnit\Framework\TestCase { - /** - * @covers phpOMS\Utils\Parser\Markdown\Markdown - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testParsing() : void { $files = Directory::list(__DIR__ . '/data'); diff --git a/tests/Utils/Parser/Php/ArrayParserTest.php b/tests/Utils/Parser/Php/ArrayParserTest.php index d7462db70..a6b5e8c55 100755 --- a/tests/Utils/Parser/Php/ArrayParserTest.php +++ b/tests/Utils/Parser/Php/ArrayParserTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -18,17 +18,14 @@ use phpOMS\Contract\SerializableInterface; use phpOMS\Utils\Parser\Php\ArrayParser; /** - * @testdox phpOMS\tests\Utils\Parser\Php\ArrayParserTest: Array data serializer as code - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Parser\Php\ArrayParser::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\Parser\Php\ArrayParserTest: Array data serializer as code')] final class ArrayParserTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox An array can be encoded and decoded as php code - * @covers phpOMS\Utils\Parser\Php\ArrayParser - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An array can be encoded and decoded as php code')] public function testParser() : void { $serializable = new class() implements SerializableInterface { @@ -72,11 +69,8 @@ final class ArrayParserTest extends \PHPUnit\Framework\TestCase self::assertEquals($expected, eval('return '. ArrayParser::serializeArray($array) . ';')); } - /** - * @testdox A value can be encoded and decoded into php code - * @covers phpOMS\Utils\Parser\Php\ArrayParser - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A value can be encoded and decoded into php code')] public function testInvalidValueType() : void { $this->expectException(\UnexpectedValueException::class); diff --git a/tests/Utils/Parser/Presentation/PresentationWriterTest.php b/tests/Utils/Parser/Presentation/PresentationWriterTest.php index eb4d87a60..f44e0f556 100644 --- a/tests/Utils/Parser/Presentation/PresentationWriterTest.php +++ b/tests/Utils/Parser/Presentation/PresentationWriterTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Utils/Parser/Spreadsheet/SpreadsheetWriterTest.php b/tests/Utils/Parser/Spreadsheet/SpreadsheetWriterTest.php index c8a869868..3238fc12f 100644 --- a/tests/Utils/Parser/Spreadsheet/SpreadsheetWriterTest.php +++ b/tests/Utils/Parser/Spreadsheet/SpreadsheetWriterTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -24,6 +24,20 @@ use phpOMS\Utils\Parser\Spreadsheet\SpreadsheetWriter; */ final class SpreadsheetWriterTest extends \PHPUnit\Framework\TestCase { + protected function setUp() : void + { + if (\is_file(__DIR__ . '/data/ExcelMpdf.pdf')) { + \unlink(__DIR__ . '/data/ExcelMpdf.pdf'); + } + } + + protected function tearDown() : void + { + if (\is_file(__DIR__ . '/data/ExcelMpdf.pdf')) { + \unlink(__DIR__ . '/data/ExcelMpdf.pdf'); + } + } + public function testParsing() : void { $sheet = IOFactory::load(__DIR__ . '/data/Excel.xlsx'); diff --git a/tests/Utils/PermutationTest.php b/tests/Utils/PermutationTest.php index b59391b55..5bd93d5c7 100755 --- a/tests/Utils/PermutationTest.php +++ b/tests/Utils/PermutationTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ use phpOMS\Utils\Permutation; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Utils\PermutationTest: Permutation utilities - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\Permutation::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\PermutationTest: Permutation utilities')] final class PermutationTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox An array can be permuted - * @covers phpOMS\Utils\Permutation - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An array can be permuted')] public function testPermuteAll() : void { $arr = ['a', 'b', 'c']; @@ -40,22 +37,16 @@ final class PermutationTest extends \PHPUnit\Framework\TestCase self::assertEquals($permutations2, Permutation::permuteAll($arr, [], false)); } - /** - * @testdox Two string can be checked if they are a permutation of each other - * @covers phpOMS\Utils\Permutation - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Two string can be checked if they are a permutation of each other')] public function testIsPermutation() : void { self::assertTrue(Permutation::isPermutation('abc', 'bca')); self::assertFalse(Permutation::isPermutation('abc', 'bda')); } - /** - * @testdox A string can be checked if it is a palindrome - * @covers phpOMS\Utils\Permutation - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A string can be checked if it is a palindrome')] public function testIsPalindrome() : void { self::assertTrue(Permutation::isPalindrome('abba')); @@ -63,21 +54,15 @@ final class PermutationTest extends \PHPUnit\Framework\TestCase self::assertFalse(Permutation::isPalindrome('abb1a')); } - /** - * @testdox An array can be permuted with a permutation key - * @covers phpOMS\Utils\Permutation - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An array can be permuted with a permutation key')] public function testPermuteBy() : void { self::assertEquals(['c', 'b', 'a'], Permutation::permuteByKey(['a', 'b', 'c'], [2, 1, 1])); } - /** - * @testdox A none-existing permutation key throws a OutOfBoundsException - * @covers phpOMS\Utils\Permutation - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing permutation key throws a OutOfBoundsException')] public function testWrongPermuteKeyLength() : void { $this->expectException(\OutOfBoundsException::class); diff --git a/tests/Utils/RnG/ArrayRandomizeTest.php b/tests/Utils/RnG/ArrayRandomizeTest.php index 8f1cd9217..18b97ea11 100755 --- a/tests/Utils/RnG/ArrayRandomizeTest.php +++ b/tests/Utils/RnG/ArrayRandomizeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\RnG; use phpOMS\Utils\RnG\ArrayRandomize; /** - * @testdox phpOMS\tests\Utils\RnG\ArrayRandomizeTest: Array randomizer - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\RnG\ArrayRandomize::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\RnG\ArrayRandomizeTest: Array randomizer')] final class ArrayRandomizeTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox An array can be randomized using the yates algorithm - * @covers phpOMS\Utils\RnG\ArrayRandomize - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An array can be randomized using the yates algorithm')] public function testYates() : void { $orig = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]; @@ -42,11 +39,8 @@ final class ArrayRandomizeTest extends \PHPUnit\Framework\TestCase self::assertTrue(false); } - /** - * @testdox An array can be randomized using the knuth algorithm - * @covers phpOMS\Utils\RnG\ArrayRandomize - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An array can be randomized using the knuth algorithm')] public function testKnuth() : void { $orig = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]; diff --git a/tests/Utils/RnG/DateTimeTest.php b/tests/Utils/RnG/DateTimeTest.php index 8f224fd9a..5a2673f60 100755 --- a/tests/Utils/RnG/DateTimeTest.php +++ b/tests/Utils/RnG/DateTimeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\RnG; use phpOMS\Utils\RnG\DateTime; /** - * @testdox phpOMS\tests\Utils\RnG\DateTimeTest: Date time randomizer - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\RnG\DateTime::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\RnG\DateTimeTest: Date time randomizer')] final class DateTimeTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A random date time can be generated - * @covers phpOMS\Utils\RnG\DateTime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A random date time can be generated')] public function testRnG() : void { for ($i = 0; $i < 100; ++$i) { diff --git a/tests/Utils/RnG/DistributionTypeTest.php b/tests/Utils/RnG/DistributionTypeTest.php index 10ae5c3fd..9ef9e7f9b 100755 --- a/tests/Utils/RnG/DistributionTypeTest.php +++ b/tests/Utils/RnG/DistributionTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Utils\RnG\DistributionType; */ final class DistributionTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(2, DistributionType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(DistributionType::getConstants(), \array_unique(DistributionType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(0, DistributionType::UNIFORM); diff --git a/tests/Utils/RnG/FileTest.php b/tests/Utils/RnG/FileTest.php index 88b04691e..7b080722d 100755 --- a/tests/Utils/RnG/FileTest.php +++ b/tests/Utils/RnG/FileTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\RnG; use phpOMS\Utils\RnG\File; /** - * @testdox phpOMS\tests\Utils\RnG\FileTest: File extension randomizer - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\RnG\File::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\RnG\FileTest: File extension randomizer')] final class FileTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A random file extension can be generated - * @covers phpOMS\Utils\RnG\File - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A random file extension can be generated')] public function testRnGExtension() : void { self::assertMatchesRegularExpression('/^[a-z0-9]{1,5}$/', File::generateExtension()); diff --git a/tests/Utils/RnG/LinearCongruentialGeneratorTest.php b/tests/Utils/RnG/LinearCongruentialGeneratorTest.php index 0cfedbe96..6efb9a7d8 100755 --- a/tests/Utils/RnG/LinearCongruentialGeneratorTest.php +++ b/tests/Utils/RnG/LinearCongruentialGeneratorTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,68 +17,50 @@ namespace phpOMS\tests\Utils\RnG; use phpOMS\Utils\RnG\LinearCongruentialGenerator; /** - * @testdox phpOMS\tests\Utils\RnG\LinearCongruentialGeneratorTest: Random number generator - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\RnG\LinearCongruentialGenerator::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\RnG\LinearCongruentialGeneratorTest: Random number generator')] final class LinearCongruentialGeneratorTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The bsd random number generator starts with the correct sequence - * @covers phpOMS\Utils\RnG\LinearCongruentialGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The bsd random number generator starts with the correct sequence')] public function testBsdRng() : void { self::assertEquals(12345, LinearCongruentialGenerator::bsd()); } - /** - * @testdox The same bsd seed generates the same random number - * @covers phpOMS\Utils\RnG\LinearCongruentialGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The same bsd seed generates the same random number')] public function testBsdRngEqual() : void { self::assertEquals(LinearCongruentialGenerator::bsd(1), LinearCongruentialGenerator::bsd(1)); } - /** - * @testdox Different bsd seeds generate different random numbers - * @covers phpOMS\Utils\RnG\LinearCongruentialGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different bsd seeds generate different random numbers')] public function testBsdRngNotEqual() : void { self::assertNotEquals(LinearCongruentialGenerator::bsd(0), LinearCongruentialGenerator::bsd(1)); } - /** - * @testdox The msvcrt random number generator starts with the correct sequence - * @covers phpOMS\Utils\RnG\LinearCongruentialGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The msvcrt random number generator starts with the correct sequence')] public function testMsRng() : void { self::assertEquals(38, LinearCongruentialGenerator::msvcrt()); self::assertEquals(7719, LinearCongruentialGenerator::msvcrt()); } - /** - * @testdox The same msvcrt seed generates the same random number - * @covers phpOMS\Utils\RnG\LinearCongruentialGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The same msvcrt seed generates the same random number')] public function testMsRngEqual() : void { self::assertEquals(LinearCongruentialGenerator::msvcrt(1), LinearCongruentialGenerator::msvcrt(1)); } - /** - * @testdox Different msvcrt seeds generate different random numbers - * @covers phpOMS\Utils\RnG\LinearCongruentialGenerator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different msvcrt seeds generate different random numbers')] public function testMsRngNotEqual() : void { self::assertNotEquals(LinearCongruentialGenerator::msvcrt(0), LinearCongruentialGenerator::msvcrt(1)); diff --git a/tests/Utils/RnG/NameTest.php b/tests/Utils/RnG/NameTest.php index a04a1009c..b774b0b92 100755 --- a/tests/Utils/RnG/NameTest.php +++ b/tests/Utils/RnG/NameTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\RnG; use phpOMS\Utils\RnG\Name; /** - * @testdox phpOMS\tests\Utils\RnG\NameTest: Random name generator - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\RnG\Name::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\RnG\NameTest: Random name generator')] final class NameTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Random female and male names can be generated - * @covers phpOMS\Utils\RnG\Name - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Random female and male names can be generated')] public function testRandom() : void { self::assertNotEquals(Name::generateName(['female']), Name::generateName(['male'])); diff --git a/tests/Utils/RnG/PhoneTest.php b/tests/Utils/RnG/PhoneTest.php index 0cec957ec..24efa337a 100755 --- a/tests/Utils/RnG/PhoneTest.php +++ b/tests/Utils/RnG/PhoneTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\RnG; use phpOMS\Utils\RnG\Phone; /** - * @testdox phpOMS\tests\Utils\RnG\PhoneTest: Random phone number generator - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\RnG\Phone::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\RnG\PhoneTest: Random phone number generator')] final class PhoneTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Random phone numbers can be generated - * @covers phpOMS\Utils\RnG\Phone - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Random phone numbers can be generated')] public function testRnG() : void { self::assertMatchesRegularExpression('/^\+\d{1,2} \(\d{3,4}\) \d{3,5}\-\d{3,8}$/', Phone::generatePhone()); diff --git a/tests/Utils/RnG/StringUtilsTest.php b/tests/Utils/RnG/StringUtilsTest.php index f1f4d6a93..dbcefcda9 100755 --- a/tests/Utils/RnG/StringUtilsTest.php +++ b/tests/Utils/RnG/StringUtilsTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,18 +17,17 @@ namespace phpOMS\tests\Utils\RnG; use phpOMS\Utils\RnG\StringUtils; /** - * @testdox phpOMS\tests\Utils\RnG\StringUtilsTest: Random string generator - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\RnG\StringUtils::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\RnG\StringUtilsTest: Random string generator')] final class StringUtilsTest extends \PHPUnit\Framework\TestCase { /** - * @testdox Random strings can be generated - * @covers phpOMS\Utils\RnG\StringUtils * @slowThreshold 1500 - * @group framework */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Random strings can be generated')] public function testStrings() : void { $haystack = []; diff --git a/tests/Utils/RnG/TextTest.php b/tests/Utils/RnG/TextTest.php index 3dc45aa70..13a366035 100755 --- a/tests/Utils/RnG/TextTest.php +++ b/tests/Utils/RnG/TextTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\RnG; use phpOMS\Utils\RnG\Text; /** - * @testdox phpOMS\tests\Utils\RnG\TextTest: Random text generator - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\RnG\Text::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\RnG\TextTest: Random text generator')] final class TextTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Random text can be generated - * @covers phpOMS\Utils\RnG\Text - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Random text can be generated')] public function testRnG() : void { $text = new Text(true, true); diff --git a/tests/Utils/StringCompareTest.php b/tests/Utils/StringCompareTest.php index 265378e30..7dd7088e4 100755 --- a/tests/Utils/StringCompareTest.php +++ b/tests/Utils/StringCompareTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,10 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Utils\StringCompare; /** - * @testdox phpOMS\tests\Utils\StringCompareTest: String comparison / dictionary - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\StringCompare::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\StringCompareTest: String comparison / dictionary')] final class StringCompareTest extends \PHPUnit\Framework\TestCase { private StringCompare $dict; @@ -52,43 +52,31 @@ final class StringCompareTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox A string can be matched with a dictionary entry - * @covers phpOMS\Utils\StringCompare - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A string can be matched with a dictionary entry')] public function testDictionaryMatch() : void { self::assertEquals('Cartoon', $this->dict->matchDictionary('Carton')); self::assertEquals('Bathtub Sidewalk Table', $this->dict->matchDictionary('Sidewalk Table')); } - /** - * @testdox A string doesn't match a dictionary entry if it is very different - * @covers phpOMS\Utils\StringCompare - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A string doesn't match a dictionary entry if it is very different")] public function testInvalidDictionary() : void { self::assertNotEquals('Snowflake Bathtub Snowflake Toothbrush Sidewalk', $this->dict->matchDictionary('Toothbrush')); } - /** - * @testdox A new dictionary entry can be created and returned - * @covers phpOMS\Utils\StringCompare - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A new dictionary entry can be created and returned')] public function testDictionaryAdd() : void { $this->dict->add('Carton'); self::assertEquals('Carton', $this->dict->matchDictionary('carton')); } - /** - * @testdox Two texts can be compared on a per word basis for similarity - * @covers phpOMS\Utils\StringCompare - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Two texts can be compared on a per word basis for similarity')] public function testValueWords() : void { // every word in s1 is found in s2, therefore a "perfect" match @@ -98,10 +86,7 @@ final class StringCompareTest extends \PHPUnit\Framework\TestCase self::assertEquals(2, StringCompare::valueWords('This is a test', 'This is not test')); } - /** - * @covers phpOMS\Utils\StringCompare - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testJaro() : void { self::assertEqualsWithDelta(0.944444, StringCompare::jaro('MARTHA', 'MARHTA'), 0.01); @@ -109,10 +94,7 @@ final class StringCompareTest extends \PHPUnit\Framework\TestCase self::assertEqualsWithDelta(0.896296, StringCompare::jaro('JELLYFISH', 'SMELLYFISH'), 0.01); } - /** - * @covers phpOMS\Utils\StringCompare - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testJaroEmpty() : void { self::assertEquals(1.0, StringCompare::jaro('', '')); diff --git a/tests/Utils/StringUtilsTest.php b/tests/Utils/StringUtilsTest.php index 742066d88..858c9660a 100755 --- a/tests/Utils/StringUtilsTest.php +++ b/tests/Utils/StringUtilsTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,27 +21,21 @@ use phpOMS\Utils\StringUtils; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Utils\StringUtilsTest: String utilities - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\StringUtils::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\StringUtilsTest: String utilities')] final class StringUtilsTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The entropy of a string can be calculated - * @covers phpOMS\Utils\StringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The entropy of a string can be calculated')] public function testEntropy() : void { self::assertEqualsWithDelta(2.5, StringUtils::entropy('akj@!0aj'), 0.1); } - /** - * @testdox A string can be checked if it starts with a defined string - * @covers phpOMS\Utils\StringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A string can be checked if it starts with a defined string')] public function testStarts() : void { $string = 'This is a test string.'; @@ -49,11 +43,8 @@ final class StringUtilsTest extends \PHPUnit\Framework\TestCase self::assertFalse(StringUtils::startsWith($string, 'Thss ')); } - /** - * @testdox A string can be checked if it ends with a defined string - * @covers phpOMS\Utils\StringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A string can be checked if it ends with a defined string')] public function testEnds() : void { $string = 'This is a test string.'; @@ -61,11 +52,8 @@ final class StringUtilsTest extends \PHPUnit\Framework\TestCase self::assertFalse(StringUtils::endsWith($string, 'strng.')); } - /** - * @testdox A string can be checked if it contains at least one defined string element - * @covers phpOMS\Utils\StringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A string can be checked if it contains at least one defined string element')] public function testContains() : void { $string = 'This is a test string.'; @@ -74,52 +62,37 @@ final class StringUtilsTest extends \PHPUnit\Framework\TestCase self::assertFalse(StringUtils::contains($string, ['iss', 'nothing', 'false'])); } - /** - * @testdox The amount of a defined characters in the beginning of a string can be counted - * @covers phpOMS\Utils\StringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The amount of a defined characters in the beginning of a string can be counted')] public function testCountBeginning() : void { self::assertEquals(4, StringUtils::countCharacterFromStart(' Test string', ' ')); self::assertEquals(0, StringUtils::countCharacterFromStart(' Test string', 's')); } - /** - * @testdox A string creates a integer hash - * @covers phpOMS\Utils\StringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A string creates a integer hash')] public function testIntHash() : void { self::assertGreaterThan(0, StringUtils::intHash('test')); } - /** - * @testdox The same string creates the same hash - * @covers phpOMS\Utils\StringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The same string creates the same hash')] public function testSameHash() : void { self::assertEquals(StringUtils::intHash('test'), StringUtils::intHash('test')); } - /** - * @testdox Different strings create different hashes - * @covers phpOMS\Utils\StringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Different strings create different hashes')] public function testDifferentHash() : void { self::assertNotEquals(StringUtils::intHash('test1'), StringUtils::intHash('test2')); } - /** - * @testdox Various data types can be stringified - * @covers phpOMS\Utils\StringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Various data types can be stringified')] public function testStringify() : void { self::assertEquals('"abc"', StringUtils::stringify(new class() implements \JsonSerializable { @@ -167,21 +140,15 @@ final class StringUtilsTest extends \PHPUnit\Framework\TestCase })); } - /** - * @testdox Stringify/rendering a unknown data type returns null - * @covers phpOMS\Utils\StringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Stringify/rendering a unknown data type returns null')] public function testInvalidStringify() : void { self::assertNull(StringUtils::stringify(new class() {})); } - /** - * @testdox The difference between two strings can be evaluated - * @covers phpOMS\Utils\StringUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The difference between two strings can be evaluated')] public function testStringDiffHtml() : void { $original = 'This is a test string.'; diff --git a/tests/Utils/TaskSchedule/CronJobTest.php b/tests/Utils/TaskSchedule/CronJobTest.php index c6a49520d..e29f2e65f 100755 --- a/tests/Utils/TaskSchedule/CronJobTest.php +++ b/tests/Utils/TaskSchedule/CronJobTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\TaskSchedule; use phpOMS\Utils\TaskSchedule\CronJob; /** - * @testdox phpOMS\tests\Utils\TaskSchedule\CronJobTest: Cron job - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\TaskSchedule\CronJob::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\TaskSchedule\CronJobTest: Cron job')] final class CronJobTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The cron job has the expected default values after initialization - * @covers phpOMS\Utils\TaskSchedule\CronJob - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The cron job has the expected default values after initialization')] public function testDefault() : void { $job = new CronJob(''); @@ -35,11 +32,8 @@ final class CronJobTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\phpOMS\Utils\TaskSchedule\TaskAbstract', $job); } - /** - * @testdox A cron job can be created from an array and rendered - * @covers phpOMS\Utils\TaskSchedule\CronJob - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A cron job can be created from an array and rendered')] public function testCreateJobWithData() : void { $job = CronJob::createWith(['testname', '*', '*', '*', '*', '*', 'testcmd']); diff --git a/tests/Utils/TaskSchedule/CronTest.php b/tests/Utils/TaskSchedule/CronTest.php index 3e07c71ee..4952964bc 100755 --- a/tests/Utils/TaskSchedule/CronTest.php +++ b/tests/Utils/TaskSchedule/CronTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,10 @@ use phpOMS\Utils\TaskSchedule\CronJob; use phpOMS\Utils\TaskSchedule\SchedulerAbstract; /** - * @testdox phpOMS\tests\Utils\TaskSchedule\CronTest: Cron handler - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\TaskSchedule\Cron::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\TaskSchedule\CronTest: Cron handler')] final class CronTest extends \PHPUnit\Framework\TestCase { protected function setUp() : void @@ -50,32 +50,22 @@ final class CronTest extends \PHPUnit\Framework\TestCase } // * * * * * echo "test" > __DIR__ . '/cronjob.log' // evaluate dir - - /** - * @testdox The cron handler has the expected default values after initialization - * @covers phpOMS\Utils\TaskSchedule\Cron - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The cron handler has the expected default values after initialization')] public function testDefault() : void { self::assertInstanceOf('\phpOMS\Utils\TaskSchedule\SchedulerAbstract', new Cron()); } - /** - * @testdox The cron binary location path can be guessed - * @covers phpOMS\Utils\TaskSchedule\Cron - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The cron binary location path can be guessed')] public function testGuessBinary() : void { self::assertTrue(Cron::guessBin()); } - /** - * @testdox A cron job can be created and returned - * @covers phpOMS\Utils\TaskSchedule\Cron - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A cron job can be created and returned')] public function testCronJobInputOutput() : void { $cron = new Cron(); @@ -90,22 +80,16 @@ final class CronTest extends \PHPUnit\Framework\TestCase $cron->delete($job); } - /** - * @testdox A none-existing cron name cannot be returned - * @covers phpOMS\Utils\TaskSchedule\Cron - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing cron name cannot be returned')] public function testInvalidCronJobName() : void { $cron = new Cron(); self::assertEquals([], $cron->getAllByName('testCronJob', false)); } - /** - * @testdox A cron job can be updated - * @covers phpOMS\Utils\TaskSchedule\Cron - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A cron job can be updated')] public function testCronJobUpdate() : void { $cron = new Cron(); @@ -123,11 +107,8 @@ final class CronTest extends \PHPUnit\Framework\TestCase $cron->delete($job); } - /** - * @testdox A cron job can be deleted - * @covers phpOMS\Utils\TaskSchedule\Cron - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A cron job can be deleted')] public function testDelete() : void { $cron = new Cron(); diff --git a/tests/Utils/TaskSchedule/IntervalTest.php b/tests/Utils/TaskSchedule/IntervalTest.php index 6b4e1cc65..50601cf06 100755 --- a/tests/Utils/TaskSchedule/IntervalTest.php +++ b/tests/Utils/TaskSchedule/IntervalTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\TaskSchedule; use phpOMS\Utils\TaskSchedule\Interval; /** - * @testdox phpOMS\tests\Utils\TaskSchedule\IntervalTest: Cron interval - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\TaskSchedule\Interval::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\TaskSchedule\IntervalTest: Cron interval')] final class IntervalTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The interval has the expected default values after initialization - * @covers phpOMS\Utils\TaskSchedule\Interval - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The interval has the expected default values after initialization')] public function testDefault() : void { $dt = new \DateTime('now'); @@ -55,22 +52,16 @@ final class IntervalTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox The start date can be set during initialization and returned - * @covers phpOMS\Utils\TaskSchedule\Interval - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The start date can be set during initialization and returned')] public function testConstructorInputOutput() : void { $interval = new Interval(new \DateTime('2001-11-25')); self::assertEquals('2001-11-25', $interval->getStart()->format('Y-m-d')); } - /** - * @testdox The start date can set and returned - * @covers phpOMS\Utils\TaskSchedule\Interval - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The start date can set and returned')] public function testStartInputOutput() : void { $interval = new Interval(new \DateTime('2001-11-25')); @@ -79,11 +70,8 @@ final class IntervalTest extends \PHPUnit\Framework\TestCase self::assertEquals('2015-08-14', $interval->getStart()->format('Y-m-d')); } - /** - * @testdox The end date can set and returned - * @covers phpOMS\Utils\TaskSchedule\Interval - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The end date can set and returned')] public function testEndInputOutput() : void { $interval = new Interval(new \DateTime('2001-11-25')); @@ -92,11 +80,8 @@ final class IntervalTest extends \PHPUnit\Framework\TestCase self::assertEquals('2018-10-30', $interval->getEnd()->format('Y-m-d')); } - /** - * @testdox The maximum execution duration can set and returned - * @covers phpOMS\Utils\TaskSchedule\Interval - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The maximum execution duration can set and returned')] public function testMaxExecutionInputOutput() : void { $interval = new Interval(new \DateTime('2001-11-25')); @@ -105,11 +90,8 @@ final class IntervalTest extends \PHPUnit\Framework\TestCase self::assertEquals(30, $interval->getMaxDuration()); } - /** - * @testdox An execution minute can be added and returned - * @covers phpOMS\Utils\TaskSchedule\Interval - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An execution minute can be added and returned')] public function testMinuteInputOutput() : void { $interval = new Interval(new \DateTime('2001-11-25')); @@ -122,11 +104,8 @@ final class IntervalTest extends \PHPUnit\Framework\TestCase ]], $interval->getMinute()); } - /** - * @testdox An execution minute can be overwritten - * @covers phpOMS\Utils\TaskSchedule\Interval - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An execution minute can be overwritten')] public function testMinuteOverwriteInputOutput() : void { $interval = new Interval(new \DateTime('2001-11-25')); @@ -140,11 +119,8 @@ final class IntervalTest extends \PHPUnit\Framework\TestCase ]], $interval->getMinute()); } - /** - * @testdox An execution hour can be added and returned - * @covers phpOMS\Utils\TaskSchedule\Interval - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An execution hour can be added and returned')] public function testHourInputOutput() : void { $interval = new Interval(new \DateTime('2001-11-25')); @@ -157,11 +133,8 @@ final class IntervalTest extends \PHPUnit\Framework\TestCase ]], $interval->getHour()); } - /** - * @testdox An execution hour can be overwritten - * @covers phpOMS\Utils\TaskSchedule\Interval - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An execution hour can be overwritten')] public function testHourOverwriteInputOutput() : void { $interval = new Interval(new \DateTime('2001-11-25')); @@ -175,11 +148,8 @@ final class IntervalTest extends \PHPUnit\Framework\TestCase ]], $interval->getHour()); } - /** - * @testdox An execution year can be added and returned - * @covers phpOMS\Utils\TaskSchedule\Interval - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An execution year can be added and returned')] public function testYearInputOutput() : void { $interval = new Interval(new \DateTime('2001-11-25')); @@ -192,11 +162,8 @@ final class IntervalTest extends \PHPUnit\Framework\TestCase ]], $interval->getYear()); } - /** - * @testdox An execution year can be overwritten - * @covers phpOMS\Utils\TaskSchedule\Interval - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An execution year can be overwritten')] public function testYearOverwriteInputOutput() : void { $interval = new Interval(new \DateTime('2001-11-25')); @@ -210,11 +177,8 @@ final class IntervalTest extends \PHPUnit\Framework\TestCase ]], $interval->getYear()); } - /** - * @testdox An execution day of month can be added and returned - * @covers phpOMS\Utils\TaskSchedule\Interval - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An execution day of month can be added and returned')] public function testDayOfMonthInputOutput() : void { $interval = new Interval(new \DateTime('2001-11-25')); @@ -227,11 +191,8 @@ final class IntervalTest extends \PHPUnit\Framework\TestCase ]], $interval->getDayOfMonth()); } - /** - * @testdox An execution day of month can be overwritten - * @covers phpOMS\Utils\TaskSchedule\Interval - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An execution day of month can be overwritten')] public function testDayOfMonthOverwriteInputOutput() : void { $interval = new Interval(new \DateTime('2001-11-25')); @@ -245,11 +206,8 @@ final class IntervalTest extends \PHPUnit\Framework\TestCase ]], $interval->getDayOfMonth()); } - /** - * @testdox An execution day of week can be added and returned - * @covers phpOMS\Utils\TaskSchedule\Interval - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An execution day of week can be added and returned')] public function testDayOfWeekInputOutput() : void { $interval = new Interval(new \DateTime('2001-11-25')); @@ -262,11 +220,8 @@ final class IntervalTest extends \PHPUnit\Framework\TestCase ]], $interval->getDayOfWeek()); } - /** - * @testdox An execution day of week can be overwritten - * @covers phpOMS\Utils\TaskSchedule\Interval - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('An execution day of week can be overwritten')] public function testDayOfWeekOverwriteInputOutput() : void { $interval = new Interval(new \DateTime('2001-11-25')); @@ -280,11 +235,8 @@ final class IntervalTest extends \PHPUnit\Framework\TestCase ]], $interval->getDayOfWeek()); } - /** - * @testdox A interval can be serialized - * @covers phpOMS\Utils\TaskSchedule\Interval - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A interval can be serialized')] public function testSerialize() : void { $interval = new Interval(new \DateTime('2001-11-25')); @@ -310,11 +262,8 @@ final class IntervalTest extends \PHPUnit\Framework\TestCase ]), $interval->serialize()); } - /** - * @testdox A serialized interval can be unserialized - * @covers phpOMS\Utils\TaskSchedule\Interval - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A serialized interval can be unserialized')] public function testUnserialize() : void { $interval = new Interval(); diff --git a/tests/Utils/TaskSchedule/ScheduleTest.php b/tests/Utils/TaskSchedule/ScheduleTest.php index e5bacad7e..3712960ef 100755 --- a/tests/Utils/TaskSchedule/ScheduleTest.php +++ b/tests/Utils/TaskSchedule/ScheduleTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Utils\TaskSchedule; use phpOMS\Utils\TaskSchedule\Schedule; /** - * @testdox phpOMS\tests\Utils\TaskSchedule\ScheduleTest: Schedule/task - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\TaskSchedule\Schedule::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\TaskSchedule\ScheduleTest: Schedule/task')] final class ScheduleTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The task has the expected default values after initialization - * @covers phpOMS\Utils\TaskSchedule\Schedule - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The task has the expected default values after initialization')] public function testDefault() : void { $job = new Schedule(''); @@ -35,12 +32,8 @@ final class ScheduleTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\phpOMS\Utils\TaskSchedule\TaskAbstract', $job); } - /** - * @testdox A task can be created from an array and rendered - * @covers phpOMS\Utils\TaskSchedule\Schedule - * - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A task can be created from an array and rendered')] public function testCreateJobWithData() : void { $job = Schedule::createWith(['hostname', 'testname', '2018-06-02', 'Ready', 'Background', 'N/A', '1', 'INTERVAL', 'testcmd', '/var/usr', 'comment']); diff --git a/tests/Utils/TaskSchedule/SchedulerAbstractTest.php b/tests/Utils/TaskSchedule/SchedulerAbstractTest.php index 2fddfc2b9..122c1b590 100755 --- a/tests/Utils/TaskSchedule/SchedulerAbstractTest.php +++ b/tests/Utils/TaskSchedule/SchedulerAbstractTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,27 +17,21 @@ namespace phpOMS\tests\Utils\TaskSchedule; use phpOMS\Utils\TaskSchedule\SchedulerAbstract; /** - * @testdox phpOMS\tests\Utils\TaskSchedule\SchedulerAbstractTest: Scheduler abstraction - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\TaskSchedule\SchedulerAbstract::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\TaskSchedule\SchedulerAbstractTest: Scheduler abstraction')] final class SchedulerAbstractTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The scheduler has the expected default values after initialization - * @covers phpOMS\Utils\TaskSchedule\SchedulerAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The scheduler has the expected default values after initialization')] public function testDefault() : void { self::assertTrue(SchedulerAbstract::getBin() === '' || \is_file(SchedulerAbstract::getBin())); } - /** - * @testdox The scheduler binary location path can be guessed - * @covers phpOMS\Utils\TaskSchedule\SchedulerAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The scheduler binary location path can be guessed')] public function testGuessBinary() : void { self::assertTrue(SchedulerAbstract::guessBin()); diff --git a/tests/Utils/TaskSchedule/SchedulerFactoryTest.php b/tests/Utils/TaskSchedule/SchedulerFactoryTest.php index d68c434c4..e1db51cac 100755 --- a/tests/Utils/TaskSchedule/SchedulerFactoryTest.php +++ b/tests/Utils/TaskSchedule/SchedulerFactoryTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ use phpOMS\Utils\TaskSchedule\SchedulerFactory; use phpOMS\Utils\TaskSchedule\TaskScheduler; /** - * @testdox phpOMS\tests\Utils\TaskSchedule\SchedulerFactoryTest: Scheduler factory for creating cron/task handlers - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\TaskSchedule\SchedulerFactory::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\TaskSchedule\SchedulerFactoryTest: Scheduler factory for creating cron/task handlers')] final class SchedulerFactoryTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The correct scheduler is crated depending on the operating system - * @covers phpOMS\Utils\TaskSchedule\SchedulerFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The correct scheduler is crated depending on the operating system')] public function testCreate() : void { self::assertTrue((SchedulerFactory::create() instanceof Cron) || (SchedulerFactory::create() instanceof TaskScheduler)); diff --git a/tests/Utils/TaskSchedule/TaskAbstractTest.php b/tests/Utils/TaskSchedule/TaskAbstractTest.php index 31f8ab72f..dedc070c9 100755 --- a/tests/Utils/TaskSchedule/TaskAbstractTest.php +++ b/tests/Utils/TaskSchedule/TaskAbstractTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,10 @@ use phpOMS\Utils\TaskSchedule\TaskFactory; use phpOMS\Utils\TaskSchedule\TaskStatus; /** - * @testdox phpOMS\tests\Utils\TaskSchedule\TaskAbstractTest: Job/task abstraction - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\TaskSchedule\TaskAbstract::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\TaskSchedule\TaskAbstractTest: Job/task abstraction')] final class TaskAbstractTest extends \PHPUnit\Framework\TestCase { private TaskAbstract $class; @@ -45,11 +45,8 @@ final class TaskAbstractTest extends \PHPUnit\Framework\TestCase }; } - /** - * @testdox The task abstraction has the expected default values after initialization - * @covers phpOMS\Utils\TaskSchedule\TaskAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The task abstraction has the expected default values after initialization')] public function testDefault() : void { self::assertEquals('', $this->class->getId()); @@ -61,44 +58,32 @@ final class TaskAbstractTest extends \PHPUnit\Framework\TestCase self::assertEquals('', $this->class->getInterval()); } - /** - * @testdox The command can be set and returned - * @covers phpOMS\Utils\TaskSchedule\TaskAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The command can be set and returned')] public function testCommandInputOutput() : void { $this->class->setCommand('Command'); self::assertEquals('Command', $this->class->getCommand()); } - /** - * @testdox The interval can be set and returned - * @covers phpOMS\Utils\TaskSchedule\TaskAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The interval can be set and returned')] public function testIntervalInputOutput() : void { $this->class->setInterval('Interval'); self::assertEquals('Interval', $this->class->getInterval()); } - /** - * @testdox The comment can be set and returned - * @covers phpOMS\Utils\TaskSchedule\TaskAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The comment can be set and returned')] public function testCommentInputOutput() : void { $this->class->setComment('Comment'); self::assertEquals('Comment', $this->class->getComment()); } - /** - * @testdox The last runtime can be set and returned - * @covers phpOMS\Utils\TaskSchedule\TaskAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The last runtime can be set and returned')] public function testLastRuntimeInputOutput() : void { $date = new \DateTime('now'); @@ -106,11 +91,8 @@ final class TaskAbstractTest extends \PHPUnit\Framework\TestCase self::assertEquals($date->format('Y-m-d'), $this->class->getLastRuntime()->format('Y-m-d')); } - /** - * @testdox The next runtime can be set and returned - * @covers phpOMS\Utils\TaskSchedule\TaskAbstract - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The next runtime can be set and returned')] public function testNextRuntimeInputOutput() : void { $date = new \DateTime('now'); diff --git a/tests/Utils/TaskSchedule/TaskFactoryTest.php b/tests/Utils/TaskSchedule/TaskFactoryTest.php index 81c41c2ae..1d34202d2 100755 --- a/tests/Utils/TaskSchedule/TaskFactoryTest.php +++ b/tests/Utils/TaskSchedule/TaskFactoryTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ use phpOMS\Utils\TaskSchedule\Schedule; use phpOMS\Utils\TaskSchedule\TaskFactory; /** - * @testdox phpOMS\tests\Utils\TaskSchedule\TaskFactoryTest: Task factory for creating cron jobs/tasks - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\TaskSchedule\TaskFactory::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\TaskSchedule\TaskFactoryTest: Task factory for creating cron jobs/tasks')] final class TaskFactoryTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The correct task is crated depending on the operating system - * @covers phpOMS\Utils\TaskSchedule\TaskFactory - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The correct task is crated depending on the operating system')] public function testFactory() : void { self::assertTrue((TaskFactory::create() instanceof CronJob) || (TaskFactory::create() instanceof Schedule)); diff --git a/tests/Utils/TaskSchedule/TaskSchedulerTest.php b/tests/Utils/TaskSchedule/TaskSchedulerTest.php index d630e56d4..7c2f39ac5 100755 --- a/tests/Utils/TaskSchedule/TaskSchedulerTest.php +++ b/tests/Utils/TaskSchedule/TaskSchedulerTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,10 +19,10 @@ use phpOMS\Utils\TaskSchedule\SchedulerAbstract; use phpOMS\Utils\TaskSchedule\TaskScheduler; /** - * @testdox phpOMS\tests\Utils\TaskSchedule\TaskSchedulerTest: Task schedule handler - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\TaskSchedule\TaskScheduler::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\TaskSchedule\TaskSchedulerTest: Task schedule handler')] final class TaskSchedulerTest extends \PHPUnit\Framework\TestCase { protected function setUp() : void @@ -40,31 +40,22 @@ final class TaskSchedulerTest extends \PHPUnit\Framework\TestCase } } - /** - * @testdox The task handler has the expected default values after initialization - * @covers phpOMS\Utils\TaskSchedule\TaskScheduler - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The task handler has the expected default values after initialization')] public function testDefault() : void { self::assertInstanceOf('\phpOMS\Utils\TaskSchedule\SchedulerAbstract', new TaskScheduler()); } - /** - * @testdox The task binary location path can be guessed - * @covers phpOMS\Utils\TaskSchedule\TaskScheduler - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The task binary location path can be guessed')] public function testGuessBinary() : void { self::assertTrue(TaskScheduler::guessBin()); } - /** - * @testdox A task can be created and returned - * @covers phpOMS\Utils\TaskSchedule\TaskScheduler - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A task can be created and returned')] public function testTaskScheduleInputOutput() : void { $task = new TaskScheduler(); @@ -79,22 +70,16 @@ final class TaskSchedulerTest extends \PHPUnit\Framework\TestCase $task->delete($job); } - /** - * @testdox A none-existing task name cannot be returned - * @covers phpOMS\Utils\TaskSchedule\TaskScheduler - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing task name cannot be returned')] public function testInvalidTaskScheduleName() : void { $task = new TaskScheduler(); self::assertEquals([], $task->getAllByName('testTaskSchedule', false)); } - /** - * @testdox A task can be updated - * @covers phpOMS\Utils\TaskSchedule\TaskScheduler - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A task can be updated')] public function testTaskScheduleUpdate() : void { $task = new TaskScheduler(); @@ -112,11 +97,8 @@ final class TaskSchedulerTest extends \PHPUnit\Framework\TestCase $task->delete($job); } - /** - * @testdox A task can be deleted - * @covers phpOMS\Utils\TaskSchedule\TaskScheduler - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A task can be deleted')] public function testDelete() : void { $task = new TaskScheduler(); diff --git a/tests/Utils/TestUtilsClass.php b/tests/Utils/TestUtilsClass.php index 46cdf4a71..b0cf10bfa 100755 --- a/tests/Utils/TestUtilsClass.php +++ b/tests/Utils/TestUtilsClass.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn diff --git a/tests/Utils/TestUtilsTest.php b/tests/Utils/TestUtilsTest.php index a1b2a69c8..19bf52d6d 100755 --- a/tests/Utils/TestUtilsTest.php +++ b/tests/Utils/TestUtilsTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Utils\TestUtils; /** - * @testdox phpOMS\tests\Utils\TestUtilsTest: Test utilities - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Utils\TestUtils::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Utils\TestUtilsTest: Test utilities')] final class TestUtilsTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A member value can be returned - * @covers phpOMS\Utils\TestUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A member value can be returned')] public function testGet() : void { $class = new TestUtilsClass(); @@ -40,11 +37,8 @@ final class TestUtilsTest extends \PHPUnit\Framework\TestCase self::assertEquals('4', TestUtils::getMember($class, 'd')); } - /** - * @testdox Invalid member variable returns null - * @covers phpOMS\Utils\TestUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Invalid member variable returns null')] public function testInvalidGet() : void { $class = new TestUtilsClass(); @@ -52,11 +46,8 @@ final class TestUtilsTest extends \PHPUnit\Framework\TestCase self::assertNull(TestUtils::getMember($class, 'e')); } - /** - * @testdox A member value can be set and returned - * @covers phpOMS\Utils\TestUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A member value can be set and returned')] public function testInputOutput() : void { $class = new TestUtilsClass(); @@ -72,11 +63,8 @@ final class TestUtilsTest extends \PHPUnit\Framework\TestCase self::assertEquals('7', TestUtils::getMember($class, 'd')); } - /** - * @testdox A none-existing member variable cannot be set - * @covers phpOMS\Utils\TestUtils - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A none-existing member variable cannot be set')] public function testInputInputOutput() : void { $class = new TestUtilsClass(); diff --git a/tests/Utils/img/logo_resized.png b/tests/Utils/img/logo_resized.png index 31a4f5706..6f602362d 100644 Binary files a/tests/Utils/img/logo_resized.png and b/tests/Utils/img/logo_resized.png differ diff --git a/tests/Validation/Base/DateTimeTest.php b/tests/Validation/Base/DateTimeTest.php index 60e154e83..fc1c59166 100755 --- a/tests/Validation/Base/DateTimeTest.php +++ b/tests/Validation/Base/DateTimeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ require_once __DIR__ . '/../../Autoloader.php'; use phpOMS\Validation\Base\DateTime; /** - * @testdox phpOMS\tests\Validation\Base\DateTimeTest: Datetime validator - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Validation\Base\DateTime::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Validation\Base\DateTimeTest: Datetime validator')] final class DateTimeTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A date time string can be validated - * @covers phpOMS\Validation\Base\DateTime - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A date time string can be validated')] public function testDateTime() : void { self::assertTrue(DateTime::isValid('now')); diff --git a/tests/Validation/Base/JsonTest.php b/tests/Validation/Base/JsonTest.php index c85f3e8e5..6c2808269 100755 --- a/tests/Validation/Base/JsonTest.php +++ b/tests/Validation/Base/JsonTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,28 +17,22 @@ namespace phpOMS\tests\Validation\Base; use phpOMS\Validation\Base\Json; /** - * @testdox phpOMS\tests\Validation\Base\JsonTest: Json validator - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Validation\Base\Json::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Validation\Base\JsonTest: Json validator')] final class JsonTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A json string can be validated - * @covers phpOMS\Validation\Base\Json - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A json string can be validated')] public function testJson() : void { self::assertTrue(Json::isValid('{}')); self::assertFalse(Json::isValid('{')); } - /** - * @testdox A json string can be validated against a template definition - * @covers phpOMS\Validation\Base\Json - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A json string can be validated against a template definition')] public function testJsonTemplate() : void { $template = \json_decode(\file_get_contents(__DIR__ . '/json/template.json'), true); @@ -48,11 +42,8 @@ final class JsonTest extends \PHPUnit\Framework\TestCase self::assertTrue(Json::validateTemplate($template, $valid, true)); } - /** - * @testdox A json string can be validated against a template definition with additional data - * @covers phpOMS\Validation\Base\Json - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A json string can be validated against a template definition with additional data')] public function testJsonTemplateAdditional() : void { $template = \json_decode(\file_get_contents(__DIR__ . '/json/template.json'), true); @@ -61,11 +52,8 @@ final class JsonTest extends \PHPUnit\Framework\TestCase self::assertTrue(Json::validateTemplate($template, $additional)); } - /** - * @testdox A json string cannot be validated against a template definition with additional data if an exact match is enforced - * @covers phpOMS\Validation\Base\Json - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A json string cannot be validated against a template definition with additional data if an exact match is enforced')] public function testJsonTemplateInvalidAdditional() : void { $template = \json_decode(\file_get_contents(__DIR__ . '/json/template.json'), true); @@ -74,11 +62,8 @@ final class JsonTest extends \PHPUnit\Framework\TestCase self::assertFalse(Json::validateTemplate($template, $additional, true)); } - /** - * @testdox A json string cannot be validated against a template definition with missing data if an exact match is enforced - * @covers phpOMS\Validation\Base\Json - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A json string cannot be validated against a template definition with missing data if an exact match is enforced')] public function testJsonTemplateInvalidMissing() : void { $template = \json_decode(\file_get_contents(__DIR__ . '/json/template.json'), true); @@ -87,11 +72,8 @@ final class JsonTest extends \PHPUnit\Framework\TestCase self::assertFalse(Json::validateTemplate($template, $incomplete)); } - /** - * @testdox A json string cannot be validated against a template definition if it doesn't match the template - * @covers phpOMS\Validation\Base\Json - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox("A json string cannot be validated against a template definition if it doesn't match the template")] public function testInvalidJsonTemplate() : void { $template = \json_decode(\file_get_contents(__DIR__ . '/json/template.json'), true); diff --git a/tests/Validation/Finance/BICTest.php b/tests/Validation/Finance/BICTest.php index d7c43a592..39167aa65 100755 --- a/tests/Validation/Finance/BICTest.php +++ b/tests/Validation/Finance/BICTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Validation\Finance; use phpOMS\Validation\Finance\BIC; /** - * @testdox phpOMS\tests\Validation\Finance\BICTest: BIC validator - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Validation\Finance\BIC::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Validation\Finance\BICTest: BIC validator')] final class BICTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A BIC can be validated - * @covers phpOMS\Validation\Finance\BIC - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A BIC can be validated')] public function testBic() : void { self::assertTrue(BIC::isValid('ASPKAT2LXXX')); diff --git a/tests/Validation/Finance/CreditCardTest.php b/tests/Validation/Finance/CreditCardTest.php index 8fe5899af..ee9d60475 100755 --- a/tests/Validation/Finance/CreditCardTest.php +++ b/tests/Validation/Finance/CreditCardTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Validation\Finance; use phpOMS\Validation\Finance\CreditCard; /** - * @testdox phpOMS\tests\Validation\Finance\CreditCardTest: Credit card validator - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Validation\Finance\CreditCard::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Validation\Finance\CreditCardTest: Credit card validator')] final class CreditCardTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A credit card can be validated - * @covers phpOMS\Validation\Finance\CreditCard - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A credit card can be validated')] public function testCreditCard() : void { self::assertTrue(CreditCard::isValid('49927398716')); @@ -35,11 +32,8 @@ final class CreditCardTest extends \PHPUnit\Framework\TestCase self::assertFalse(CreditCard::isValid('4242424242424241')); } - /** - * @testdox A invalid type cannot be validated - * @covers phpOMS\Validation\Finance\CreditCard - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid type cannot be validated')] public function testInvalidCreditCardType() : void { self::assertFalse(CreditCard::isValid(12347)); diff --git a/tests/Validation/Finance/IbanEnumTest.php b/tests/Validation/Finance/IbanEnumTest.php index 77f7d63cf..62e6b6c71 100755 --- a/tests/Validation/Finance/IbanEnumTest.php +++ b/tests/Validation/Finance/IbanEnumTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,10 +21,8 @@ use phpOMS\Validation\Finance\IbanEnum; */ final class IbanEnumTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { $enums = IbanEnum::getConstants(); diff --git a/tests/Validation/Finance/IbanErrorTypeTest.php b/tests/Validation/Finance/IbanErrorTypeTest.php index dba196778..0f3579bc6 100755 --- a/tests/Validation/Finance/IbanErrorTypeTest.php +++ b/tests/Validation/Finance/IbanErrorTypeTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -21,28 +21,22 @@ use phpOMS\Validation\Finance\IbanErrorType; */ final class IbanErrorTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnumCount() : void { self::assertCount(5, IbanErrorType::getConstants()); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testUnique() : void { self::assertEquals(IbanErrorType::getConstants(), \array_unique(IbanErrorType::getConstants())); } - /** - * @group framework - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testEnums() : void { self::assertEquals(1, IbanErrorType::INVALID_COUNTRY); diff --git a/tests/Validation/Finance/IbanTest.php b/tests/Validation/Finance/IbanTest.php index 0d092d347..eee6783e3 100755 --- a/tests/Validation/Finance/IbanTest.php +++ b/tests/Validation/Finance/IbanTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Validation\Finance; use phpOMS\Validation\Finance\Iban; /** - * @testdox phpOMS\tests\Validation\Finance\IbanTest: Iban validator - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Validation\Finance\Iban::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Validation\Finance\IbanTest: Iban validator')] final class IbanTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A iban can be validated - * @covers phpOMS\Validation\Finance\Iban - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A iban can be validated')] public function testValidation() : void { self::assertTrue(Iban::isValid('DE22 6008 0000 0960 0280 00')); diff --git a/tests/Validation/Network/EmailTest.php b/tests/Validation/Network/EmailTest.php index 773c65007..217300948 100755 --- a/tests/Validation/Network/EmailTest.php +++ b/tests/Validation/Network/EmailTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Validation\Network; use phpOMS\Validation\Network\Email; /** - * @testdox phpOMS\tests\Validation\Network\EmailTest: Email validator - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Validation\Network\Email::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Validation\Network\EmailTest: Email validator')] final class EmailTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A email can be validated - * @covers phpOMS\Validation\Network\Email - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A email can be validated')] public function testValidation() : void { self::assertTrue(Email::isValid('test.string@email.com')); diff --git a/tests/Validation/Network/HostnameTest.php b/tests/Validation/Network/HostnameTest.php index 8ea29500a..51b0e0391 100755 --- a/tests/Validation/Network/HostnameTest.php +++ b/tests/Validation/Network/HostnameTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Validation\Network; use phpOMS\Validation\Network\Hostname; /** - * @testdox phpOMS\tests\Validation\Network\HostnameTest: Hostname validator - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Validation\Network\Hostname::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Validation\Network\HostnameTest: Hostname validator')] final class HostnameTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A hostname can be validated - * @covers phpOMS\Validation\Network\Hostname - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A hostname can be validated')] public function testHostnameDomain() : void { self::assertTrue(Hostname::isValid('test.com')); @@ -36,11 +33,8 @@ final class HostnameTest extends \PHPUnit\Framework\TestCase self::assertFalse(Hostname::isValid('//somethign/wrong')); } - /** - * @testdox A IP can be validated as hostname - * @covers phpOMS\Validation\Network\Hostname - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A IP can be validated as hostname')] public function testHostnameIp() : void { self::assertTrue(Hostname::isValid('127.0.0.1')); diff --git a/tests/Validation/Network/IpTest.php b/tests/Validation/Network/IpTest.php index cf93d80cf..7895924b6 100755 --- a/tests/Validation/Network/IpTest.php +++ b/tests/Validation/Network/IpTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -17,17 +17,14 @@ namespace phpOMS\tests\Validation\Network; use phpOMS\Validation\Network\Ip; /** - * @testdox phpOMS\tests\Validation\Network\IpTest: IP validator - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Validation\Network\Ip::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Validation\Network\IpTest: IP validator')] final class IpTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A ip can be validated - * @covers phpOMS\Validation\Network\Ip - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A ip can be validated')] public function testValid() : void { self::assertTrue(IP::isValid('192.168.178.1')); @@ -36,22 +33,16 @@ final class IpTest extends \PHPUnit\Framework\TestCase self::assertFalse(IP::isValid('localhost')); } - /** - * @testdox A ip4 can be validated - * @covers phpOMS\Validation\Network\Ip - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A ip4 can be validated')] public function testValidIp4() : void { self::assertTrue(IP::isValidIpv4('192.168.178.1')); self::assertFalse(IP::isValidIpv4('2001:0db8:85a3:0000:0000:8a2e:0370:7334')); } - /** - * @testdox A ip6 can be validated - * @covers phpOMS\Validation\Network\Ip - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A ip6 can be validated')] public function testValidIp6() : void { self::assertFalse(IP::isValidIpv6('192.168.178.1')); diff --git a/tests/Validation/ValidatorTest.php b/tests/Validation/ValidatorTest.php index 147b97900..25b1e7f86 100755 --- a/tests/Validation/ValidatorTest.php +++ b/tests/Validation/ValidatorTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -20,28 +20,22 @@ use phpOMS\Validation\Validator; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Validation\ValidatorTest: General validator - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Validation\Validator::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Validation\ValidatorTest: General validator')] final class ValidatorTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A string can be checked if it contains a substring - * @covers phpOMS\Validation\Validator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A string can be checked if it contains a substring')] public function testValidationContains() : void { self::assertTrue(Validator::contains('Test string contains something.', 'contains')); self::assertFalse(Validator::contains('Test string contains something.', 'contains2')); } - /** - * @testdox A string can be checked if it has a certain length - * @covers phpOMS\Validation\Validator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A string can be checked if it has a certain length')] public function testValidationLength() : void { self::assertTrue(Validator::hasLength('Test string contains something.')); @@ -49,11 +43,8 @@ final class ValidatorTest extends \PHPUnit\Framework\TestCase self::assertFalse(Validator::hasLength('Test string contains something.', 100, 1000)); } - /** - * @testdox A value can be checked if it is in range - * @covers phpOMS\Validation\Validator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A value can be checked if it is in range')] public function testValidationLimit() : void { self::assertTrue(Validator::hasLimit(1.23, 1.0, 2.0)); @@ -61,22 +52,16 @@ final class ValidatorTest extends \PHPUnit\Framework\TestCase self::assertFalse(Validator::hasLimit(3.0, 0, 2)); } - /** - * @testdox A value can be checked to be of a defined type - * @covers phpOMS\Validation\Validator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A value can be checked to be of a defined type')] public function testValidationType() : void { self::assertTrue(Validator::isType(new FileLogger(__DIR__), '\phpOMS\Log\FileLogger')); self::assertFalse(Validator::isType(new FileLogger(__DIR__), '\some\namespace')); } - /** - * @testdox The error message and error code have the expected default values - * @covers phpOMS\Validation\Validator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The error message and error code have the expected default values')] public function testValidationError() : void { Validator::resetError(); @@ -84,11 +69,8 @@ final class ValidatorTest extends \PHPUnit\Framework\TestCase self::assertEquals(0, Validator::getErrorCode()); } - /** - * @testdox Custom validators can be specified in order to validate a value - * @covers phpOMS\Validation\Validator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Custom validators can be specified in order to validate a value')] public function testValidators() : void { self::assertTrue(Validator::isValid('testVar')); @@ -103,11 +85,8 @@ final class ValidatorTest extends \PHPUnit\Framework\TestCase Validator::isValid('value', ['\invalid_call' => []]); } - /** - * @testdox A value can be checked to match a regular expression - * @covers phpOMS\Validation\Validator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A value can be checked to match a regular expression')] public function testMatching() : void { self::assertTrue(Validator::matches('ThisTestVar', '/.*/')); @@ -116,28 +95,19 @@ final class ValidatorTest extends \PHPUnit\Framework\TestCase self::assertFalse(Validator::matches('ThisTestVar', '/ThisTest$/')); } - /** - * @covers phpOMS\Validation\Validator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testErrorMessage() : void { self::assertEquals('', Validator::getMessage()); } - /** - * @covers phpOMS\Validation\Validator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testErrorCode() : void { self::assertEquals(0, Validator::getErrorCode()); } - /** - * @covers phpOMS\Validation\Validator - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] public function testResetError() : void { Validator::resetError(); diff --git a/tests/Version/VersionTest.php b/tests/Version/VersionTest.php index fdd2a7d85..98e976e3e 100755 --- a/tests/Version/VersionTest.php +++ b/tests/Version/VersionTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ use phpOMS\Version\Version; require_once __DIR__ . '/../Autoloader.php'; /** - * @testdox phpOMS\tests\Version\VersionTest: Version handler - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Version\Version::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Version\VersionTest: Version handler')] final class VersionTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox Versions can be compared with each other - * @covers phpOMS\Version\Version - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Versions can be compared with each other')] public function testVersionCompare() : void { $version1 = '1.23.456'; diff --git a/tests/Views/PaginationViewTest.php b/tests/Views/PaginationViewTest.php index 370265526..60d4db96a 100755 --- a/tests/Views/PaginationViewTest.php +++ b/tests/Views/PaginationViewTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -19,17 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Views\PaginationView; /** - * @testdox phpOMS\tests\Views\PaginationViewTest: View for pagination - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Views\PaginationView::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Views\PaginationViewTest: View for pagination')] final class PaginationViewTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The pagination view has the expected default values after initialization - * @covers phpOMS\Views\PaginationView - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The pagination view has the expected default values after initialization')] public function testDefault() : void { $view = new PaginationView(); @@ -39,11 +36,8 @@ final class PaginationViewTest extends \PHPUnit\Framework\TestCase self::assertEquals(0, $view->getResults()); } - /** - * @testdox The max pages can be set and returned - * @covers phpOMS\Views\PaginationView - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The max pages can be set and returned')] public function testMaxPagesInputOutput() : void { $view = new PaginationView(); @@ -52,11 +46,8 @@ final class PaginationViewTest extends \PHPUnit\Framework\TestCase self::assertEquals(9, $view->getMaxPages()); } - /** - * @testdox The pages can be set and returned - * @covers phpOMS\Views\PaginationView - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The pages can be set and returned')] public function testPagesInputOutput() : void { $view = new PaginationView(); @@ -65,11 +56,8 @@ final class PaginationViewTest extends \PHPUnit\Framework\TestCase self::assertEquals(2, $view->getPages()); } - /** - * @testdox The page can be set and returned - * @covers phpOMS\Views\PaginationView - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The page can be set and returned')] public function testPageInputOutput() : void { $view = new PaginationView(); @@ -78,11 +66,8 @@ final class PaginationViewTest extends \PHPUnit\Framework\TestCase self::assertEquals(3, $view->getPage()); } - /** - * @testdox The results can be set and returned - * @covers phpOMS\Views\PaginationView - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The results can be set and returned')] public function testResultsInputOutput() : void { $view = new PaginationView(); diff --git a/tests/Views/ViewTest.php b/tests/Views/ViewTest.php index f4bce81ca..478759e7b 100755 --- a/tests/Views/ViewTest.php +++ b/tests/Views/ViewTest.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package tests * @copyright Dennis Eichhorn @@ -26,10 +26,10 @@ use phpOMS\Views\View; use phpOMS\Views\ViewAbstract; /** - * @testdox phpOMS\tests\Views\ViewTest: View for response rendering - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Views\View::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Views\ViewTest: View for response rendering')] final class ViewTest extends \PHPUnit\Framework\TestCase { protected DatabasePool $dbPool; @@ -54,11 +54,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase $this->app->dbPool = $this->dbPool; } - /** - * @testdox The view has the expected default values after initialization - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The view has the expected default values after initialization')] public function testDefault() : void { $view = new View($this->app->l11nManager); @@ -74,11 +71,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertEmpty($view->toArray()); } - /** - * @testdox The view data can be checked for existence - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The view data can be checked for existence')] public function testHasData() : void { $view = new View($this->app->l11nManager); @@ -88,11 +82,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertFalse($view->hasData('b')); } - /** - * @testdox The view can output text from the localization manager - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The view can output text from the localization manager')] public function testGetText() : void { $view = new View($this->app->l11nManager); @@ -112,11 +103,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertEquals('Test', $view->getText('Test')); } - /** - * @testdox The view can output html escaped text from the localization manager - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The view can output html escaped text from the localization manager')] public function testGetHtml() : void { $view = new View($this->app->l11nManager); @@ -136,11 +124,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertEquals('<a href="test">Test</a>', $view->getHtml('Test')); } - /** - * @testdox The numeric value can be printed based on the localization - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The numeric value can be printed based on the localization')] public function testGetNumeric() : void { $view = new View($this->app->l11nManager, null, new HttpResponse(Localization::fromLanguage('en'))); @@ -149,11 +134,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertEquals('1,234.235', $view->getNumeric(1234.2345, 'long')); } - /** - * @testdox The percentage value can be printed based on the localization - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The percentage value can be printed based on the localization')] public function testGetPercentage() : void { $view = new View($this->app->l11nManager, null, new HttpResponse(Localization::fromLanguage('en'))); @@ -161,11 +143,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertEquals('1.235%', $view->getPercentage(1.2345, 'long')); } - /** - * @testdox The currency value can be printed based on the localization - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The currency value can be printed based on the localization')] public function testGetCurrency() : void { $view = new View($this->app->l11nManager, null, new HttpResponse(Localization::fromLanguage('en'))); @@ -177,11 +156,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertEquals('KUSD 12.345', $view->getCurrency(12345.0, null, 'long', 1000)); } - /** - * @testdox The datetime value can be printed based on the localization - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The datetime value can be printed based on the localization')] public function testGetDateTime() : void { $view = new View($this->app->l11nManager, null, new HttpResponse(Localization::fromLanguage('en'))); @@ -191,11 +167,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertEquals('2020.01.01 01:45', $view->getDateTime($date, 'long')); } - /** - * @testdox View data can be set and returned - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('View data can be set and returned')] public function testDataInputOutput() : void { $view = new View($this->app->l11nManager); @@ -204,11 +177,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertEquals('value', $view->getData('key')); } - /** - * @testdox View data can be added and returned - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('View data can be added and returned')] public function testDataAdd() : void { $view = new View($this->app->l11nManager); @@ -217,11 +187,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertEquals('valu2', $view->getData('key2')); } - /** - * @testdox View data can be removed - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('View data can be removed')] public function testRemove() : void { $view = new View($this->app->l11nManager); @@ -231,11 +198,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertNull($view->getData('key2')); } - /** - * @testdox None-existing view data cannot be removed - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('None-existing view data cannot be removed')] public function testInvalidDataRemove() : void { $view = new View($this->app->l11nManager); @@ -243,11 +207,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertFalse($view->removeData('key3')); } - /** - * @testdox The request can be returned - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The request can be returned')] public function testGetRequest() : void { $view = new View($this->app->l11nManager, $request = new HttpRequest(), $response = new HttpResponse()); @@ -256,11 +217,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertEquals($response, $view->response); } - /** - * @testdox The response can be returned - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The response can be returned')] public function testGetResponse() : void { $view = new View($this->app->l11nManager, new HttpRequest(), $response = new HttpResponse()); @@ -268,11 +226,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertEquals($response, $view->response); } - /** - * @testdox Text can be html escaped - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Text can be html escaped')] public function testPrintHtml() : void { $view = new View($this->app->l11nManager, $request = new HttpRequest(), $response = new HttpResponse()); @@ -281,11 +236,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertEquals('<a href="test">Test</a>', ViewAbstract::html('Test')); } - /** - * @testdox Views can be added and returned from a view - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Views can be added and returned from a view')] public function testViewInputOutput() : void { $view = new View($this->app->l11nManager); @@ -296,11 +248,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertCount(1, $view->getViews()); } - /** - * @testdox None-existing views cannot be returned - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('None-existing views cannot be returned')] public function testInvalidViewGet() : void { $view = new View($this->app->l11nManager); @@ -308,11 +257,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertFalse($view->getView('test')); } - /** - * @testdox Views can be removed - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Views can be removed')] public function testViewRemove() : void { $view = new View($this->app->l11nManager); @@ -322,11 +268,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertTrue($view->removeView('test')); } - /** - * @testdox None-existing views cannot be removed - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('None-existing views cannot be removed')] public function testInvalidViewRemove() : void { $view = new View($this->app->l11nManager); @@ -334,11 +277,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertFalse($view->removeView('test')); } - /** - * @testdox A view can be forcefully overwritten - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A view can be forcefully overwritten')] public function testOverwritingView() : void { $view = new View(); @@ -348,11 +288,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertTrue($view->addView('test', $tView, true)); } - /** - * @testdox By default a view is not overwritten - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('By default a view is not overwritten')] public function testInvalidOverwritingView() : void { $view = new View(); @@ -362,11 +299,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertFalse($view->addView('test', $tView)); } - /** - * @testdox A view template can be rendered - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A view template can be rendered')] public function testRender() : void { $view = new View(); @@ -375,11 +309,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertEquals('Test', $view->render()); } - /** - * @testdox A view template can be build - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A view template can be build')] public function testBuild() : void { $view = new View(); @@ -388,11 +319,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertEquals('Test', $view->build()); } - /** - * @testdox A view template can be serialized - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A view template can be serialized')] public function testSerialize() : void { $view = new View(); @@ -402,11 +330,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertEquals('Test', $view->serialize()); } - /** - * @testdox A view can be turned into an array containing the rendered templates - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A view can be turned into an array containing the rendered templates')] public function testArray() : void { $view = new View(); @@ -426,11 +351,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase ); } - /** - * @testdox Rendering a invalid template throws a PathException - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Rendering a invalid template throws a PathException')] public function testRenderException() : void { $view = new View($this->app->l11nManager); @@ -439,11 +361,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertEquals('', $view->render()); } - /** - * @testdox Building a invalid template throws a PathException - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Building a invalid template throws a PathException')] public function testBuildException() : void { $view = new View($this->app->l11nManager); @@ -452,11 +371,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertEquals('', $view->build()); } - /** - * @testdox Serializing a invalid template throws a PathException - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Serializing a invalid template throws a PathException')] public function testSerializeException() : void { $view = new View($this->app->l11nManager); @@ -465,11 +381,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase self::assertEquals('', $view->serialize()); } - /** - * @testdox Getting the text without defining a module throws a InvalidModuleException exception - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Getting the text without defining a module throws a InvalidModuleException exception')] public function testTextWithoutModuleAndTemplate() : void { $this->expectException(\phpOMS\Module\Exception\InvalidModuleException::class); @@ -478,11 +391,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase $view->getText('InvalidText'); } - /** - * @testdox Getting the text with an invalid template path throws a InvalidModuleException exception - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Getting the text with an invalid template path throws a InvalidModuleException exception')] public function testTextFromInvalidTemplatePath() : void { $this->expectException(\phpOMS\Module\Exception\InvalidModuleException::class); @@ -492,11 +402,8 @@ final class ViewTest extends \PHPUnit\Framework\TestCase $view->getText('InvalidText'); } - /** - * @testdox Getting the text without defining a template throws a InvalidThemeException exception - * @covers phpOMS\Views\View - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('Getting the text without defining a template throws a InvalidThemeException exception')] public function testTextInvalidTemplate() : void { $this->expectException(\phpOMS\Module\Exception\InvalidThemeException::class); diff --git a/tests/Views/testArray.tpl.php b/tests/Views/testArray.tpl.php index 63cef75c4..f44d39f51 100755 --- a/tests/Views/testArray.tpl.php +++ b/tests/Views/testArray.tpl.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package Template * @copyright Dennis Eichhorn diff --git a/tests/Views/testReturnTemplate.tpl.php b/tests/Views/testReturnTemplate.tpl.php index b8e11b3a2..cf322e699 100755 --- a/tests/Views/testReturnTemplate.tpl.php +++ b/tests/Views/testReturnTemplate.tpl.php @@ -2,7 +2,7 @@ /** * Jingga * - * PHP Version 8.1 + * PHP Version 8.2 * * @package Template * @copyright Dennis Eichhorn diff --git a/tests/phpunit_default.xml b/tests/phpunit_default.xml index 9a4659aba..aae7d8c48 100644 --- a/tests/phpunit_default.xml +++ b/tests/phpunit_default.xml @@ -1,32 +1,6 @@ - - - - ../ - - - ../vendor* - ../MainRepository* - ../Karaka* - ../Admin/Install/Application* - ../phpOMS* - ../tests* - ../*/tests* - ../**/tests* - */tests* - ../* - ../* - ../* - ../* - ../* - ../**/test* - ../**/Theme* - ../**/Admin/Routes* - ../**/Admin/Hooks* - ../**/Admin/Install* - ../Media/Files* - ../Localization/LanguageDetection/resources - + + @@ -60,4 +34,32 @@ + + + ../ + + + ../vendor* + ../MainRepository* + ../Karaka* + ../Admin/Install/Application* + ../phpOMS* + ../tests* + ../*/tests* + ../**/tests* + */tests* + ../* + ../* + ../* + ../* + ../* + ../**/test* + ../**/Theme* + ../**/Admin/Routes* + ../**/Admin/Hooks* + ../**/Admin/Install* + ../Media/Files* + ../Localization/LanguageDetection/resources + + diff --git a/tests/phpunit_no_coverage.xml b/tests/phpunit_no_coverage.xml index d485ca45f..7a5397f1d 100755 --- a/tests/phpunit_no_coverage.xml +++ b/tests/phpunit_no_coverage.xml @@ -1,23 +1,5 @@ - - - - .* - - - ../*/tests* - ../* - ../* - ../* - ./Build - ./Resources - *vendor* - *Testapp* - ./vendor - ../vendor - ../Localization/LanguageDetection/resources - - + ./ @@ -41,4 +23,22 @@ + + + .* + + + ../*/tests* + ../* + ../* + ../* + ./Build + ./Resources + *vendor* + *Testapp* + ./vendor + ../vendor + ../Localization/LanguageDetection/resources + +