From 8399110763b194912191c6476b74a5ec78d5543d Mon Sep 17 00:00:00 2001 From: Edward Surov Date: Mon, 27 May 2024 15:20:32 +0300 Subject: [PATCH] fix extension initialization (fixes #123, via #126) --- .github/workflows/build.yml | 15 +++++---------- README.md | 2 +- src/AllureCodeception.php | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62af546..7326fda 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,7 @@ jobs: - "8.0" - "8.1" - "8.2" + - "8.3" os: - ubuntu-latest - windows-latest @@ -29,10 +30,7 @@ jobs: - "--prefer-lowest" steps: - name: Checkout - uses: actions/checkout@v3.5.0 - - - name: Validate composer.json and composer.lock - run: composer validate + uses: actions/checkout@v4 - name: Set up PHP ${{ matrix.php-version }} uses: shivammathur/setup-php@v2 @@ -42,6 +40,9 @@ jobs: coverage: xdebug ini-values: error_reporting=E_ALL + - name: Validate composer.json and composer.lock + run: composer validate + - name: Install dependencies run: composer update --prefer-dist @@ -49,10 +50,4 @@ jobs: ${{ matrix.composer-options }} - name: Run tests - if: ${{ matrix.php-version != '8.2' }} - run: composer test - - - name: Run tests (experimental) - if: ${{ matrix.php-version == '8.2' }} - continue-on-error: true run: composer test diff --git a/README.md b/README.md index 00aa2e2..9d5abdf 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ extensions: outputDirectory: allure-results linkTemplates: issue: https://example.org/issues/%s - setipHook: My\SetupHook + setupHook: My\SetupHook ``` `outputDirectory` is used to store Allure results and will be calculated diff --git a/src/AllureCodeception.php b/src/AllureCodeception.php index cbcabc9..ba9dbf4 100644 --- a/src/AllureCodeception.php +++ b/src/AllureCodeception.php @@ -68,7 +68,21 @@ final class AllureCodeception extends Extension * @throws ConfigurationException * phpcs:disable PSR2.Methods.MethodDeclaration.Underscore */ + public function _initialize(): void + { + parent::_initialize(); + $this->reconfigure(); + } + + /** + * @throws ConfigurationException + */ public function moduleInit(): void + { + $this->reconfigure(); + } + + private function reconfigure(): void { QametaAllure::reset(); $this->testLifecycle = null;