From dc44b5e10f4c6d98d14a996019901b3605ae783a Mon Sep 17 00:00:00 2001 From: Sid Roberts Date: Wed, 30 Aug 2023 13:21:32 +0900 Subject: [PATCH] Added Logger component. --- docs/components/logger/interfaces.md | 24 +++++++++++++++++++++++ docs/testing/index.md | 1 + docs/testing/logger.md | 12 ++++++++++++ src/Codeception/Actions/LoggerActions.php | 8 ++++++++ src/Interfaces/Logger/LoggerInterface.php | 8 ++++++++ src/Logger/Logger.php | 13 ++++++++++++ tests/Codeception/LoggerActionsCest.php | 16 +++++++++++++++ tests/Support/CodeceptionTester.php | 2 ++ tests/Unit/Logger/LoggerCest.php | 16 +++++++++++++++ 9 files changed, 100 insertions(+) create mode 100644 docs/components/logger/interfaces.md create mode 100644 docs/testing/logger.md create mode 100644 src/Codeception/Actions/LoggerActions.php create mode 100644 src/Interfaces/Logger/LoggerInterface.php create mode 100644 src/Logger/Logger.php create mode 100644 tests/Codeception/LoggerActionsCest.php create mode 100644 tests/Unit/Logger/LoggerCest.php diff --git a/docs/components/logger/interfaces.md b/docs/components/logger/interfaces.md new file mode 100644 index 00000000..9f9febb4 --- /dev/null +++ b/docs/components/logger/interfaces.md @@ -0,0 +1,24 @@ +--- +layout: default +title: Interfaces +parent: Logger +grand_parent: Components +permalink: logger/interfaces +nav_order: 102 +--- + + + +# Interfaces + +(all in the `Centum\Interfaces\Logger` namespace) + + + +## [`Centum\Interfaces\Logger\LoggerInterface`](https://github.com/SidRoberts/centum/blob/development/src/Interfaces/Logger/LoggerInterface.php) + +```php +log( + string $message +): void +``` diff --git a/docs/testing/index.md b/docs/testing/index.md index 7c585b43..c2c4140d 100644 --- a/docs/testing/index.md +++ b/docs/testing/index.md @@ -51,6 +51,7 @@ To futher enhance testing, these traits are available: - [`Centum\Codeception\Actions\HtmlActions`](https://github.com/SidRoberts/centum/blob/development/src/Codeception/Actions/HtmlActions.php) - [`Centum\Codeception\Actions\HttpFormActions`](https://github.com/SidRoberts/centum/blob/development/src/Codeception/Actions/HttpFormActions.php) - [`Centum\Codeception\Actions\JsonActions`](https://github.com/SidRoberts/centum/blob/development/src/Codeception/Actions/JsonActions.php) +- [`Centum\Codeception\Actions\LoggerActions`](https://github.com/SidRoberts/centum/blob/development/src/Codeception/Actions/LoggerActions.php) - [`Centum\Codeception\Actions\QueueActions`](https://github.com/SidRoberts/centum/blob/development/src/Codeception/Actions/QueueActions.php) - [`Centum\Codeception\Actions\RouterActions`](https://github.com/SidRoberts/centum/blob/development/src/Codeception/Actions/RouterActions.php) - [`Centum\Codeception\Actions\RouterReplacementActions`](https://github.com/SidRoberts/centum/blob/development/src/Codeception/Actions/RouterReplacementActions.php) diff --git a/docs/testing/logger.md b/docs/testing/logger.md new file mode 100644 index 00000000..ec2d2645 --- /dev/null +++ b/docs/testing/logger.md @@ -0,0 +1,12 @@ +--- +layout: default +title: Logger Actions +parent: Testing +permalink: testing/logger +--- + + + +# Logger Actions + +[`Centum\Codeception\Actions\LoggerActions`](https://github.com/SidRoberts/centum/blob/development/src/Codeception/Actions/LoggerActions.php) diff --git a/src/Codeception/Actions/LoggerActions.php b/src/Codeception/Actions/LoggerActions.php new file mode 100644 index 00000000..7a588e40 --- /dev/null +++ b/src/Codeception/Actions/LoggerActions.php @@ -0,0 +1,8 @@ +markTestIncomplete(); + } +} diff --git a/tests/Support/CodeceptionTester.php b/tests/Support/CodeceptionTester.php index 6807c325..70a72f34 100644 --- a/tests/Support/CodeceptionTester.php +++ b/tests/Support/CodeceptionTester.php @@ -14,6 +14,7 @@ use Centum\Codeception\Actions\HtmlActions; use Centum\Codeception\Actions\HttpFormActions; use Centum\Codeception\Actions\JsonActions; +use Centum\Codeception\Actions\LoggerActions; use Centum\Codeception\Actions\QueueActions; use Centum\Codeception\Actions\RouterActions; use Centum\Codeception\Actions\RouterReplacementActions; @@ -41,6 +42,7 @@ class CodeceptionTester extends Actor use HtmlActions; use HttpFormActions; use JsonActions; + use LoggerActions; use QueueActions; use RouterReplacementActions; use RouterActions; diff --git a/tests/Unit/Logger/LoggerCest.php b/tests/Unit/Logger/LoggerCest.php new file mode 100644 index 00000000..66094f16 --- /dev/null +++ b/tests/Unit/Logger/LoggerCest.php @@ -0,0 +1,16 @@ +markTestIncomple(); + } +}