From d6ddf6cbe977c515d31339ea397170e4d54922aa Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 20 Mar 2024 05:16:00 +0000 Subject: [PATCH] upgrade phpunit --- tests/Account/AccountManagerTest.php | 48 +- tests/Account/AccountStatusTest.php | 22 +- tests/Account/AccountTest.php | 32 +- tests/Account/AccountTypeTest.php | 26 +- tests/Account/GroupStatusTest.php | 26 +- tests/Account/GroupTest.php | 19 +- tests/Account/NullAccountTest.php | 17 +- tests/Account/NullGroupTest.php | 17 +- tests/Account/PermissionAbstractTest.php | 53 +- tests/Account/PermissionTypeTest.php | 26 +- tests/Ai/Ocr/BasicOcrTest.php | 16 +- tests/Ai/Ocr/Tesseract/TesseractOcrTest.php | 11 +- tests/Algorithm/Clustering/KmeansTest.php | 11 +- tests/Algorithm/Clustering/PointTest.php | 32 +- .../CoinMatching/MinimumCoinProblemTest.php | 11 +- tests/Algorithm/Frequency/AprioriTest.php | 3 +- .../Graph/DependencyResolverTest.php | 14 +- tests/Algorithm/Graph/MarkovChainTest.php | 24 +- tests/Algorithm/JobScheduling/JobTest.php | 11 +- .../Algorithm/JobScheduling/WeightedTest.php | 18 +- tests/Algorithm/Knapsack/BackpackTest.php | 18 +- tests/Algorithm/Knapsack/BoundedTest.php | 11 +- tests/Algorithm/Knapsack/ContinuousTest.php | 18 +- tests/Algorithm/Knapsack/ItemTest.php | 11 +- tests/Algorithm/Maze/MazeGeneratorTest.php | 18 +- tests/Algorithm/PathFinding/AStarNodeTest.php | 46 +- tests/Algorithm/PathFinding/AStarTest.php | 39 +- tests/Algorithm/PathFinding/GridTest.php | 130 ++-- tests/Algorithm/PathFinding/HeuristicTest.php | 11 +- .../PathFinding/JumpPointNodeTest.php | 53 +- .../PathFinding/JumpPointSearchTest.php | 39 +- tests/Algorithm/PathFinding/NodeTest.php | 32 +- tests/Algorithm/PathFinding/PathTest.php | 32 +- tests/Algorithm/Rating/EloTest.php | 18 +- tests/Algorithm/Rating/Glicko1Test.php | 18 +- tests/Algorithm/Rating/Glicko2Test.php | 18 +- tests/Algorithm/Sort/BitonicSortTest.php | 21 +- tests/Algorithm/Sort/BubbleSortTest.php | 21 +- tests/Algorithm/Sort/BucketSortTest.php | 27 +- .../Algorithm/Sort/CocktailShakerSortTest.php | 21 +- tests/Algorithm/Sort/CombSortTest.php | 21 +- tests/Algorithm/Sort/CycleSortTest.php | 21 +- tests/Algorithm/Sort/GnomeSortTest.php | 21 +- tests/Algorithm/Sort/HeapSortTest.php | 21 +- tests/Algorithm/Sort/InsertionSortTest.php | 21 +- tests/Algorithm/Sort/IntroSortTest.php | 21 +- tests/Algorithm/Sort/MergeSortTest.php | 21 +- tests/Algorithm/Sort/OddEvenSortTest.php | 21 +- tests/Algorithm/Sort/PancakeSortTest.php | 21 +- tests/Algorithm/Sort/QuickSortTest.php | 21 +- tests/Algorithm/Sort/SelectionSortTest.php | 21 +- tests/Algorithm/Sort/ShellSortTest.php | 21 +- tests/Algorithm/Sort/StoogeSortTest.php | 21 +- tests/Algorithm/Sort/TimSortTest.php | 21 +- tests/Api/EUVAT/EUVATBffOnlineTest.php | 11 +- tests/Api/EUVAT/EUVATViesTest.php | 11 +- tests/Api/Geocoding/NominatimTest.php | 3 +- tests/Application/ApplicationAbstractTest.php | 18 +- tests/Application/ApplicationInfoTest.php | 39 +- tests/Application/ApplicationManagerTest.php | 62 +- tests/Application/InstallerAbstractTest.php | 11 +- tests/Application/StatusAbstractTest.php | 11 +- tests/Application/UninstallerAbstractTest.php | 11 +- tests/Asset/AssetManagerTest.php | 39 +- tests/Asset/AssetTypeTest.php | 26 +- tests/Auth/AuthTest.php | 15 +- tests/Auth/LoginReturnTypeTest.php | 26 +- tests/AutoloadExceptionTest.php | 6 +- tests/AutoloaderTest.php | 31 +- tests/Bootstrap.php | 2 + tests/Business/Finance/DepreciationTest.php | 33 +- .../Business/Finance/FinanceFormulasTest.php | 298 +++------- tests/Business/Finance/ForensicsTest.php | 3 +- tests/Business/Finance/LoanTest.php | 39 +- tests/Business/Finance/LorenzkurveTest.php | 9 +- tests/Business/Finance/StockBondsTest.php | 81 +-- .../Business/Marketing/CustomerValueTest.php | 15 +- tests/Business/Marketing/MetricsTest.php | 39 +- .../Marketing/NetPromoterScoreTest.php | 15 +- tests/Business/Marketing/PageRankTest.php | 15 +- tests/Business/Programming/MetricsTest.php | 15 +- .../ArticleCorrelationAffinityTest.php | 15 +- .../BayesianPersonalizedRankingTest.php | 3 +- .../Business/Recommendation/MemoryCFTest.php | 3 +- tests/Business/Recommendation/ModelCFTest.php | 3 +- .../Sales/MarketShareEstimationTest.php | 15 +- tests/Config/OptionsTraitTest.php | 33 +- tests/DataStorage/Cache/CachePoolTest.php | 51 +- tests/DataStorage/Cache/CacheStatusTest.php | 18 +- tests/DataStorage/Cache/CacheTypeTest.php | 18 +- .../Cache/Connection/CacheValueTypeTest.php | 18 +- .../Connection/ConnectionFactoryTest.php | 27 +- .../Cache/Connection/FileCacheTest.php | 151 ++--- .../Cache/Connection/MemCachedTest.php | 130 ++-- .../Cache/Connection/NullCacheTest.php | 11 +- .../Cache/Connection/RedisCacheTest.php | 131 ++--- .../InvalidConnectionConfigExceptionTest.php | 6 +- tests/DataStorage/Cookie/CookieJarTest.php | 51 +- .../Connection/ConnectionFactoryTest.php | 39 +- .../Connection/MysqlConnectionTest.php | 68 +-- .../Connection/NullConnectionTest.php | 11 +- .../Connection/PostgresConnectionTest.php | 68 +-- .../Connection/SQLiteConnectionTest.php | 40 +- .../Connection/SqlServerConnectionTest.php | 68 +-- .../Database/DataMapperAbstractTest.php | 77 +-- .../DataStorage/Database/DatabasePoolTest.php | 45 +- .../Database/DatabaseStatusTest.php | 18 +- .../DataStorage/Database/DatabaseTypeTest.php | 18 +- .../InvalidConnectionConfigExceptionTest.php | 6 +- .../InvalidDatabaseTypeExceptionTest.php | 6 +- .../Exception/InvalidMapperExceptionTest.php | 6 +- .../Database/Query/BuilderTest.php | 181 +++--- .../Database/Query/Grammar/GrammarTest.php | 9 +- .../Query/Grammar/MysqlGrammarTest.php | 9 +- .../Query/Grammar/OracleGrammarTest.php | 6 +- .../Query/Grammar/PostgresGrammarTest.php | 6 +- .../Query/Grammar/SQLiteGrammarTest.php | 9 +- .../Query/Grammar/SqlServerGrammarTest.php | 6 +- .../Database/Query/JoinTypeTest.php | 18 +- .../Database/Query/QueryTypeTest.php | 18 +- .../DataStorage/Database/Query/WhereTest.php | 6 +- .../DataStorage/Database/RelationTypeTest.php | 18 +- .../Database/Schema/BuilderTest.php | 56 +- .../Database/Schema/Grammar/GrammarTest.php | 9 +- .../Schema/Grammar/MysqlGrammarTest.php | 27 +- .../Schema/Grammar/OracleGrammarTest.php | 6 +- .../Schema/Grammar/PostgresGrammarTest.php | 6 +- .../Schema/Grammar/SQLiteGrammarTest.php | 9 +- .../Schema/Grammar/SqlServerGrammarTest.php | 6 +- .../Database/Schema/QueryTypeTest.php | 18 +- .../DataStorage/Database/SchemaMapperTest.php | 18 +- tests/DataStorage/LockExceptionTest.php | 10 +- tests/DataStorage/Session/HttpSessionTest.php | 69 +-- tests/Dispatcher/DispatcherTest.php | 74 +-- tests/Event/EventManagerTest.php | 130 ++-- tests/Image/KernelTest.php | 12 +- tests/Image/SkewTest.php | 12 +- tests/Image/ThresholdingTest.php | 10 +- .../Localization/Defaults/CityMapperTest.php | 11 +- tests/Localization/Defaults/CityTest.php | 11 +- .../Defaults/CountryMapperTest.php | 11 +- tests/Localization/Defaults/CountryTest.php | 11 +- .../Defaults/CurrencyMapperTest.php | 11 +- tests/Localization/Defaults/CurrencyTest.php | 11 +- .../Localization/Defaults/IbanMapperTest.php | 11 +- tests/Localization/Defaults/IbanTest.php | 11 +- .../Defaults/LanguageMapperTest.php | 11 +- tests/Localization/Defaults/LanguageTest.php | 11 +- tests/Localization/ISO3166CharEnumTest.php | 18 +- tests/Localization/ISO3166NameEnumTest.php | 10 +- tests/Localization/ISO3166NumEnumTest.php | 10 +- tests/Localization/ISO3166TwoEnumTest.php | 18 +- tests/Localization/ISO4217CharEnumTest.php | 18 +- tests/Localization/ISO4217DecimalEnumTest.php | 10 +- tests/Localization/ISO4217EnumTest.php | 10 +- tests/Localization/ISO4217NumEnumTest.php | 10 +- tests/Localization/ISO4217SubUnitEnumTest.php | 10 +- tests/Localization/ISO4217SymbolEnumTest.php | 10 +- tests/Localization/ISO639EnumTest.php | 10 +- tests/Localization/ISO639x1EnumTest.php | 18 +- tests/Localization/ISO639x2EnumTest.php | 18 +- tests/Localization/ISO8601EnumArrayTest.php | 18 +- tests/Localization/L11nManagerTest.php | 67 +-- .../LanguageDetection/LanguageTest.php | 2 +- tests/Localization/LocalizationTest.php | 172 ++---- tests/Localization/MoneyTest.php | 75 +-- tests/Localization/PhoneEnumTest.php | 10 +- tests/Localization/TimeZoneEnumArrayTest.php | 10 +- tests/Log/FileLoggerTest.php | 109 +--- tests/Log/LogLevelTest.php | 26 +- ...Test.php => ZeroDivisionExceptionTest.php} | 6 +- tests/Math/Functions/AlgebraTest.php | 3 +- tests/Math/Functions/BetaTest.php | 32 +- tests/Math/Functions/FibonacciTest.php | 32 +- tests/Math/Functions/FunctionsTest.php | 74 +-- tests/Math/Functions/GammaTest.php | 67 +-- .../Geometry/ConvexHull/GrahamScanTest.php | 11 +- .../Geometry/ConvexHull/MonotoneChainTest.php | 11 +- tests/Math/Geometry/Shape/D2/CircleTest.php | 32 +- tests/Math/Geometry/Shape/D2/EllipseTest.php | 18 +- tests/Math/Geometry/Shape/D2/PolygonTest.php | 60 +- .../Geometry/Shape/D2/QuadrilateralTest.php | 11 +- .../Math/Geometry/Shape/D2/RectangleTest.php | 25 +- .../Math/Geometry/Shape/D2/TrapezoidTest.php | 32 +- tests/Math/Geometry/Shape/D2/TriangleTest.php | 32 +- tests/Math/Geometry/Shape/D3/ConeTest.php | 32 +- tests/Math/Geometry/Shape/D3/CuboidTest.php | 18 +- tests/Math/Geometry/Shape/D3/CylinderTest.php | 25 +- tests/Math/Geometry/Shape/D3/PrismTest.php | 25 +- .../Shape/D3/RectangularPyramidTest.php | 25 +- tests/Math/Geometry/Shape/D3/SphereTest.php | 46 +- .../Geometry/Shape/D3/TetrahedronTest.php | 25 +- .../Math/Matrix/CholeskyDecompositionTest.php | 39 +- .../Matrix/EigenvalueDecompositionTest.php | 91 +-- .../InvalidDimensionExceptionTest.php | 6 +- tests/Math/Matrix/IdentityMatrixTest.php | 11 +- tests/Math/Matrix/LUDecompositionTest.php | 67 +-- tests/Math/Matrix/MatrixTest.php | 168 ++---- tests/Math/Matrix/QRDecompositionTest.php | 39 +- tests/Math/Matrix/VectorTest.php | 25 +- tests/Math/Number/ComplexTest.php | 116 ++-- tests/Math/Number/IntegerTest.php | 46 +- tests/Math/Number/NaturalTest.php | 11 +- tests/Math/Number/NumberTypeTest.php | 18 +- tests/Math/Number/NumbersTest.php | 32 +- tests/Math/Number/PrimeTest.php | 39 +- tests/Math/Numerics/IntegrationTest.php | 39 +- .../CubicSplineInterpolationTest.php | 25 +- .../LagrangeInterpolationTest.php | 11 +- .../Interpolation/LinearInterpolationTest.php | 11 +- tests/Math/Optimization/SimplexTest.php | 3 +- tests/Math/Parser/EvaluatorTest.php | 18 +- tests/Math/Solver/Root/BisectionTest.php | 3 +- tests/Math/Solver/Root/IllinoisTest.php | 3 +- tests/Math/Solver/Root/RegulaFalsiTest.php | 3 +- tests/Math/Statistic/AverageTest.php | 126 ++-- tests/Math/Statistic/BasicTest.php | 6 +- tests/Math/Statistic/CorrelationTest.php | 33 +- tests/Math/Statistic/Forecast/ErrorTest.php | 56 +- .../Regression/LevelLevelRegressionTest.php | 45 +- .../Regression/LevelLogRegressionTest.php | 27 +- .../Regression/LogLevelRegressionTest.php | 27 +- .../Regression/LogLogRegressionTest.php | 27 +- .../Regression/PolynomialRegressionTest.php | 15 +- .../Statistic/MeasureOfDispersionTest.php | 114 ++-- .../BernoulliDistributionTest.php | 66 +-- .../Distribution/BetaDistributionTest.php | 46 +- .../Distribution/BinomialDistributionTest.php | 56 +- .../Distribution/CauchyDistributionTest.php | 21 +- .../ChiSquaredDistributionTest.php | 81 +-- .../ExponentialDistributionTest.php | 56 +- .../Distribution/FDistributionTest.php | 36 +- .../Distribution/GammaDistributionTest.php | 91 +-- .../GeometricDistributionTest.php | 51 +- .../HypergeometricDistributionTest.php | 41 +- .../Distribution/LaplaceDistributionTest.php | 56 +- .../Distribution/LogDistributionTest.php | 36 +- .../LogNormalDistributionTest.php | 56 +- .../Distribution/LogisticDistributionTest.php | 51 +- .../Distribution/NormalDistributionTest.php | 66 +-- .../Distribution/ParetoDistributionTest.php | 56 +- .../Distribution/PoissonDistributionTest.php | 56 +- .../Distribution/TDistributionTest.php | 41 +- .../UniformDistributionContinuousTest.php | 51 +- .../UniformDistributionDiscreteTest.php | 56 +- .../Distribution/WeibullDistributionTest.php | 46 +- .../Stochastic/Distribution/ZTestingTest.php | 18 +- .../Stochastic/NaiveBayesClassifierTest.php | 15 +- tests/Math/Topology/Kernel2DTest.php | 3 +- tests/Math/Topology/Metrics2DTest.php | 88 +-- tests/Math/Topology/MetricsNDTest.php | 130 ++-- tests/Message/Cli/CliHeaderTest.php | 54 +- tests/Message/Cli/CliRequestTest.php | 58 +- tests/Message/Cli/CliResponseTest.php | 40 +- tests/Message/HeaderAbstractTest.php | 11 +- tests/Message/Http/BrowserTypeTest.php | 18 +- tests/Message/Http/HttpHeaderTest.php | 103 +--- tests/Message/Http/HttpRequestTest.php | 228 +++---- tests/Message/Http/HttpResponseTest.php | 89 +-- tests/Message/Http/OSTypeTest.php | 12 +- tests/Message/Http/RequestMethodTest.php | 18 +- tests/Message/Http/RequestStatusCodeTest.php | 18 +- tests/Message/Http/RequestStatusTest.php | 18 +- tests/Message/Http/RestTest.php | 49 +- tests/Message/Mail/EmailTest.php | 5 +- tests/Message/Mail/ImapTest.php | 3 +- tests/Message/Mail/MailHandlerMailTrait.php | 10 +- .../Message/Mail/MailHandlerSendmailTrait.php | 10 +- tests/Message/Mail/MailHandlerSmtpTrait.php | 10 +- tests/Message/Mail/MailHandlerTest.php | 3 +- tests/Message/Mail/Pop3Test.php | 3 +- tests/Message/RequestAbstractTest.php | 49 +- tests/Message/ResponseAbstractTest.php | 64 +- tests/Message/Socket/PacketTypeTest.php | 18 +- tests/Model/Html/FormElementGeneratorTest.php | 102 +--- tests/Model/Html/HeadTest.php | 60 +- tests/Model/Html/MetaTest.php | 67 +-- tests/Model/Message/DomActionTest.php | 18 +- tests/Model/Message/DomTest.php | 11 +- tests/Model/Message/FormValidationTest.php | 11 +- tests/Model/Message/NotifyTest.php | 11 +- tests/Model/Message/RedirectTest.php | 11 +- tests/Model/Message/ReloadTest.php | 11 +- .../Exception/InvalidModuleExceptionTest.php | 6 +- .../Exception/InvalidThemeExceptionTest.php | 6 +- tests/Module/InstallerAbstractTest.php | 11 +- tests/Module/ModuleAbstractTest.php | 109 +--- tests/Module/ModuleInfoTest.php | 39 +- tests/Module/ModuleManagerTest.php | 145 ++--- tests/Module/NullModuleTest.php | 18 +- tests/Module/PackageManagerTest.php | 46 +- tests/Module/StatusAbstractTest.php | 7 +- tests/Module/UninstallerAbstractTest.php | 11 +- tests/PreloaderTest.php | 9 +- tests/Router/RouteVerbTest.php | 18 +- tests/Router/SocketRouterTest.php | 81 +-- tests/Router/WebRouterTest.php | 102 +--- tests/Security/EncryptionHelperTest.php | 3 +- tests/Security/GuardTest.php | 11 +- tests/Security/PhpCodeTest.php | 67 +-- tests/Socket/Client/ClientTest.php | 6 +- .../Client/NullClientConnectionTest.php | 6 +- tests/Socket/Server/ServerTest.php | 6 +- tests/Stdlib/Base/AddressTest.php | 32 +- tests/Stdlib/Base/AddressTypeTest.php | 18 +- tests/Stdlib/Base/EnumArrayTest.php | 67 +-- tests/Stdlib/Base/EnumTest.php | 88 +-- .../Base/Exception/InvalidEnumNameTest.php | 6 +- .../Base/Exception/InvalidEnumValueTest.php | 6 +- tests/Stdlib/Base/HeapTest.php | 116 ++-- tests/Stdlib/Base/IbanTest.php | 39 +- tests/Stdlib/Base/LocationTest.php | 67 +-- tests/Stdlib/Base/NullLocationTest.php | 6 +- tests/Stdlib/Base/PhoneTypeTest.php | 18 +- tests/Stdlib/Base/SmartDateTimeTest.php | 116 ++-- tests/Stdlib/Graph/EdgeTest.php | 32 +- tests/Stdlib/Graph/GraphTest.php | 159 ++--- tests/Stdlib/Graph/NodeTest.php | 65 +- tests/Stdlib/Map/KeyTypeTest.php | 18 +- tests/Stdlib/Map/MultiMapTest.php | 305 +++------- tests/Stdlib/Map/OrderTypeTest.php | 18 +- tests/Stdlib/Queue/PriorityModeTest.php | 18 +- tests/Stdlib/Queue/PriorityQueueTest.php | 116 ++-- tests/Stdlib/Tree/BinarySearchTreeTest.php | 3 +- tests/System/CharsetTypeTest.php | 26 +- tests/System/File/ContentPutModeTest.php | 18 +- tests/System/File/ExtensionTypeTest.php | 18 +- tests/System/File/FileUtilsTest.php | 39 +- tests/System/File/Ftp/DirectoryTest.php | 396 ++++--------- tests/System/File/Ftp/FileTest.php | 416 ++++--------- tests/System/File/Ftp/FtpStorageTest.php | 555 +++++------------- tests/System/File/Local/DirectoryTest.php | 392 ++++--------- tests/System/File/Local/FileTest.php | 411 ++++--------- tests/System/File/Local/LocalStorageTest.php | 555 +++++------------- tests/System/File/PathExceptionTest.php | 6 +- tests/System/File/PermissionExceptionTest.php | 6 +- tests/System/File/StorageTest.php | 39 +- tests/System/MimeTypeTest.php | 25 +- tests/System/OperatingSystemTest.php | 10 +- tests/System/Search/StringSearchTest.php | 34 +- tests/System/SystemTypeTest.php | 26 +- tests/System/SystemUtilsTest.php | 18 +- tests/Uri/ArgumentTest.php | 74 +-- tests/Uri/HttpUriTest.php | 151 ++--- tests/Uri/InvalidUriExceptionTest.php | 10 +- tests/Uri/UriFactoryTest.php | 116 ++-- tests/Uri/UriSchemeTest.php | 12 +- tests/Utils/ArrayUtilsTest.php | 139 ++--- tests/Utils/Barcode/BarAbstractTest.php | 21 +- tests/Utils/Barcode/C128aTest.php | 21 +- tests/Utils/Barcode/C128bTest.php | 21 +- tests/Utils/Barcode/C128cTest.php | 16 +- tests/Utils/Barcode/C25Test.php | 26 +- tests/Utils/Barcode/C39Test.php | 21 +- tests/Utils/Barcode/CodebarTest.php | 21 +- tests/Utils/Barcode/DatamatrixTest.php | 11 +- tests/Utils/Barcode/OrientationTypeTest.php | 18 +- tests/Utils/Barcode/QRTest.php | 11 +- tests/Utils/ColorUtilsTest.php | 18 +- tests/Utils/Compression/LZWTest.php | 11 +- tests/Utils/Converter/AngleTypeTest.php | 18 +- tests/Utils/Converter/AreaTypeTest.php | 18 +- tests/Utils/Converter/CurrencyTest.php | 46 +- tests/Utils/Converter/EnergyPowerTypeTest.php | 18 +- tests/Utils/Converter/FileSizeTypeTest.php | 29 +- tests/Utils/Converter/FileTest.php | 18 +- tests/Utils/Converter/IpTest.php | 11 +- tests/Utils/Converter/LengthTypeTest.php | 18 +- tests/Utils/Converter/MeasurementTest.php | 235 +++----- tests/Utils/Converter/NumericTest.php | 39 +- tests/Utils/Converter/PressureTypeTest.php | 18 +- tests/Utils/Converter/SpeedTypeTest.php | 18 +- tests/Utils/Converter/TemperatureTypeTest.php | 18 +- tests/Utils/Converter/TimeTypeTest.php | 18 +- tests/Utils/Converter/VolumeTypeTest.php | 18 +- tests/Utils/Converter/WeightTypeTest.php | 18 +- tests/Utils/Encoding/CaesarTest.php | 10 +- tests/Utils/Encoding/GrayTest.php | 11 +- .../Utils/Encoding/Huffman/DictionaryTest.php | 39 +- tests/Utils/Encoding/Huffman/HuffmanTest.php | 15 +- tests/Utils/Encoding/XorEncodingTest.php | 11 +- tests/Utils/Git/AuthorTest.php | 39 +- tests/Utils/Git/BranchTest.php | 18 +- tests/Utils/Git/CommitTest.php | 95 +-- tests/Utils/Git/GitTest.php | 11 +- tests/Utils/Git/RepositoryTest.php | 11 +- tests/Utils/Git/TagTest.php | 25 +- tests/Utils/IO/Csv/CsvSettingsTest.php | 18 +- .../IO/Json/InvalidJsonExceptionTest.php | 6 +- .../SpreadsheetDatabaseMapperTest.php | 71 +-- tests/Utils/IO/Zip/GzTest.php | 32 +- tests/Utils/IO/Zip/TarGzTest.php | 32 +- tests/Utils/IO/Zip/TarTest.php | 39 +- tests/Utils/IO/Zip/ZipTest.php | 46 +- tests/Utils/ImageUtilsTest.php | 16 +- tests/Utils/MbStringUtilsTest.php | 88 +-- tests/Utils/NumericUtilsTest.php | 11 +- tests/Utils/Parser/Markdown/MarkdownTest.php | 6 +- tests/Utils/Parser/Php/ArrayParserTest.php | 18 +- tests/Utils/PermutationTest.php | 39 +- tests/Utils/RnG/ArrayRandomizeTest.php | 18 +- tests/Utils/RnG/DateTimeTest.php | 11 +- tests/Utils/RnG/DistributionTypeTest.php | 18 +- tests/Utils/RnG/FileTest.php | 11 +- .../RnG/LinearCongruentialGeneratorTest.php | 46 +- tests/Utils/RnG/NameTest.php | 11 +- tests/Utils/RnG/PhoneTest.php | 11 +- tests/Utils/RnG/StringUtilsTest.php | 9 +- tests/Utils/RnG/TextTest.php | 11 +- tests/Utils/StringCompareTest.php | 42 +- tests/Utils/StringUtilsTest.php | 81 +-- tests/Utils/TaskSchedule/CronJobTest.php | 18 +- tests/Utils/TaskSchedule/CronTest.php | 47 +- tests/Utils/TaskSchedule/IntervalTest.php | 123 ++-- tests/Utils/TaskSchedule/ScheduleTest.php | 20 +- .../TaskSchedule/SchedulerAbstractTest.php | 18 +- .../TaskSchedule/SchedulerFactoryTest.php | 11 +- tests/Utils/TaskSchedule/TaskAbstractTest.php | 46 +- tests/Utils/TaskSchedule/TaskFactoryTest.php | 11 +- .../Utils/TaskSchedule/TaskSchedulerTest.php | 46 +- tests/Utils/TestUtilsTest.php | 32 +- tests/Validation/Base/DateTimeTest.php | 11 +- tests/Validation/Base/JsonTest.php | 46 +- tests/Validation/Finance/BICTest.php | 11 +- tests/Validation/Finance/CreditCardTest.php | 18 +- tests/Validation/Finance/IbanEnumTest.php | 6 +- .../Validation/Finance/IbanErrorTypeTest.php | 18 +- tests/Validation/Finance/IbanTest.php | 11 +- tests/Validation/Network/EmailTest.php | 11 +- tests/Validation/Network/HostnameTest.php | 18 +- tests/Validation/Network/IpTest.php | 25 +- tests/Validation/ValidatorTest.php | 68 +-- tests/Version/VersionTest.php | 11 +- tests/Views/PaginationViewTest.php | 39 +- tests/Views/ViewTest.php | 221 ++----- tests/phpunit_default.xml | 58 +- tests/phpunit_no_coverage.xml | 38 +- 437 files changed, 5280 insertions(+), 12367 deletions(-) rename tests/Math/Exception/{ZeroDevisionExceptionTest.php => ZeroDivisionExceptionTest.php} (78%) mode change 100755 => 100644 diff --git a/tests/Account/AccountManagerTest.php b/tests/Account/AccountManagerTest.php index 30e72c71b..359843c4c 100755 --- a/tests/Account/AccountManagerTest.php +++ b/tests/Account/AccountManagerTest.php @@ -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..d282f51e8 100755 --- a/tests/Account/AccountStatusTest.php +++ b/tests/Account/AccountStatusTest.php @@ -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 516897d9f..e18dc7a6d 100755 --- a/tests/Account/AccountTest.php +++ b/tests/Account/AccountTest.php @@ -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..62344d064 100755 --- a/tests/Account/AccountTypeTest.php +++ b/tests/Account/AccountTypeTest.php @@ -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..7688c3dc7 100755 --- a/tests/Account/GroupStatusTest.php +++ b/tests/Account/GroupStatusTest.php @@ -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 5092c8109..47366f5ea 100755 --- a/tests/Account/GroupTest.php +++ b/tests/Account/GroupTest.php @@ -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 991582a80..ecddcdbe0 100755 --- a/tests/Account/NullAccountTest.php +++ b/tests/Account/NullAccountTest.php @@ -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 b761bc4fb..effb1b864 100755 --- a/tests/Account/NullGroupTest.php +++ b/tests/Account/NullGroupTest.php @@ -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 009d19ba1..becc72b8c 100755 --- a/tests/Account/PermissionAbstractTest.php +++ b/tests/Account/PermissionAbstractTest.php @@ -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..b26daeba2 100755 --- a/tests/Account/PermissionTypeTest.php +++ b/tests/Account/PermissionTypeTest.php @@ -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 682b35fde..ed291c54f 100755 --- a/tests/Ai/Ocr/BasicOcrTest.php +++ b/tests/Ai/Ocr/BasicOcrTest.php @@ -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 fc1307575..0575c11a0 100755 --- a/tests/Ai/Ocr/Tesseract/TesseractOcrTest.php +++ b/tests/Ai/Ocr/Tesseract/TesseractOcrTest.php @@ -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(); diff --git a/tests/Algorithm/Clustering/KmeansTest.php b/tests/Algorithm/Clustering/KmeansTest.php index c06febc26..1bee5493e 100755 --- a/tests/Algorithm/Clustering/KmeansTest.php +++ b/tests/Algorithm/Clustering/KmeansTest.php @@ -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 b6fd68d6e..59307ab0e 100755 --- a/tests/Algorithm/Clustering/PointTest.php +++ b/tests/Algorithm/Clustering/PointTest.php @@ -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 7b15da5db..bcba7d485 100755 --- a/tests/Algorithm/CoinMatching/MinimumCoinProblemTest.php +++ b/tests/Algorithm/CoinMatching/MinimumCoinProblemTest.php @@ -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..459fc2a51 100644 --- a/tests/Algorithm/Frequency/AprioriTest.php +++ b/tests/Algorithm/Frequency/AprioriTest.php @@ -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 bd6ef6805..ce2874550 100644 --- a/tests/Algorithm/Graph/DependencyResolverTest.php +++ b/tests/Algorithm/Graph/DependencyResolverTest.php @@ -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 316c34274..c208715d0 100644 --- a/tests/Algorithm/Graph/MarkovChainTest.php +++ b/tests/Algorithm/Graph/MarkovChainTest.php @@ -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 6a670b5a5..72f950bb3 100755 --- a/tests/Algorithm/JobScheduling/JobTest.php +++ b/tests/Algorithm/JobScheduling/JobTest.php @@ -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 fdada1f26..b9d57c4bc 100755 --- a/tests/Algorithm/JobScheduling/WeightedTest.php +++ b/tests/Algorithm/JobScheduling/WeightedTest.php @@ -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 d3f3a1652..3dba54648 100755 --- a/tests/Algorithm/Knapsack/BackpackTest.php +++ b/tests/Algorithm/Knapsack/BackpackTest.php @@ -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 276318a70..137e6dfa0 100755 --- a/tests/Algorithm/Knapsack/BoundedTest.php +++ b/tests/Algorithm/Knapsack/BoundedTest.php @@ -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 3052c3057..c1eaf4958 100755 --- a/tests/Algorithm/Knapsack/ContinuousTest.php +++ b/tests/Algorithm/Knapsack/ContinuousTest.php @@ -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 1cc52427c..1e4e9faf2 100755 --- a/tests/Algorithm/Knapsack/ItemTest.php +++ b/tests/Algorithm/Knapsack/ItemTest.php @@ -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 f1dde2dd9..601992d13 100755 --- a/tests/Algorithm/Maze/MazeGeneratorTest.php +++ b/tests/Algorithm/Maze/MazeGeneratorTest.php @@ -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 d67252e6f..cc911afd7 100755 --- a/tests/Algorithm/PathFinding/AStarNodeTest.php +++ b/tests/Algorithm/PathFinding/AStarNodeTest.php @@ -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 8023e1da5..a0e06acd1 100755 --- a/tests/Algorithm/PathFinding/AStarTest.php +++ b/tests/Algorithm/PathFinding/AStarTest.php @@ -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 d6435dabc..a7ea02cbc 100755 --- a/tests/Algorithm/PathFinding/GridTest.php +++ b/tests/Algorithm/PathFinding/GridTest.php @@ -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 942782e65..f458dc912 100755 --- a/tests/Algorithm/PathFinding/HeuristicTest.php +++ b/tests/Algorithm/PathFinding/HeuristicTest.php @@ -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 c6e8cf35d..b5ddf4cc5 100755 --- a/tests/Algorithm/PathFinding/JumpPointNodeTest.php +++ b/tests/Algorithm/PathFinding/JumpPointNodeTest.php @@ -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 6bb9461c7..ba894d99a 100755 --- a/tests/Algorithm/PathFinding/JumpPointSearchTest.php +++ b/tests/Algorithm/PathFinding/JumpPointSearchTest.php @@ -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 327eb913f..c02ad8740 100755 --- a/tests/Algorithm/PathFinding/NodeTest.php +++ b/tests/Algorithm/PathFinding/NodeTest.php @@ -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 71926978e..73eb0e732 100755 --- a/tests/Algorithm/PathFinding/PathTest.php +++ b/tests/Algorithm/PathFinding/PathTest.php @@ -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 9c667ac9d..d914ad87a 100644 --- a/tests/Algorithm/Rating/EloTest.php +++ b/tests/Algorithm/Rating/EloTest.php @@ -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 a5e0b12c5..039b29faf 100644 --- a/tests/Algorithm/Rating/Glicko1Test.php +++ b/tests/Algorithm/Rating/Glicko1Test.php @@ -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 7205271b2..4167e6e45 100644 --- a/tests/Algorithm/Rating/Glicko2Test.php +++ b/tests/Algorithm/Rating/Glicko2Test.php @@ -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..3f8b379fc 100755 --- a/tests/Algorithm/Sort/BitonicSortTest.php +++ b/tests/Algorithm/Sort/BitonicSortTest.php @@ -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..773148b68 100755 --- a/tests/Algorithm/Sort/BubbleSortTest.php +++ b/tests/Algorithm/Sort/BubbleSortTest.php @@ -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..3f89ec90f 100755 --- a/tests/Algorithm/Sort/BucketSortTest.php +++ b/tests/Algorithm/Sort/BucketSortTest.php @@ -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..c0112e2e3 100755 --- a/tests/Algorithm/Sort/CocktailShakerSortTest.php +++ b/tests/Algorithm/Sort/CocktailShakerSortTest.php @@ -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..42f46dbfa 100755 --- a/tests/Algorithm/Sort/CombSortTest.php +++ b/tests/Algorithm/Sort/CombSortTest.php @@ -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..266486ce7 100755 --- a/tests/Algorithm/Sort/CycleSortTest.php +++ b/tests/Algorithm/Sort/CycleSortTest.php @@ -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..aded79502 100755 --- a/tests/Algorithm/Sort/GnomeSortTest.php +++ b/tests/Algorithm/Sort/GnomeSortTest.php @@ -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..60b4eb240 100755 --- a/tests/Algorithm/Sort/HeapSortTest.php +++ b/tests/Algorithm/Sort/HeapSortTest.php @@ -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..a21389123 100755 --- a/tests/Algorithm/Sort/InsertionSortTest.php +++ b/tests/Algorithm/Sort/InsertionSortTest.php @@ -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..3ff336d10 100755 --- a/tests/Algorithm/Sort/IntroSortTest.php +++ b/tests/Algorithm/Sort/IntroSortTest.php @@ -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..f6f2208ff 100755 --- a/tests/Algorithm/Sort/MergeSortTest.php +++ b/tests/Algorithm/Sort/MergeSortTest.php @@ -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/OddEvenSortTest.php b/tests/Algorithm/Sort/OddEvenSortTest.php index 318d7c324..50931aa7f 100755 --- a/tests/Algorithm/Sort/OddEvenSortTest.php +++ b/tests/Algorithm/Sort/OddEvenSortTest.php @@ -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..80ff704b7 100755 --- a/tests/Algorithm/Sort/PancakeSortTest.php +++ b/tests/Algorithm/Sort/PancakeSortTest.php @@ -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..634bae147 100755 --- a/tests/Algorithm/Sort/QuickSortTest.php +++ b/tests/Algorithm/Sort/QuickSortTest.php @@ -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..ebbd1e6ce 100755 --- a/tests/Algorithm/Sort/SelectionSortTest.php +++ b/tests/Algorithm/Sort/SelectionSortTest.php @@ -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..aac1ffaae 100755 --- a/tests/Algorithm/Sort/ShellSortTest.php +++ b/tests/Algorithm/Sort/ShellSortTest.php @@ -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..33f0fa763 100755 --- a/tests/Algorithm/Sort/StoogeSortTest.php +++ b/tests/Algorithm/Sort/StoogeSortTest.php @@ -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..105cfa15a 100755 --- a/tests/Algorithm/Sort/TimSortTest.php +++ b/tests/Algorithm/Sort/TimSortTest.php @@ -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 4b6f220a0..a7f7c6bda 100755 --- a/tests/Api/EUVAT/EUVATBffOnlineTest.php +++ b/tests/Api/EUVAT/EUVATBffOnlineTest.php @@ -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 fff2020ca..910ebdae7 100755 --- a/tests/Api/EUVAT/EUVATViesTest.php +++ b/tests/Api/EUVAT/EUVATViesTest.php @@ -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..cf81e606c 100644 --- a/tests/Api/Geocoding/NominatimTest.php +++ b/tests/Api/Geocoding/NominatimTest.php @@ -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 2e22a8592..439297356 100755 --- a/tests/Application/ApplicationAbstractTest.php +++ b/tests/Application/ApplicationAbstractTest.php @@ -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 42a8a977c..4ae05960b 100755 --- a/tests/Application/ApplicationInfoTest.php +++ b/tests/Application/ApplicationInfoTest.php @@ -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 1361f02d0..6d06223ca 100755 --- a/tests/Application/ApplicationManagerTest.php +++ b/tests/Application/ApplicationManagerTest.php @@ -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 568d855e9..09aae8f8e 100755 --- a/tests/Application/InstallerAbstractTest.php +++ b/tests/Application/InstallerAbstractTest.php @@ -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 4750ee29a..996cfa159 100755 --- a/tests/Application/StatusAbstractTest.php +++ b/tests/Application/StatusAbstractTest.php @@ -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/UninstallerAbstractTest.php b/tests/Application/UninstallerAbstractTest.php index 2f3c2bec9..ba03a4098 100755 --- a/tests/Application/UninstallerAbstractTest.php +++ b/tests/Application/UninstallerAbstractTest.php @@ -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..564a0df84 100755 --- a/tests/Asset/AssetManagerTest.php +++ b/tests/Asset/AssetManagerTest.php @@ -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..4985fd580 100755 --- a/tests/Asset/AssetTypeTest.php +++ b/tests/Asset/AssetTypeTest.php @@ -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..acb982541 100755 --- a/tests/Auth/AuthTest.php +++ b/tests/Auth/AuthTest.php @@ -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..928fba578 100755 --- a/tests/Auth/LoginReturnTypeTest.php +++ b/tests/Auth/LoginReturnTypeTest.php @@ -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 ff90facdd..bda4d1974 100755 --- a/tests/AutoloadExceptionTest.php +++ b/tests/AutoloadExceptionTest.php @@ -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/AutoloaderTest.php b/tests/AutoloaderTest.php index 4c69b7149..7bbfaf434 100755 --- a/tests/AutoloaderTest.php +++ b/tests/AutoloaderTest.php @@ -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..ab58cdab7 100755 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -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..9f7c83668 100755 --- a/tests/Business/Finance/DepreciationTest.php +++ b/tests/Business/Finance/DepreciationTest.php @@ -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 3163393e6..e6e3de34c 100755 --- a/tests/Business/Finance/FinanceFormulasTest.php +++ b/tests/Business/Finance/FinanceFormulasTest.php @@ -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..d53c1f43c 100644 --- a/tests/Business/Finance/ForensicsTest.php +++ b/tests/Business/Finance/ForensicsTest.php @@ -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..2eb708e8c 100755 --- a/tests/Business/Finance/LoanTest.php +++ b/tests/Business/Finance/LoanTest.php @@ -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..b740b6867 100755 --- a/tests/Business/Finance/LorenzkurveTest.php +++ b/tests/Business/Finance/LorenzkurveTest.php @@ -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..2b5c59396 100755 --- a/tests/Business/Finance/StockBondsTest.php +++ b/tests/Business/Finance/StockBondsTest.php @@ -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..988bb2d79 100755 --- a/tests/Business/Marketing/CustomerValueTest.php +++ b/tests/Business/Marketing/CustomerValueTest.php @@ -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..f3c9c2754 100755 --- a/tests/Business/Marketing/MetricsTest.php +++ b/tests/Business/Marketing/MetricsTest.php @@ -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..b3debb48c 100755 --- a/tests/Business/Marketing/NetPromoterScoreTest.php +++ b/tests/Business/Marketing/NetPromoterScoreTest.php @@ -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..7a3670aa7 100755 --- a/tests/Business/Marketing/PageRankTest.php +++ b/tests/Business/Marketing/PageRankTest.php @@ -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..0dad8020f 100755 --- a/tests/Business/Programming/MetricsTest.php +++ b/tests/Business/Programming/MetricsTest.php @@ -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..ad1d64713 100644 --- a/tests/Business/Recommendation/ArticleCorrelationAffinityTest.php +++ b/tests/Business/Recommendation/ArticleCorrelationAffinityTest.php @@ -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 index f8ed76a2e..46308ad98 100644 --- a/tests/Business/Recommendation/BayesianPersonalizedRankingTest.php +++ b/tests/Business/Recommendation/BayesianPersonalizedRankingTest.php @@ -15,10 +15,9 @@ declare(strict_types=1); namespace phpOMS\tests\Business\Recommendation; /** - * @testdox phpOMS\tests\Business\Recommendation\BayesianPersonalizedRankingTest: Article affinity/correlation - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Business\Recommendation\BayesianPersonalizedRankingTest: Article affinity/correlation')] final class BayesianPersonalizedRankingTest extends \PHPUnit\Framework\TestCase { } diff --git a/tests/Business/Recommendation/MemoryCFTest.php b/tests/Business/Recommendation/MemoryCFTest.php index 9308e7309..1a9f77765 100644 --- a/tests/Business/Recommendation/MemoryCFTest.php +++ b/tests/Business/Recommendation/MemoryCFTest.php @@ -17,10 +17,9 @@ namespace phpOMS\tests\Business\Recommendation; use phpOMS\Business\Recommendation\MemoryCF; /** - * @testdox phpOMS\tests\Business\Recommendation\MemoryCFTest: Article affinity/correlation - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Business\Recommendation\MemoryCFTest: Article affinity/correlation')] final class MemoryCFTest extends \PHPUnit\Framework\TestCase { public function testBestMatch() : void diff --git a/tests/Business/Recommendation/ModelCFTest.php b/tests/Business/Recommendation/ModelCFTest.php index 4e10ac810..fa3e5ddb1 100644 --- a/tests/Business/Recommendation/ModelCFTest.php +++ b/tests/Business/Recommendation/ModelCFTest.php @@ -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..a09819670 100755 --- a/tests/Business/Sales/MarketShareEstimationTest.php +++ b/tests/Business/Sales/MarketShareEstimationTest.php @@ -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..75b4324ca 100755 --- a/tests/Config/OptionsTraitTest.php +++ b/tests/Config/OptionsTraitTest.php @@ -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..7c4dc0226 100755 --- a/tests/DataStorage/Cache/CachePoolTest.php +++ b/tests/DataStorage/Cache/CachePoolTest.php @@ -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..f104ef23b 100755 --- a/tests/DataStorage/Cache/CacheStatusTest.php +++ b/tests/DataStorage/Cache/CacheStatusTest.php @@ -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..ce22c063e 100755 --- a/tests/DataStorage/Cache/CacheTypeTest.php +++ b/tests/DataStorage/Cache/CacheTypeTest.php @@ -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..359013b4c 100755 --- a/tests/DataStorage/Cache/Connection/CacheValueTypeTest.php +++ b/tests/DataStorage/Cache/Connection/CacheValueTypeTest.php @@ -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..3cdf1a451 100755 --- a/tests/DataStorage/Cache/Connection/ConnectionFactoryTest.php +++ b/tests/DataStorage/Cache/Connection/ConnectionFactoryTest.php @@ -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/FileCacheTest.php b/tests/DataStorage/Cache/Connection/FileCacheTest.php index 9652bbccc..106dccf78 100755 --- a/tests/DataStorage/Cache/Connection/FileCacheTest.php +++ b/tests/DataStorage/Cache/Connection/FileCacheTest.php @@ -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 eac28ca6f..d79392bfa 100755 --- a/tests/DataStorage/Cache/Connection/MemCachedTest.php +++ b/tests/DataStorage/Cache/Connection/MemCachedTest.php @@ -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; @@ -47,11 +47,8 @@ final class MemCachedTest extends \PHPUnit\Framework\TestCase $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 +68,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 +79,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 +111,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 +205,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 +214,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 +225,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 +254,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 +278,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 +296,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 +314,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 +325,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 +341,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 +350,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 +359,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 +371,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 fc24fc0f8..cc6229715 100755 --- a/tests/DataStorage/Cache/Connection/NullCacheTest.php +++ b/tests/DataStorage/Cache/Connection/NullCacheTest.php @@ -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 19e4fcecb..fca36d13a 100755 --- a/tests/DataStorage/Cache/Connection/RedisCacheTest.php +++ b/tests/DataStorage/Cache/Connection/RedisCacheTest.php @@ -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; @@ -47,11 +48,8 @@ final class RedisCacheTest extends \PHPUnit\Framework\TestCase $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 +64,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 +76,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 +105,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 +241,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 +250,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 +261,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 +290,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 +304,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 +322,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 +340,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 +356,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 +365,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 +374,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 +386,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 +398,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 e6b1b7039..62e35645c 100755 --- a/tests/DataStorage/Cache/Exception/InvalidConnectionConfigExceptionTest.php +++ b/tests/DataStorage/Cache/Exception/InvalidConnectionConfigExceptionTest.php @@ -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..454681313 100755 --- a/tests/DataStorage/Cookie/CookieJarTest.php +++ b/tests/DataStorage/Cookie/CookieJarTest.php @@ -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 09224fad3..063e65055 100755 --- a/tests/DataStorage/Database/Connection/ConnectionFactoryTest.php +++ b/tests/DataStorage/Database/Connection/ConnectionFactoryTest.php @@ -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 5666f62c3..20e9a5c88 100755 --- a/tests/DataStorage/Database/Connection/MysqlConnectionTest.php +++ b/tests/DataStorage/Database/Connection/MysqlConnectionTest.php @@ -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 b6110b96f..ed7ff6612 100755 --- a/tests/DataStorage/Database/Connection/NullConnectionTest.php +++ b/tests/DataStorage/Database/Connection/NullConnectionTest.php @@ -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 3969d337e..ddd7a0656 100755 --- a/tests/DataStorage/Database/Connection/PostgresConnectionTest.php +++ b/tests/DataStorage/Database/Connection/PostgresConnectionTest.php @@ -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 7cf8e418d..68a985f8a 100755 --- a/tests/DataStorage/Database/Connection/SQLiteConnectionTest.php +++ b/tests/DataStorage/Database/Connection/SQLiteConnectionTest.php @@ -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 25a13c0f5..b7fe4368c 100755 --- a/tests/DataStorage/Database/Connection/SqlServerConnectionTest.php +++ b/tests/DataStorage/Database/Connection/SqlServerConnectionTest.php @@ -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 f57b64f1d..7f4549e5e 100755 --- a/tests/DataStorage/Database/DataMapperAbstractTest.php +++ b/tests/DataStorage/Database/DataMapperAbstractTest.php @@ -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); @@ -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; @@ -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; @@ -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..efbe03bfa 100755 --- a/tests/DataStorage/Database/DatabasePoolTest.php +++ b/tests/DataStorage/Database/DatabasePoolTest.php @@ -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..57709493e 100755 --- a/tests/DataStorage/Database/DatabaseStatusTest.php +++ b/tests/DataStorage/Database/DatabaseStatusTest.php @@ -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..555eac04a 100755 --- a/tests/DataStorage/Database/DatabaseTypeTest.php +++ b/tests/DataStorage/Database/DatabaseTypeTest.php @@ -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 9098b8123..4a82a573f 100755 --- a/tests/DataStorage/Database/Exception/InvalidConnectionConfigExceptionTest.php +++ b/tests/DataStorage/Database/Exception/InvalidConnectionConfigExceptionTest.php @@ -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 7b68e2e80..e2f324e60 100755 --- a/tests/DataStorage/Database/Exception/InvalidDatabaseTypeExceptionTest.php +++ b/tests/DataStorage/Database/Exception/InvalidDatabaseTypeExceptionTest.php @@ -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 c3e06c383..ea58f23ac 100755 --- a/tests/DataStorage/Database/Exception/InvalidMapperExceptionTest.php +++ b/tests/DataStorage/Database/Exception/InvalidMapperExceptionTest.php @@ -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..82655f8d3 100755 --- a/tests/DataStorage/Database/Query/BuilderTest.php +++ b/tests/DataStorage/Database/Query/BuilderTest.php @@ -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..f7efdc8b7 100755 --- a/tests/DataStorage/Database/Query/Grammar/GrammarTest.php +++ b/tests/DataStorage/Database/Query/Grammar/GrammarTest.php @@ -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..5b5060297 100755 --- a/tests/DataStorage/Database/Query/Grammar/MysqlGrammarTest.php +++ b/tests/DataStorage/Database/Query/Grammar/MysqlGrammarTest.php @@ -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 1712968d7..8182068e4 100755 --- a/tests/DataStorage/Database/Query/Grammar/OracleGrammarTest.php +++ b/tests/DataStorage/Database/Query/Grammar/OracleGrammarTest.php @@ -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 01b56196b..9d818c6a0 100755 --- a/tests/DataStorage/Database/Query/Grammar/PostgresGrammarTest.php +++ b/tests/DataStorage/Database/Query/Grammar/PostgresGrammarTest.php @@ -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..d78cc7a76 100755 --- a/tests/DataStorage/Database/Query/Grammar/SQLiteGrammarTest.php +++ b/tests/DataStorage/Database/Query/Grammar/SQLiteGrammarTest.php @@ -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 afdbe8b5f..38f825efb 100755 --- a/tests/DataStorage/Database/Query/Grammar/SqlServerGrammarTest.php +++ b/tests/DataStorage/Database/Query/Grammar/SqlServerGrammarTest.php @@ -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..ff0f1e832 100755 --- a/tests/DataStorage/Database/Query/JoinTypeTest.php +++ b/tests/DataStorage/Database/Query/JoinTypeTest.php @@ -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..aaa72fde1 100755 --- a/tests/DataStorage/Database/Query/QueryTypeTest.php +++ b/tests/DataStorage/Database/Query/QueryTypeTest.php @@ -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 903566afe..d1321dea1 100755 --- a/tests/DataStorage/Database/Query/WhereTest.php +++ b/tests/DataStorage/Database/Query/WhereTest.php @@ -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..2ed1566e5 100755 --- a/tests/DataStorage/Database/RelationTypeTest.php +++ b/tests/DataStorage/Database/RelationTypeTest.php @@ -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 775a4f645..ab63f640f 100755 --- a/tests/DataStorage/Database/Schema/BuilderTest.php +++ b/tests/DataStorage/Database/Schema/BuilderTest.php @@ -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..217242370 100755 --- a/tests/DataStorage/Database/Schema/Grammar/GrammarTest.php +++ b/tests/DataStorage/Database/Schema/Grammar/GrammarTest.php @@ -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 e5919ac36..d6f88c166 100755 --- a/tests/DataStorage/Database/Schema/Grammar/MysqlGrammarTest.php +++ b/tests/DataStorage/Database/Schema/Grammar/MysqlGrammarTest.php @@ -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 e0a9f314e..2a34d94f9 100755 --- a/tests/DataStorage/Database/Schema/Grammar/OracleGrammarTest.php +++ b/tests/DataStorage/Database/Schema/Grammar/OracleGrammarTest.php @@ -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 c447cee4a..c7d5ca292 100755 --- a/tests/DataStorage/Database/Schema/Grammar/PostgresGrammarTest.php +++ b/tests/DataStorage/Database/Schema/Grammar/PostgresGrammarTest.php @@ -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..48dad4823 100755 --- a/tests/DataStorage/Database/Schema/Grammar/SQLiteGrammarTest.php +++ b/tests/DataStorage/Database/Schema/Grammar/SQLiteGrammarTest.php @@ -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 b08512156..9de2bb2d7 100755 --- a/tests/DataStorage/Database/Schema/Grammar/SqlServerGrammarTest.php +++ b/tests/DataStorage/Database/Schema/Grammar/SqlServerGrammarTest.php @@ -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..a91950c28 100755 --- a/tests/DataStorage/Database/Schema/QueryTypeTest.php +++ b/tests/DataStorage/Database/Schema/QueryTypeTest.php @@ -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 e9633458b..95a3861b1 100755 --- a/tests/DataStorage/Database/SchemaMapperTest.php +++ b/tests/DataStorage/Database/SchemaMapperTest.php @@ -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/LockExceptionTest.php b/tests/DataStorage/LockExceptionTest.php index 412526f94..ed7a7ab7c 100755 --- a/tests/DataStorage/LockExceptionTest.php +++ b/tests/DataStorage/LockExceptionTest.php @@ -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..a80497d02 100755 --- a/tests/DataStorage/Session/HttpSessionTest.php +++ b/tests/DataStorage/Session/HttpSessionTest.php @@ -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 dfa160fdb..ae316c2f8 100755 --- a/tests/Dispatcher/DispatcherTest.php +++ b/tests/Dispatcher/DispatcherTest.php @@ -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,11 +47,8 @@ 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 { @@ -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,11 +193,8 @@ 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); @@ -226,11 +202,8 @@ final class DispatcherTest extends \PHPUnit\Framework\TestCase $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); @@ -238,11 +211,8 @@ final class DispatcherTest extends \PHPUnit\Framework\TestCase $this->app->dispatcher->dispatch('phpOMS\tests\Dispatcher\TestController::testFunctionStaticINVALID'); } - /** - * @testdox A malformed dispatch path throws UnexpectedValueException - * @covers \phpOMS\Dispatcher\Dispatcher - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A malformed dispatch path throws UnexpectedValueException')] public function testInvalidControllerString() : void { $this->expectException(\UnexpectedValueException::class); diff --git a/tests/Event/EventManagerTest.php b/tests/Event/EventManagerTest.php index 5874d58d3..6c15764c1 100755 --- a/tests/Event/EventManagerTest.php +++ b/tests/Event/EventManagerTest.php @@ -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/Image/KernelTest.php b/tests/Image/KernelTest.php index 0f8074969..a956fb851 100755 --- a/tests/Image/KernelTest.php +++ b/tests/Image/KernelTest.php @@ -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 ac7693ca5..bd1162aea 100755 --- a/tests/Image/SkewTest.php +++ b/tests/Image/SkewTest.php @@ -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 e14e2ac61..711aee18a 100755 --- a/tests/Image/ThresholdingTest.php +++ b/tests/Image/ThresholdingTest.php @@ -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 8a1fc85f4..cc5f67c36 100755 --- a/tests/Localization/Defaults/CityMapperTest.php +++ b/tests/Localization/Defaults/CityMapperTest.php @@ -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 60bf25a53..73eeba705 100755 --- a/tests/Localization/Defaults/CityTest.php +++ b/tests/Localization/Defaults/CityTest.php @@ -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 a3eac7e13..f28e38e80 100755 --- a/tests/Localization/Defaults/CountryMapperTest.php +++ b/tests/Localization/Defaults/CountryMapperTest.php @@ -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 44e697935..6280b40f2 100755 --- a/tests/Localization/Defaults/CountryTest.php +++ b/tests/Localization/Defaults/CountryTest.php @@ -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 3ba67b691..1cfaa6309 100755 --- a/tests/Localization/Defaults/CurrencyMapperTest.php +++ b/tests/Localization/Defaults/CurrencyMapperTest.php @@ -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 4b60e2cf9..ea2deb75a 100755 --- a/tests/Localization/Defaults/CurrencyTest.php +++ b/tests/Localization/Defaults/CurrencyTest.php @@ -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 acbbfdc37..0d5855662 100755 --- a/tests/Localization/Defaults/IbanMapperTest.php +++ b/tests/Localization/Defaults/IbanMapperTest.php @@ -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 a7752954b..631eef8e9 100755 --- a/tests/Localization/Defaults/IbanTest.php +++ b/tests/Localization/Defaults/IbanTest.php @@ -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 142092c95..25bd062e0 100755 --- a/tests/Localization/Defaults/LanguageMapperTest.php +++ b/tests/Localization/Defaults/LanguageMapperTest.php @@ -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 f1d707d81..ce10e4058 100755 --- a/tests/Localization/Defaults/LanguageTest.php +++ b/tests/Localization/Defaults/LanguageTest.php @@ -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..a525f5e19 100755 --- a/tests/Localization/ISO3166CharEnumTest.php +++ b/tests/Localization/ISO3166CharEnumTest.php @@ -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..959fdf4be 100755 --- a/tests/Localization/ISO3166NameEnumTest.php +++ b/tests/Localization/ISO3166NameEnumTest.php @@ -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..a0415db58 100755 --- a/tests/Localization/ISO3166NumEnumTest.php +++ b/tests/Localization/ISO3166NumEnumTest.php @@ -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..45c0ae331 100755 --- a/tests/Localization/ISO3166TwoEnumTest.php +++ b/tests/Localization/ISO3166TwoEnumTest.php @@ -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..7239f7fab 100755 --- a/tests/Localization/ISO4217CharEnumTest.php +++ b/tests/Localization/ISO4217CharEnumTest.php @@ -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..c55f2d101 100755 --- a/tests/Localization/ISO4217DecimalEnumTest.php +++ b/tests/Localization/ISO4217DecimalEnumTest.php @@ -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..21fd9484e 100755 --- a/tests/Localization/ISO4217EnumTest.php +++ b/tests/Localization/ISO4217EnumTest.php @@ -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..b93d3476d 100755 --- a/tests/Localization/ISO4217NumEnumTest.php +++ b/tests/Localization/ISO4217NumEnumTest.php @@ -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..782631c83 100755 --- a/tests/Localization/ISO4217SubUnitEnumTest.php +++ b/tests/Localization/ISO4217SubUnitEnumTest.php @@ -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..db775c50c 100755 --- a/tests/Localization/ISO4217SymbolEnumTest.php +++ b/tests/Localization/ISO4217SymbolEnumTest.php @@ -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..185ea0fd7 100755 --- a/tests/Localization/ISO639EnumTest.php +++ b/tests/Localization/ISO639EnumTest.php @@ -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..c42d68ee4 100755 --- a/tests/Localization/ISO639x1EnumTest.php +++ b/tests/Localization/ISO639x1EnumTest.php @@ -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..23033ff52 100755 --- a/tests/Localization/ISO639x2EnumTest.php +++ b/tests/Localization/ISO639x2EnumTest.php @@ -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..f66d44ad1 100755 --- a/tests/Localization/ISO8601EnumArrayTest.php +++ b/tests/Localization/ISO8601EnumArrayTest.php @@ -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 b5fc4fb89..4ac8525b7 100755 --- a/tests/Localization/L11nManagerTest.php +++ b/tests/Localization/L11nManagerTest.php @@ -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..d7fda1ce3 100644 --- a/tests/Localization/LanguageDetection/LanguageTest.php +++ b/tests/Localization/LanguageDetection/LanguageTest.php @@ -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 1df805230..3e8c09dd6 100755 --- a/tests/Localization/LocalizationTest.php +++ b/tests/Localization/LocalizationTest.php @@ -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..d85de5387 100755 --- a/tests/Localization/MoneyTest.php +++ b/tests/Localization/MoneyTest.php @@ -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..c2a8bc76a 100755 --- a/tests/Localization/PhoneEnumTest.php +++ b/tests/Localization/PhoneEnumTest.php @@ -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..8cc8da101 100755 --- a/tests/Localization/TimeZoneEnumArrayTest.php +++ b/tests/Localization/TimeZoneEnumArrayTest.php @@ -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 4f0119ffe..812099e30 100755 --- a/tests/Log/FileLoggerTest.php +++ b/tests/Log/FileLoggerTest.php @@ -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..ba50500a4 100755 --- a/tests/Log/LogLevelTest.php +++ b/tests/Log/LogLevelTest.php @@ -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 78% rename from tests/Math/Exception/ZeroDevisionExceptionTest.php rename to tests/Math/Exception/ZeroDivisionExceptionTest.php index 4f92b95f9..97f613638 --- a/tests/Math/Exception/ZeroDevisionExceptionTest.php +++ b/tests/Math/Exception/ZeroDivisionExceptionTest.php @@ -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 1eb145001..7ad3d413f 100644 --- a/tests/Math/Functions/AlgebraTest.php +++ b/tests/Math/Functions/AlgebraTest.php @@ -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 diff --git a/tests/Math/Functions/BetaTest.php b/tests/Math/Functions/BetaTest.php index aa5344474..e640ab148 100755 --- a/tests/Math/Functions/BetaTest.php +++ b/tests/Math/Functions/BetaTest.php @@ -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 eec3f2135..50d921a38 100755 --- a/tests/Math/Functions/FibonacciTest.php +++ b/tests/Math/Functions/FibonacciTest.php @@ -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 501eab897..2bee2d224 100755 --- a/tests/Math/Functions/FunctionsTest.php +++ b/tests/Math/Functions/FunctionsTest.php @@ -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 8befc61d1..0f14f2028 100755 --- a/tests/Math/Functions/GammaTest.php +++ b/tests/Math/Functions/GammaTest.php @@ -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 1c91389f6..609ed6350 100644 --- a/tests/Math/Geometry/ConvexHull/GrahamScanTest.php +++ b/tests/Math/Geometry/ConvexHull/GrahamScanTest.php @@ -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 9b6dc8696..860573c3f 100755 --- a/tests/Math/Geometry/ConvexHull/MonotoneChainTest.php +++ b/tests/Math/Geometry/ConvexHull/MonotoneChainTest.php @@ -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 4500ee47c..7dd5807e5 100755 --- a/tests/Math/Geometry/Shape/D2/CircleTest.php +++ b/tests/Math/Geometry/Shape/D2/CircleTest.php @@ -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 e9b92f898..6e311e5ac 100755 --- a/tests/Math/Geometry/Shape/D2/EllipseTest.php +++ b/tests/Math/Geometry/Shape/D2/EllipseTest.php @@ -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 3113732d0..d46ed1fa0 100755 --- a/tests/Math/Geometry/Shape/D2/PolygonTest.php +++ b/tests/Math/Geometry/Shape/D2/PolygonTest.php @@ -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 68d95ce2d..95daedf6e 100755 --- a/tests/Math/Geometry/Shape/D2/QuadrilateralTest.php +++ b/tests/Math/Geometry/Shape/D2/QuadrilateralTest.php @@ -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 f7c6b0bda..9d5c4da46 100755 --- a/tests/Math/Geometry/Shape/D2/RectangleTest.php +++ b/tests/Math/Geometry/Shape/D2/RectangleTest.php @@ -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 ce45d72ca..104248fcc 100755 --- a/tests/Math/Geometry/Shape/D2/TrapezoidTest.php +++ b/tests/Math/Geometry/Shape/D2/TrapezoidTest.php @@ -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 c2ddfc5fe..d15d5b80e 100755 --- a/tests/Math/Geometry/Shape/D2/TriangleTest.php +++ b/tests/Math/Geometry/Shape/D2/TriangleTest.php @@ -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 a37c4a13e..82b02a60f 100755 --- a/tests/Math/Geometry/Shape/D3/ConeTest.php +++ b/tests/Math/Geometry/Shape/D3/ConeTest.php @@ -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 9be1625b5..e54b8bcb2 100755 --- a/tests/Math/Geometry/Shape/D3/CuboidTest.php +++ b/tests/Math/Geometry/Shape/D3/CuboidTest.php @@ -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 7e1be0a93..c517ce040 100755 --- a/tests/Math/Geometry/Shape/D3/CylinderTest.php +++ b/tests/Math/Geometry/Shape/D3/CylinderTest.php @@ -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 c291eac23..c083647dd 100755 --- a/tests/Math/Geometry/Shape/D3/PrismTest.php +++ b/tests/Math/Geometry/Shape/D3/PrismTest.php @@ -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 3094c750a..4f5a9a2c7 100755 --- a/tests/Math/Geometry/Shape/D3/RectangularPyramidTest.php +++ b/tests/Math/Geometry/Shape/D3/RectangularPyramidTest.php @@ -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 84f8a1afd..067967b9a 100755 --- a/tests/Math/Geometry/Shape/D3/SphereTest.php +++ b/tests/Math/Geometry/Shape/D3/SphereTest.php @@ -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 2ca873f0c..91537ec7d 100755 --- a/tests/Math/Geometry/Shape/D3/TetrahedronTest.php +++ b/tests/Math/Geometry/Shape/D3/TetrahedronTest.php @@ -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 5ee01cd9a..c87b336d8 100755 --- a/tests/Math/Matrix/CholeskyDecompositionTest.php +++ b/tests/Math/Matrix/CholeskyDecompositionTest.php @@ -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 ad942c52a..85a5ceff3 100755 --- a/tests/Math/Matrix/EigenvalueDecompositionTest.php +++ b/tests/Math/Matrix/EigenvalueDecompositionTest.php @@ -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 29eafefb3..288bb5396 100755 --- a/tests/Math/Matrix/Exception/InvalidDimensionExceptionTest.php +++ b/tests/Math/Matrix/Exception/InvalidDimensionExceptionTest.php @@ -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 c03681e9e..ebfa90674 100755 --- a/tests/Math/Matrix/IdentityMatrixTest.php +++ b/tests/Math/Matrix/IdentityMatrixTest.php @@ -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 ddb1f6204..27b547d8a 100755 --- a/tests/Math/Matrix/LUDecompositionTest.php +++ b/tests/Math/Matrix/LUDecompositionTest.php @@ -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 1ade32a4e..83345b289 100755 --- a/tests/Math/Matrix/MatrixTest.php +++ b/tests/Math/Matrix/MatrixTest.php @@ -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); diff --git a/tests/Math/Matrix/QRDecompositionTest.php b/tests/Math/Matrix/QRDecompositionTest.php index abfd6fcae..f6145ea2b 100755 --- a/tests/Math/Matrix/QRDecompositionTest.php +++ b/tests/Math/Matrix/QRDecompositionTest.php @@ -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 9deb9f7e2..b65524415 100755 --- a/tests/Math/Matrix/VectorTest.php +++ b/tests/Math/Matrix/VectorTest.php @@ -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 1ba77d1f1..b46b1cfad 100755 --- a/tests/Math/Number/ComplexTest.php +++ b/tests/Math/Number/ComplexTest.php @@ -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 d1120a1f2..49f744c1e 100755 --- a/tests/Math/Number/IntegerTest.php +++ b/tests/Math/Number/IntegerTest.php @@ -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 9ddc3ef6d..7bb7913b8 100755 --- a/tests/Math/Number/NaturalTest.php +++ b/tests/Math/Number/NaturalTest.php @@ -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..23b1b0095 100755 --- a/tests/Math/Number/NumberTypeTest.php +++ b/tests/Math/Number/NumberTypeTest.php @@ -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 134be0645..5d038ad36 100755 --- a/tests/Math/Number/NumbersTest.php +++ b/tests/Math/Number/NumbersTest.php @@ -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 584c330ee..0b9c7b128 100755 --- a/tests/Math/Number/PrimeTest.php +++ b/tests/Math/Number/PrimeTest.php @@ -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 1575d4989..f2579ec0c 100755 --- a/tests/Math/Numerics/IntegrationTest.php +++ b/tests/Math/Numerics/IntegrationTest.php @@ -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 09c3e5bd9..1e9937699 100755 --- a/tests/Math/Numerics/Interpolation/CubicSplineInterpolationTest.php +++ b/tests/Math/Numerics/Interpolation/CubicSplineInterpolationTest.php @@ -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 21c0df05f..1181f1c61 100755 --- a/tests/Math/Numerics/Interpolation/LagrangeInterpolationTest.php +++ b/tests/Math/Numerics/Interpolation/LagrangeInterpolationTest.php @@ -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 c29455194..68d9c5985 100755 --- a/tests/Math/Numerics/Interpolation/LinearInterpolationTest.php +++ b/tests/Math/Numerics/Interpolation/LinearInterpolationTest.php @@ -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..26fe445a0 100644 --- a/tests/Math/Optimization/SimplexTest.php +++ b/tests/Math/Optimization/SimplexTest.php @@ -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 2cc37b2e2..adb612c3e 100755 --- a/tests/Math/Parser/EvaluatorTest.php +++ b/tests/Math/Parser/EvaluatorTest.php @@ -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..5bc5f3036 100644 --- a/tests/Math/Solver/Root/BisectionTest.php +++ b/tests/Math/Solver/Root/BisectionTest.php @@ -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..8ee62a973 100644 --- a/tests/Math/Solver/Root/IllinoisTest.php +++ b/tests/Math/Solver/Root/IllinoisTest.php @@ -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..6e745ca80 100644 --- a/tests/Math/Solver/Root/RegulaFalsiTest.php +++ b/tests/Math/Solver/Root/RegulaFalsiTest.php @@ -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 393491b32..da7d81825 100755 --- a/tests/Math/Statistic/AverageTest.php +++ b/tests/Math/Statistic/AverageTest.php @@ -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 73a61dc52..2b5784ce8 100755 --- a/tests/Math/Statistic/BasicTest.php +++ b/tests/Math/Statistic/BasicTest.php @@ -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..22de50bbe 100755 --- a/tests/Math/Statistic/CorrelationTest.php +++ b/tests/Math/Statistic/CorrelationTest.php @@ -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 079d3bcfe..3130b5885 100755 --- a/tests/Math/Statistic/Forecast/ErrorTest.php +++ b/tests/Math/Statistic/Forecast/ErrorTest.php @@ -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/Regression/LevelLevelRegressionTest.php b/tests/Math/Statistic/Forecast/Regression/LevelLevelRegressionTest.php index caa334d5d..acd90d1f9 100755 --- a/tests/Math/Statistic/Forecast/Regression/LevelLevelRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/LevelLevelRegressionTest.php @@ -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..f11fe8f43 100755 --- a/tests/Math/Statistic/Forecast/Regression/LevelLogRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/LevelLogRegressionTest.php @@ -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..ed1b08019 100755 --- a/tests/Math/Statistic/Forecast/Regression/LogLevelRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/LogLevelRegressionTest.php @@ -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..d8af6f9d6 100755 --- a/tests/Math/Statistic/Forecast/Regression/LogLogRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/LogLogRegressionTest.php @@ -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..60bf4e888 100755 --- a/tests/Math/Statistic/Forecast/Regression/PolynomialRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/PolynomialRegressionTest.php @@ -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 1eab20734..18a7b903a 100755 --- a/tests/Math/Statistic/MeasureOfDispersionTest.php +++ b/tests/Math/Statistic/MeasureOfDispersionTest.php @@ -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 d869abbb2..f3e7c21de 100755 --- a/tests/Math/Stochastic/Distribution/BernoulliDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/BernoulliDistributionTest.php @@ -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 35bd60484..020ba0ec2 100755 --- a/tests/Math/Stochastic/Distribution/BetaDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/BetaDistributionTest.php @@ -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 57272a83c..401d4ee6f 100755 --- a/tests/Math/Stochastic/Distribution/BinomialDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/BinomialDistributionTest.php @@ -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 fc7f0ee71..f8ef94252 100755 --- a/tests/Math/Stochastic/Distribution/CauchyDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/CauchyDistributionTest.php @@ -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 63a102b86..ec00da11c 100755 --- a/tests/Math/Stochastic/Distribution/ChiSquaredDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/ChiSquaredDistributionTest.php @@ -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 4ff5cd94c..74eacb752 100755 --- a/tests/Math/Stochastic/Distribution/ExponentialDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/ExponentialDistributionTest.php @@ -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 a474dccbc..41eedabea 100755 --- a/tests/Math/Stochastic/Distribution/FDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/FDistributionTest.php @@ -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 6d6ac0093..0535a1c6d 100755 --- a/tests/Math/Stochastic/Distribution/GammaDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/GammaDistributionTest.php @@ -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 0cd2cd8f3..f86e2d4b4 100755 --- a/tests/Math/Stochastic/Distribution/GeometricDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/GeometricDistributionTest.php @@ -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 2be7dd5e7..5b330b1e6 100755 --- a/tests/Math/Stochastic/Distribution/HypergeometricDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/HypergeometricDistributionTest.php @@ -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 0ff8faefe..dd2310bce 100755 --- a/tests/Math/Stochastic/Distribution/LaplaceDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/LaplaceDistributionTest.php @@ -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 ef9970623..330df50bb 100755 --- a/tests/Math/Stochastic/Distribution/LogDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/LogDistributionTest.php @@ -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 67d4c4545..49d43e7f3 100755 --- a/tests/Math/Stochastic/Distribution/LogNormalDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/LogNormalDistributionTest.php @@ -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 5e492b30e..0a7ac5751 100755 --- a/tests/Math/Stochastic/Distribution/LogisticDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/LogisticDistributionTest.php @@ -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 83884ca55..eef687e8f 100755 --- a/tests/Math/Stochastic/Distribution/NormalDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/NormalDistributionTest.php @@ -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 7e50db7d8..1ee427b6a 100755 --- a/tests/Math/Stochastic/Distribution/ParetoDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/ParetoDistributionTest.php @@ -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 7c846973b..55022a7e7 100755 --- a/tests/Math/Stochastic/Distribution/PoissonDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/PoissonDistributionTest.php @@ -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 5c3d5d23e..946669baf 100755 --- a/tests/Math/Stochastic/Distribution/TDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/TDistributionTest.php @@ -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 807c79345..882801265 100755 --- a/tests/Math/Stochastic/Distribution/UniformDistributionContinuousTest.php +++ b/tests/Math/Stochastic/Distribution/UniformDistributionContinuousTest.php @@ -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 d22c6499a..8d199aad3 100755 --- a/tests/Math/Stochastic/Distribution/UniformDistributionDiscreteTest.php +++ b/tests/Math/Stochastic/Distribution/UniformDistributionDiscreteTest.php @@ -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 c649c6816..5288b0b07 100755 --- a/tests/Math/Stochastic/Distribution/WeibullDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/WeibullDistributionTest.php @@ -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 359a55a08..ad6c0b730 100644 --- a/tests/Math/Stochastic/Distribution/ZTestingTest.php +++ b/tests/Math/Stochastic/Distribution/ZTestingTest.php @@ -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..5e6f553c9 100755 --- a/tests/Math/Stochastic/NaiveBayesClassifierTest.php +++ b/tests/Math/Stochastic/NaiveBayesClassifierTest.php @@ -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..addb95337 100644 --- a/tests/Math/Topology/Kernel2DTest.php +++ b/tests/Math/Topology/Kernel2DTest.php @@ -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 80f75cddf..b32577e8f 100755 --- a/tests/Math/Topology/Metrics2DTest.php +++ b/tests/Math/Topology/Metrics2DTest.php @@ -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 62ea72c49..6cbcf5582 100755 --- a/tests/Math/Topology/MetricsNDTest.php +++ b/tests/Math/Topology/MetricsNDTest.php @@ -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,11 +120,8 @@ 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); @@ -159,11 +129,8 @@ final class MetricsNDTest extends \PHPUnit\Framework\TestCase MetricsND::manhattan([3, 6, 4], [4, 6, 8, 3]); } - /** - * @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); @@ -171,11 +138,8 @@ final class MetricsNDTest extends \PHPUnit\Framework\TestCase MetricsND::euclidean([3, 6, 4], [4, 6, 8, 3]); } - /** - * @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); @@ -183,11 +147,8 @@ final class MetricsNDTest extends \PHPUnit\Framework\TestCase MetricsND::chebyshev([3, 6, 4], [4, 6, 8, 3]); } - /** - * @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); @@ -195,11 +156,8 @@ final class MetricsNDTest extends \PHPUnit\Framework\TestCase MetricsND::minkowski([3, 6, 4], [4, 6, 8, 3], 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); @@ -207,11 +165,8 @@ final class MetricsNDTest extends \PHPUnit\Framework\TestCase MetricsND::canberra([3, 6, 4], [4, 6, 8, 3]); } - /** - * @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); @@ -219,11 +174,8 @@ final class MetricsNDTest extends \PHPUnit\Framework\TestCase MetricsND::cosine([3, 6, 4], [4, 6, 8, 3]); } - /** - * @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); @@ -231,11 +183,8 @@ final class MetricsNDTest extends \PHPUnit\Framework\TestCase MetricsND::brayCurtis([3, 6, 4], [4, 6, 8, 3]); } - /** - * @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); @@ -243,11 +192,8 @@ final class MetricsNDTest extends \PHPUnit\Framework\TestCase MetricsND::angularSeparation([3, 6, 4], [4, 6, 8, 3]); } - /** - * @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); diff --git a/tests/Message/Cli/CliHeaderTest.php b/tests/Message/Cli/CliHeaderTest.php index 64b92262c..5e101bc8e 100755 --- a/tests/Message/Cli/CliHeaderTest.php +++ b/tests/Message/Cli/CliHeaderTest.php @@ -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 0aa907036..d7df7cd06 100755 --- a/tests/Message/Cli/CliRequestTest.php +++ b/tests/Message/Cli/CliRequestTest.php @@ -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 a4040fcf8..dfba1ab12 100755 --- a/tests/Message/Cli/CliResponseTest.php +++ b/tests/Message/Cli/CliResponseTest.php @@ -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 8d670146d..7c30b0942 100755 --- a/tests/Message/HeaderAbstractTest.php +++ b/tests/Message/HeaderAbstractTest.php @@ -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..7c6199775 100755 --- a/tests/Message/Http/BrowserTypeTest.php +++ b/tests/Message/Http/BrowserTypeTest.php @@ -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 2237fc26c..f6a7111ff 100755 --- a/tests/Message/Http/HttpHeaderTest.php +++ b/tests/Message/Http/HttpHeaderTest.php @@ -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 7e75d44e3..27343e58e 100755 --- a/tests/Message/Http/HttpRequestTest.php +++ b/tests/Message/Http/HttpRequestTest.php @@ -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 f5fa12b5b..89a95feb3 100755 --- a/tests/Message/Http/HttpResponseTest.php +++ b/tests/Message/Http/HttpResponseTest.php @@ -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..6ab64e803 100755 --- a/tests/Message/Http/OSTypeTest.php +++ b/tests/Message/Http/OSTypeTest.php @@ -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..8b1dbc6c3 100755 --- a/tests/Message/Http/RequestMethodTest.php +++ b/tests/Message/Http/RequestMethodTest.php @@ -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..df294bd5a 100755 --- a/tests/Message/Http/RequestStatusCodeTest.php +++ b/tests/Message/Http/RequestStatusCodeTest.php @@ -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..de37c21b1 100755 --- a/tests/Message/Http/RequestStatusTest.php +++ b/tests/Message/Http/RequestStatusTest.php @@ -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 cbf59a382..1c85ea8a2 100755 --- a/tests/Message/Http/RestTest.php +++ b/tests/Message/Http/RestTest.php @@ -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..3f552bf0a 100755 --- a/tests/Message/Mail/EmailTest.php +++ b/tests/Message/Mail/EmailTest.php @@ -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..0b97f5f07 100755 --- a/tests/Message/Mail/ImapTest.php +++ b/tests/Message/Mail/ImapTest.php @@ -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..3b956d00e 100755 --- a/tests/Message/Mail/MailHandlerMailTrait.php +++ b/tests/Message/Mail/MailHandlerMailTrait.php @@ -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..1deca9739 100755 --- a/tests/Message/Mail/MailHandlerSendmailTrait.php +++ b/tests/Message/Mail/MailHandlerSendmailTrait.php @@ -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..c0b1c6ea3 100755 --- a/tests/Message/Mail/MailHandlerSmtpTrait.php +++ b/tests/Message/Mail/MailHandlerSmtpTrait.php @@ -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..0944dca51 100755 --- a/tests/Message/Mail/MailHandlerTest.php +++ b/tests/Message/Mail/MailHandlerTest.php @@ -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..7a40f21cb 100755 --- a/tests/Message/Mail/Pop3Test.php +++ b/tests/Message/Mail/Pop3Test.php @@ -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 5e8d39cda..9eab9f759 100755 --- a/tests/Message/RequestAbstractTest.php +++ b/tests/Message/RequestAbstractTest.php @@ -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 1a422b591..a0e7c5ad5 100755 --- a/tests/Message/ResponseAbstractTest.php +++ b/tests/Message/ResponseAbstractTest.php @@ -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/PacketTypeTest.php b/tests/Message/Socket/PacketTypeTest.php index 6be10b092..854be0ca3 100755 --- a/tests/Message/Socket/PacketTypeTest.php +++ b/tests/Message/Socket/PacketTypeTest.php @@ -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/Model/Html/FormElementGeneratorTest.php b/tests/Model/Html/FormElementGeneratorTest.php index eb9c75bba..b196da615 100755 --- a/tests/Model/Html/FormElementGeneratorTest.php +++ b/tests/Model/Html/FormElementGeneratorTest.php @@ -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 7f339dc14..5b399d343 100755 --- a/tests/Model/Html/HeadTest.php +++ b/tests/Model/Html/HeadTest.php @@ -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 34e9ef186..dee6e2a9a 100755 --- a/tests/Model/Html/MetaTest.php +++ b/tests/Model/Html/MetaTest.php @@ -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..cdfcfa7e3 100755 --- a/tests/Model/Message/DomActionTest.php +++ b/tests/Model/Message/DomActionTest.php @@ -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 62c75472e..9c04749d0 100755 --- a/tests/Model/Message/DomTest.php +++ b/tests/Model/Message/DomTest.php @@ -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 a79e91251..015cd40c9 100755 --- a/tests/Model/Message/FormValidationTest.php +++ b/tests/Model/Message/FormValidationTest.php @@ -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 1122b4a70..8fff5e536 100755 --- a/tests/Model/Message/NotifyTest.php +++ b/tests/Model/Message/NotifyTest.php @@ -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 09286640c..f37d6d187 100755 --- a/tests/Model/Message/RedirectTest.php +++ b/tests/Model/Message/RedirectTest.php @@ -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 19f00abd6..6141b4db4 100755 --- a/tests/Model/Message/ReloadTest.php +++ b/tests/Model/Message/ReloadTest.php @@ -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 34c58e24f..497894376 100755 --- a/tests/Module/Exception/InvalidModuleExceptionTest.php +++ b/tests/Module/Exception/InvalidModuleExceptionTest.php @@ -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 286ce52b7..1b4afc2bd 100755 --- a/tests/Module/Exception/InvalidThemeExceptionTest.php +++ b/tests/Module/Exception/InvalidThemeExceptionTest.php @@ -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 59c7ac6a8..3111fc5b7 100755 --- a/tests/Module/InstallerAbstractTest.php +++ b/tests/Module/InstallerAbstractTest.php @@ -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 a497caa32..4baad98d9 100755 --- a/tests/Module/ModuleAbstractTest.php +++ b/tests/Module/ModuleAbstractTest.php @@ -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,11 +400,8 @@ 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(); @@ -442,11 +412,8 @@ final class ModuleAbstractTest extends \PHPUnit\Framework\TestCase $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(); @@ -457,11 +424,8 @@ final class ModuleAbstractTest extends \PHPUnit\Framework\TestCase $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(); @@ -491,11 +452,8 @@ final class ModuleAbstractTest extends \PHPUnit\Framework\TestCase $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 c537e6093..bed7122f1 100755 --- a/tests/Module/ModuleInfoTest.php +++ b/tests/Module/ModuleInfoTest.php @@ -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 35835fb56..a56ed1664 100755 --- a/tests/Module/ModuleManagerTest.php +++ b/tests/Module/ModuleManagerTest.php @@ -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 c32154766..fc14a6d6f 100755 --- a/tests/Module/NullModuleTest.php +++ b/tests/Module/NullModuleTest.php @@ -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 46302a6a2..1ca33c960 100755 --- a/tests/Module/PackageManagerTest.php +++ b/tests/Module/PackageManagerTest.php @@ -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 a3fbcd08b..883157e47 100755 --- a/tests/Module/StatusAbstractTest.php +++ b/tests/Module/StatusAbstractTest.php @@ -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/UninstallerAbstractTest.php b/tests/Module/UninstallerAbstractTest.php index 01434ff99..5e2f53701 100755 --- a/tests/Module/UninstallerAbstractTest.php +++ b/tests/Module/UninstallerAbstractTest.php @@ -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/PreloaderTest.php b/tests/PreloaderTest.php index 83580e6b4..1fdb83ffd 100755 --- a/tests/PreloaderTest.php +++ b/tests/PreloaderTest.php @@ -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..8943b713b 100755 --- a/tests/Router/RouteVerbTest.php +++ b/tests/Router/RouteVerbTest.php @@ -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 e225cfdce..0df8d97f0 100755 --- a/tests/Router/SocketRouterTest.php +++ b/tests/Router/SocketRouterTest.php @@ -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 529b746a8..afeac30b1 100755 --- a/tests/Router/WebRouterTest.php +++ b/tests/Router/WebRouterTest.php @@ -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')); @@ -187,11 +163,8 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase ); } - /** - * @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')); @@ -206,11 +179,8 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase ); } - /** - * @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..18049ed80 100644 --- a/tests/Security/EncryptionHelperTest.php +++ b/tests/Security/EncryptionHelperTest.php @@ -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 3c3476c0a..97ef7bde4 100644 --- a/tests/Security/GuardTest.php +++ b/tests/Security/GuardTest.php @@ -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 adbeca470..320643ad3 100755 --- a/tests/Security/PhpCodeTest.php +++ b/tests/Security/PhpCodeTest.php @@ -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/ClientTest.php b/tests/Socket/Client/ClientTest.php index 334b7589d..b4773c55b 100755 --- a/tests/Socket/Client/ClientTest.php +++ b/tests/Socket/Client/ClientTest.php @@ -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/NullClientConnectionTest.php b/tests/Socket/Client/NullClientConnectionTest.php index daca61feb..d6936fe94 100755 --- a/tests/Socket/Client/NullClientConnectionTest.php +++ b/tests/Socket/Client/NullClientConnectionTest.php @@ -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/ServerTest.php b/tests/Socket/Server/ServerTest.php index e2f5f2894..548c3e7ae 100755 --- a/tests/Socket/Server/ServerTest.php +++ b/tests/Socket/Server/ServerTest.php @@ -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/Stdlib/Base/AddressTest.php b/tests/Stdlib/Base/AddressTest.php index a17f7a5e5..96942e495 100755 --- a/tests/Stdlib/Base/AddressTest.php +++ b/tests/Stdlib/Base/AddressTest.php @@ -18,10 +18,10 @@ 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,11 +34,8 @@ 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 = [ @@ -59,22 +56,16 @@ 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 = [ @@ -94,11 +85,8 @@ final class AddressTest extends \PHPUnit\Framework\TestCase 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 = [ diff --git a/tests/Stdlib/Base/AddressTypeTest.php b/tests/Stdlib/Base/AddressTypeTest.php index 4b63a56d8..81d1d44e9 100755 --- a/tests/Stdlib/Base/AddressTypeTest.php +++ b/tests/Stdlib/Base/AddressTypeTest.php @@ -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/EnumArrayTest.php b/tests/Stdlib/Base/EnumArrayTest.php index fa4fe4807..dcd7fd422 100755 --- a/tests/Stdlib/Base/EnumArrayTest.php +++ b/tests/Stdlib/Base/EnumArrayTest.php @@ -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/EnumTest.php b/tests/Stdlib/Base/EnumTest.php index 7ac43583c..7a07a0626 100755 --- a/tests/Stdlib/Base/EnumTest.php +++ b/tests/Stdlib/Base/EnumTest.php @@ -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 44056753f..ea7deb893 100755 --- a/tests/Stdlib/Base/Exception/InvalidEnumNameTest.php +++ b/tests/Stdlib/Base/Exception/InvalidEnumNameTest.php @@ -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 167b421d9..0f3c28a71 100755 --- a/tests/Stdlib/Base/Exception/InvalidEnumValueTest.php +++ b/tests/Stdlib/Base/Exception/InvalidEnumValueTest.php @@ -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/HeapTest.php b/tests/Stdlib/Base/HeapTest.php index 6b5fc70cf..f687a08e9 100755 --- a/tests/Stdlib/Base/HeapTest.php +++ b/tests/Stdlib/Base/HeapTest.php @@ -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 a94749a07..8f5f614eb 100755 --- a/tests/Stdlib/Base/IbanTest.php +++ b/tests/Stdlib/Base/IbanTest.php @@ -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 73043ba10..3ba6cd923 100755 --- a/tests/Stdlib/Base/LocationTest.php +++ b/tests/Stdlib/Base/LocationTest.php @@ -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 dc452f999..3b8515b6a 100755 --- a/tests/Stdlib/Base/NullLocationTest.php +++ b/tests/Stdlib/Base/NullLocationTest.php @@ -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..fe74cefcb 100755 --- a/tests/Stdlib/Base/PhoneTypeTest.php +++ b/tests/Stdlib/Base/PhoneTypeTest.php @@ -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 a51760b8a..62dbbfdfc 100755 --- a/tests/Stdlib/Base/SmartDateTimeTest.php +++ b/tests/Stdlib/Base/SmartDateTimeTest.php @@ -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 444963300..4fa0b4639 100755 --- a/tests/Stdlib/Graph/EdgeTest.php +++ b/tests/Stdlib/Graph/EdgeTest.php @@ -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 4614c7845..7006be2ef 100755 --- a/tests/Stdlib/Graph/GraphTest.php +++ b/tests/Stdlib/Graph/GraphTest.php @@ -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 93dd3f5d2..607058d8c 100755 --- a/tests/Stdlib/Graph/NodeTest.php +++ b/tests/Stdlib/Graph/NodeTest.php @@ -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,12 @@ 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..5ce2b409f 100755 --- a/tests/Stdlib/Map/KeyTypeTest.php +++ b/tests/Stdlib/Map/KeyTypeTest.php @@ -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 94086c6cd..eff7aeace 100755 --- a/tests/Stdlib/Map/MultiMapTest.php +++ b/tests/Stdlib/Map/MultiMapTest.php @@ -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..315fec6e8 100755 --- a/tests/Stdlib/Map/OrderTypeTest.php +++ b/tests/Stdlib/Map/OrderTypeTest.php @@ -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..4824fe7db 100755 --- a/tests/Stdlib/Queue/PriorityModeTest.php +++ b/tests/Stdlib/Queue/PriorityModeTest.php @@ -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 ea4889ecc..49496c8c8 100755 --- a/tests/Stdlib/Queue/PriorityQueueTest.php +++ b/tests/Stdlib/Queue/PriorityQueueTest.php @@ -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..6eac4d46e 100644 --- a/tests/Stdlib/Tree/BinarySearchTreeTest.php +++ b/tests/Stdlib/Tree/BinarySearchTreeTest.php @@ -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..f3c5d81a8 100755 --- a/tests/System/CharsetTypeTest.php +++ b/tests/System/CharsetTypeTest.php @@ -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..565ad872f 100755 --- a/tests/System/File/ContentPutModeTest.php +++ b/tests/System/File/ContentPutModeTest.php @@ -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..a00f31ae5 100755 --- a/tests/System/File/ExtensionTypeTest.php +++ b/tests/System/File/ExtensionTypeTest.php @@ -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 d98f13c75..fe860cf70 100755 --- a/tests/System/File/FileUtilsTest.php +++ b/tests/System/File/FileUtilsTest.php @@ -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 5f397fc40..f68391367 100755 --- a/tests/System/File/Ftp/DirectoryTest.php +++ b/tests/System/File/Ftp/DirectoryTest.php @@ -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 e70b028d6..b14aecaeb 100755 --- a/tests/System/File/Ftp/FileTest.php +++ b/tests/System/File/Ftp/FileTest.php @@ -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 555d906ea..ca016df9c 100755 --- a/tests/System/File/Ftp/FtpStorageTest.php +++ b/tests/System/File/Ftp/FtpStorageTest.php @@ -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 09d4a2deb..dac83ef0b 100755 --- a/tests/System/File/Local/DirectoryTest.php +++ b/tests/System/File/Local/DirectoryTest.php @@ -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 aab5cfb34..0ecea45df 100755 --- a/tests/System/File/Local/FileTest.php +++ b/tests/System/File/Local/FileTest.php @@ -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 e5dff3d2e..233f673f1 100755 --- a/tests/System/File/Local/LocalStorageTest.php +++ b/tests/System/File/Local/LocalStorageTest.php @@ -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 449cbae62..f065dff44 100755 --- a/tests/System/File/PathExceptionTest.php +++ b/tests/System/File/PathExceptionTest.php @@ -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 ef073f932..6bb3c5767 100755 --- a/tests/System/File/PermissionExceptionTest.php +++ b/tests/System/File/PermissionExceptionTest.php @@ -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 e90a83fc7..da7633eec 100755 --- a/tests/System/File/StorageTest.php +++ b/tests/System/File/StorageTest.php @@ -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 2c93b0a31..49541539b 100755 --- a/tests/System/MimeTypeTest.php +++ b/tests/System/MimeTypeTest.php @@ -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 0ae4919dd..a61e94743 100755 --- a/tests/System/OperatingSystemTest.php +++ b/tests/System/OperatingSystemTest.php @@ -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 f152ae60f..ecfab681b 100755 --- a/tests/System/Search/StringSearchTest.php +++ b/tests/System/Search/StringSearchTest.php @@ -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..0b637dce8 100755 --- a/tests/System/SystemTypeTest.php +++ b/tests/System/SystemTypeTest.php @@ -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 5b3aeca7b..5be7dcf4a 100755 --- a/tests/System/SystemUtilsTest.php +++ b/tests/System/SystemUtilsTest.php @@ -19,17 +19,14 @@ 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()); @@ -43,11 +40,8 @@ final class SystemUtilsTest extends \PHPUnit\Framework\TestCase } } - /** - * @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/Uri/ArgumentTest.php b/tests/Uri/ArgumentTest.php index d1dcd98b5..e01ffd6a5 100755 --- a/tests/Uri/ArgumentTest.php +++ b/tests/Uri/ArgumentTest.php @@ -19,17 +19,14 @@ require_once __DIR__ . '/../Autoloader.php'; use phpOMS\Uri\Argument; /** - * @testdox phpOMS\tests\Uri\ArgumentTest: Argument uri / uri - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\phpOMS\Uri\Argument::class)] +#[\PHPUnit\Framework\Attributes\TestDox('phpOMS\tests\Uri\ArgumentTest: Argument uri / uri')] final class ArgumentTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox A uri can be validated - * @covers \phpOMS\Uri\Argument - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('A uri can be validated')] public function testValidator() : void { self::assertTrue(Argument::isValid('http://www.google.de')); @@ -39,11 +36,8 @@ final class ArgumentTest extends \PHPUnit\Framework\TestCase self::assertTrue(Argument::isValid('https:/google.de')); } - /** - * @testdox The argument uri has the expected default values after initialization - * @covers \phpOMS\Uri\Argument - * @group framework - */ + #[\PHPUnit\Framework\Attributes\Group('framework')] + #[\PHPUnit\Framework\Attributes\TestDox('The argument uri has the expected default values after initialization')] public function testDefault() : void { $obj = new Argument(':modules/admin/test/path.php ?para1=abc ?para2=2 #frag'); @@ -60,11 +54,8 @@ final class ArgumentTest extends \PHPUnit\Framework\TestCase self::assertEquals('', $obj->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 9f9fe71c3..49a9f10f4 100755 --- a/tests/Uri/HttpUriTest.php +++ b/tests/Uri/HttpUriTest.php @@ -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 90b717b78..608e57823 100755 --- a/tests/Uri/InvalidUriExceptionTest.php +++ b/tests/Uri/InvalidUriExceptionTest.php @@ -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 d9556b1a7..010dff9fa 100755 --- a/tests/Uri/UriFactoryTest.php +++ b/tests/Uri/UriFactoryTest.php @@ -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..32f0af18b 100755 --- a/tests/Uri/UriSchemeTest.php +++ b/tests/Uri/UriSchemeTest.php @@ -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 4a8229865..2d20be07c 100755 --- a/tests/Utils/ArrayUtilsTest.php +++ b/tests/Utils/ArrayUtilsTest.php @@ -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,16 @@ 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 +246,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/BarAbstractTest.php b/tests/Utils/Barcode/BarAbstractTest.php index 1235e8deb..1285cc6c7 100755 --- a/tests/Utils/Barcode/BarAbstractTest.php +++ b/tests/Utils/Barcode/BarAbstractTest.php @@ -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 61ed481aa..37e8899f9 100755 --- a/tests/Utils/Barcode/C128aTest.php +++ b/tests/Utils/Barcode/C128aTest.php @@ -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 f7f878fea..cf38f2950 100755 --- a/tests/Utils/Barcode/C128bTest.php +++ b/tests/Utils/Barcode/C128bTest.php @@ -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 16ae98dde..b94e02251 100755 --- a/tests/Utils/Barcode/C128cTest.php +++ b/tests/Utils/Barcode/C128cTest.php @@ -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 98cf8813f..cd59e14c9 100755 --- a/tests/Utils/Barcode/C25Test.php +++ b/tests/Utils/Barcode/C25Test.php @@ -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 3e56d7820..855099825 100755 --- a/tests/Utils/Barcode/C39Test.php +++ b/tests/Utils/Barcode/C39Test.php @@ -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 44ac8c4ff..28f394d3f 100755 --- a/tests/Utils/Barcode/CodebarTest.php +++ b/tests/Utils/Barcode/CodebarTest.php @@ -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 40d1acf0d..77d538547 100755 --- a/tests/Utils/Barcode/DatamatrixTest.php +++ b/tests/Utils/Barcode/DatamatrixTest.php @@ -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/OrientationTypeTest.php b/tests/Utils/Barcode/OrientationTypeTest.php index 3ba59493a..85ca55594 100755 --- a/tests/Utils/Barcode/OrientationTypeTest.php +++ b/tests/Utils/Barcode/OrientationTypeTest.php @@ -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 d3bce1fb6..a7cf87ca1 100755 --- a/tests/Utils/Barcode/QRTest.php +++ b/tests/Utils/Barcode/QRTest.php @@ -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/ColorUtilsTest.php b/tests/Utils/ColorUtilsTest.php index e50082822..b68034f4d 100755 --- a/tests/Utils/ColorUtilsTest.php +++ b/tests/Utils/ColorUtilsTest.php @@ -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 945949959..b29424392 100755 --- a/tests/Utils/Compression/LZWTest.php +++ b/tests/Utils/Compression/LZWTest.php @@ -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..20d75c89e 100755 --- a/tests/Utils/Converter/AngleTypeTest.php +++ b/tests/Utils/Converter/AngleTypeTest.php @@ -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..cb034d1b3 100755 --- a/tests/Utils/Converter/AreaTypeTest.php +++ b/tests/Utils/Converter/AreaTypeTest.php @@ -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 2480db101..ed021503a 100755 --- a/tests/Utils/Converter/CurrencyTest.php +++ b/tests/Utils/Converter/CurrencyTest.php @@ -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..88fbf7b22 100755 --- a/tests/Utils/Converter/EnergyPowerTypeTest.php +++ b/tests/Utils/Converter/EnergyPowerTypeTest.php @@ -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 640ceb584..c82430b45 100755 --- a/tests/Utils/Converter/FileSizeTypeTest.php +++ b/tests/Utils/Converter/FileSizeTypeTest.php @@ -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 0242c8a00..7967623a4 100755 --- a/tests/Utils/Converter/FileTest.php +++ b/tests/Utils/Converter/FileTest.php @@ -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 5220e7f66..2500a9e9d 100755 --- a/tests/Utils/Converter/IpTest.php +++ b/tests/Utils/Converter/IpTest.php @@ -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..fbdecf3bb 100755 --- a/tests/Utils/Converter/LengthTypeTest.php +++ b/tests/Utils/Converter/LengthTypeTest.php @@ -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 9451c57f3..f5f8d4909 100755 --- a/tests/Utils/Converter/MeasurementTest.php +++ b/tests/Utils/Converter/MeasurementTest.php @@ -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 16285cf3d..c5de74536 100755 --- a/tests/Utils/Converter/NumericTest.php +++ b/tests/Utils/Converter/NumericTest.php @@ -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..54f45628a 100755 --- a/tests/Utils/Converter/PressureTypeTest.php +++ b/tests/Utils/Converter/PressureTypeTest.php @@ -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..3525f2003 100755 --- a/tests/Utils/Converter/SpeedTypeTest.php +++ b/tests/Utils/Converter/SpeedTypeTest.php @@ -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..38122f982 100755 --- a/tests/Utils/Converter/TemperatureTypeTest.php +++ b/tests/Utils/Converter/TemperatureTypeTest.php @@ -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..59dfa2517 100755 --- a/tests/Utils/Converter/TimeTypeTest.php +++ b/tests/Utils/Converter/TimeTypeTest.php @@ -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..58316a7cd 100755 --- a/tests/Utils/Converter/VolumeTypeTest.php +++ b/tests/Utils/Converter/VolumeTypeTest.php @@ -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..1e173620b 100755 --- a/tests/Utils/Converter/WeightTypeTest.php +++ b/tests/Utils/Converter/WeightTypeTest.php @@ -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 b932ffa8e..24c1b154a 100755 --- a/tests/Utils/Encoding/CaesarTest.php +++ b/tests/Utils/Encoding/CaesarTest.php @@ -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 3eceb83ea..bd41a4acc 100755 --- a/tests/Utils/Encoding/GrayTest.php +++ b/tests/Utils/Encoding/GrayTest.php @@ -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 196d2bad9..9bcff454a 100755 --- a/tests/Utils/Encoding/Huffman/DictionaryTest.php +++ b/tests/Utils/Encoding/Huffman/DictionaryTest.php @@ -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..3c609e2ed 100755 --- a/tests/Utils/Encoding/Huffman/HuffmanTest.php +++ b/tests/Utils/Encoding/Huffman/HuffmanTest.php @@ -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 4ecaf20dc..bf1ddb807 100755 --- a/tests/Utils/Encoding/XorEncodingTest.php +++ b/tests/Utils/Encoding/XorEncodingTest.php @@ -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/Git/AuthorTest.php b/tests/Utils/Git/AuthorTest.php index b2d832c98..ff2d7bcfc 100755 --- a/tests/Utils/Git/AuthorTest.php +++ b/tests/Utils/Git/AuthorTest.php @@ -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 6cf498dc1..741cb0330 100755 --- a/tests/Utils/Git/BranchTest.php +++ b/tests/Utils/Git/BranchTest.php @@ -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 37b7fa388..62494aabe 100755 --- a/tests/Utils/Git/CommitTest.php +++ b/tests/Utils/Git/CommitTest.php @@ -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 667ababb3..38f75971d 100755 --- a/tests/Utils/Git/GitTest.php +++ b/tests/Utils/Git/GitTest.php @@ -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 557bd9a62..67a3b0251 100755 --- a/tests/Utils/Git/RepositoryTest.php +++ b/tests/Utils/Git/RepositoryTest.php @@ -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 57be3bb87..ae74c4955 100755 --- a/tests/Utils/Git/TagTest.php +++ b/tests/Utils/Git/TagTest.php @@ -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 f880a59ad..093120aaa 100755 --- a/tests/Utils/IO/Csv/CsvSettingsTest.php +++ b/tests/Utils/IO/Csv/CsvSettingsTest.php @@ -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/Json/InvalidJsonExceptionTest.php b/tests/Utils/IO/Json/InvalidJsonExceptionTest.php index 9c59cf631..5bb6cd7de 100755 --- a/tests/Utils/IO/Json/InvalidJsonExceptionTest.php +++ b/tests/Utils/IO/Json/InvalidJsonExceptionTest.php @@ -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 8223bb9aa..0a1943a90 100755 --- a/tests/Utils/IO/Spreadsheet/SpreadsheetDatabaseMapperTest.php +++ b/tests/Utils/IO/Spreadsheet/SpreadsheetDatabaseMapperTest.php @@ -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 2afde6ec5..dc5e92c39 100755 --- a/tests/Utils/IO/Zip/GzTest.php +++ b/tests/Utils/IO/Zip/GzTest.php @@ -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 416b9398f..da97ff234 100755 --- a/tests/Utils/IO/Zip/TarGzTest.php +++ b/tests/Utils/IO/Zip/TarGzTest.php @@ -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 2d4771e4d..11c3d2cee 100755 --- a/tests/Utils/IO/Zip/TarTest.php +++ b/tests/Utils/IO/Zip/TarTest.php @@ -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 9cd7cfd12..ea1d4ba15 100755 --- a/tests/Utils/IO/Zip/ZipTest.php +++ b/tests/Utils/IO/Zip/ZipTest.php @@ -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 7b12f00f5..dd86a154a 100755 --- a/tests/Utils/ImageUtilsTest.php +++ b/tests/Utils/ImageUtilsTest.php @@ -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 4554733c1..6acacde8f 100755 --- a/tests/Utils/MbStringUtilsTest.php +++ b/tests/Utils/MbStringUtilsTest.php @@ -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 a214b2e66..ad5961e76 100755 --- a/tests/Utils/NumericUtilsTest.php +++ b/tests/Utils/NumericUtilsTest.php @@ -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/Parser/Markdown/MarkdownTest.php b/tests/Utils/Parser/Markdown/MarkdownTest.php index f0ef442ed..71d65ba06 100755 --- a/tests/Utils/Parser/Markdown/MarkdownTest.php +++ b/tests/Utils/Parser/Markdown/MarkdownTest.php @@ -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 172831e1d..725712e37 100755 --- a/tests/Utils/Parser/Php/ArrayParserTest.php +++ b/tests/Utils/Parser/Php/ArrayParserTest.php @@ -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/PermutationTest.php b/tests/Utils/PermutationTest.php index 0817b9ac4..2a0dc5031 100755 --- a/tests/Utils/PermutationTest.php +++ b/tests/Utils/PermutationTest.php @@ -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 87ccce423..15052fb66 100755 --- a/tests/Utils/RnG/ArrayRandomizeTest.php +++ b/tests/Utils/RnG/ArrayRandomizeTest.php @@ -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 90683f9c8..7570f6be8 100755 --- a/tests/Utils/RnG/DateTimeTest.php +++ b/tests/Utils/RnG/DateTimeTest.php @@ -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..e85408fa8 100755 --- a/tests/Utils/RnG/DistributionTypeTest.php +++ b/tests/Utils/RnG/DistributionTypeTest.php @@ -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 57670ef3d..6afdd3878 100755 --- a/tests/Utils/RnG/FileTest.php +++ b/tests/Utils/RnG/FileTest.php @@ -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 c907fa071..c6a61b5b6 100755 --- a/tests/Utils/RnG/LinearCongruentialGeneratorTest.php +++ b/tests/Utils/RnG/LinearCongruentialGeneratorTest.php @@ -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 67eb6d23c..7f27b64c2 100755 --- a/tests/Utils/RnG/NameTest.php +++ b/tests/Utils/RnG/NameTest.php @@ -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 91eda43a5..061481b3b 100755 --- a/tests/Utils/RnG/PhoneTest.php +++ b/tests/Utils/RnG/PhoneTest.php @@ -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 2719ea69e..5e992f198 100755 --- a/tests/Utils/RnG/StringUtilsTest.php +++ b/tests/Utils/RnG/StringUtilsTest.php @@ -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 d95bacf4c..a0b29debe 100755 --- a/tests/Utils/RnG/TextTest.php +++ b/tests/Utils/RnG/TextTest.php @@ -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 943f0d3a9..c3f70f968 100755 --- a/tests/Utils/StringCompareTest.php +++ b/tests/Utils/StringCompareTest.php @@ -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 e5f73f45c..292fb6dfe 100755 --- a/tests/Utils/StringUtilsTest.php +++ b/tests/Utils/StringUtilsTest.php @@ -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 4c3b1da36..9f83cc87f 100755 --- a/tests/Utils/TaskSchedule/CronJobTest.php +++ b/tests/Utils/TaskSchedule/CronJobTest.php @@ -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 44e6fb72b..1ab6663b3 100755 --- a/tests/Utils/TaskSchedule/CronTest.php +++ b/tests/Utils/TaskSchedule/CronTest.php @@ -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 fd94519ac..6d4a97f5e 100755 --- a/tests/Utils/TaskSchedule/IntervalTest.php +++ b/tests/Utils/TaskSchedule/IntervalTest.php @@ -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 89cc2745d..be3ae2bca 100755 --- a/tests/Utils/TaskSchedule/ScheduleTest.php +++ b/tests/Utils/TaskSchedule/ScheduleTest.php @@ -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,9 @@ 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 318cc6273..2a12a5708 100755 --- a/tests/Utils/TaskSchedule/SchedulerAbstractTest.php +++ b/tests/Utils/TaskSchedule/SchedulerAbstractTest.php @@ -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 6b9790499..21fa10be0 100755 --- a/tests/Utils/TaskSchedule/SchedulerFactoryTest.php +++ b/tests/Utils/TaskSchedule/SchedulerFactoryTest.php @@ -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 9be541c11..4f755c07c 100755 --- a/tests/Utils/TaskSchedule/TaskAbstractTest.php +++ b/tests/Utils/TaskSchedule/TaskAbstractTest.php @@ -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 662a79b3b..df745e8ae 100755 --- a/tests/Utils/TaskSchedule/TaskFactoryTest.php +++ b/tests/Utils/TaskSchedule/TaskFactoryTest.php @@ -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 4ad1d2077..157077141 100755 --- a/tests/Utils/TaskSchedule/TaskSchedulerTest.php +++ b/tests/Utils/TaskSchedule/TaskSchedulerTest.php @@ -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/TestUtilsTest.php b/tests/Utils/TestUtilsTest.php index 71a821c06..dd775546f 100755 --- a/tests/Utils/TestUtilsTest.php +++ b/tests/Utils/TestUtilsTest.php @@ -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/Validation/Base/DateTimeTest.php b/tests/Validation/Base/DateTimeTest.php index 3649eb099..b7b6c3121 100755 --- a/tests/Validation/Base/DateTimeTest.php +++ b/tests/Validation/Base/DateTimeTest.php @@ -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 1bc84bf61..c6016ec85 100755 --- a/tests/Validation/Base/JsonTest.php +++ b/tests/Validation/Base/JsonTest.php @@ -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 8ae64727a..45a996490 100755 --- a/tests/Validation/Finance/BICTest.php +++ b/tests/Validation/Finance/BICTest.php @@ -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 2ca9540c0..7b7df498b 100755 --- a/tests/Validation/Finance/CreditCardTest.php +++ b/tests/Validation/Finance/CreditCardTest.php @@ -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..35173eaba 100755 --- a/tests/Validation/Finance/IbanEnumTest.php +++ b/tests/Validation/Finance/IbanEnumTest.php @@ -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..a6ea619b3 100755 --- a/tests/Validation/Finance/IbanErrorTypeTest.php +++ b/tests/Validation/Finance/IbanErrorTypeTest.php @@ -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 cbaed1446..4951c5b6f 100755 --- a/tests/Validation/Finance/IbanTest.php +++ b/tests/Validation/Finance/IbanTest.php @@ -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 1d624db4f..7711aa69d 100755 --- a/tests/Validation/Network/EmailTest.php +++ b/tests/Validation/Network/EmailTest.php @@ -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 6395eb8cf..07583b66b 100755 --- a/tests/Validation/Network/HostnameTest.php +++ b/tests/Validation/Network/HostnameTest.php @@ -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 ef9ae2e03..15607e038 100755 --- a/tests/Validation/Network/IpTest.php +++ b/tests/Validation/Network/IpTest.php @@ -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 57a1d7f13..9d58c626a 100755 --- a/tests/Validation/ValidatorTest.php +++ b/tests/Validation/ValidatorTest.php @@ -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 8b5925cb9..338e7ac16 100755 --- a/tests/Version/VersionTest.php +++ b/tests/Version/VersionTest.php @@ -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 e079a921b..5857fb587 100755 --- a/tests/Views/PaginationViewTest.php +++ b/tests/Views/PaginationViewTest.php @@ -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 da191d292..143d07bd8 100755 --- a/tests/Views/ViewTest.php +++ b/tests/Views/ViewTest.php @@ -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/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 + +