diff --git a/.github/workflows/build-website.yml b/.github/workflows/build-website.yml index de0b1e629..bb1855cc7 100644 --- a/.github/workflows/build-website.yml +++ b/.github/workflows/build-website.yml @@ -10,13 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - run: echo ::set-output name=NVMRC::$(cat .nvmrc) - id: nvm - uses: actions/setup-node@v3.5.1 - id: setup-node with: - node-version: "${{ steps.nvm.outputs.NVMRC }}" + node-version-file: ".nvmrc" cache: yarn cache-dependency-path: website/yarn.lock diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index b0e0f6681..4555ffe39 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -32,7 +32,7 @@ jobs: - name: ♻️ Get composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: ♻️ Cache composer dependencies uses: actions/cache@v3 diff --git a/README.md b/README.md index 4f27f0f6f..07aad0845 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ ## Demonstration / example -🚀 Render **ALL** of the [Twitter Bootstrap v5+](https://getbootstrap.com/) elements with TwbsHelper : [see it in action, on-line](https://neilime.github.io/twbs-helper-module/#/usage/?id=rendering). +🚀 Render **ALL** of the [Twitter Bootstrap v5+](https://getbootstrap.com/) elements with TwbsHelper : [see it in action, on-line](https://neilime.github.io/twbs-helper-module/docs/usage/intro/). ## Documentation diff --git a/composer.json b/composer.json index 10ace24dc..65527ba00 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^0.12", "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^9.5.25", + "phpunit/phpunit": "^9.5.26", "slam/phpstan-laminas-framework": "^0.12", "spatie/phpunit-snapshot-assertions": "^4.2", "squizlabs/php_codesniffer": "^3.7" diff --git a/tests/TestSuite/TwbsHelper/View/HtmlStyleAttributeSetTest.php b/tests/TestSuite/TwbsHelper/View/HtmlStyleAttributeSetTest.php new file mode 100644 index 000000000..2a1dab1a9 --- /dev/null +++ b/tests/TestSuite/TwbsHelper/View/HtmlStyleAttributeSetTest.php @@ -0,0 +1,54 @@ +get('ViewHelperManager'); + $this->phpRenderer = new \Laminas\View\Renderer\PhpRenderer(); + $this->phpRenderer->setHelperPluginManager($viewHelperPluginManager); + } + + public function testToString() + { + $htmlStyleAttributeSet = new \TwbsHelper\View\HtmlStyleAttributeSet([ + 'width' => '50%', + 'color' => 'red', + ]); + + $this->assertSame( + 'color: red; width: 50%;', + $htmlStyleAttributeSet->__toString() + ); + } + + public function testMerge() + { + $htmlStyleAttributeSet = new \TwbsHelper\View\HtmlStyleAttributeSet([ + 'width' => '50%', + 'color' => 'red', + ]); + + $htmlStyleAttributeSet->merge([ + 'width' => '50%', + 'color' => 'green', + 'height' => '100%', + ]); + + $this->assertSame( + [ + 'color' => 'green', + 'height' => '100%', + 'width' => '50%', + ], + $htmlStyleAttributeSet->getArrayCopy() + ); + } +}