diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index db75df3..6df044f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,7 @@ jobs: strategy: matrix: operating-system: ['ubuntu-latest', 'windows-latest', 'macos-latest'] - php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3'] + php-versions: ['8.1', '8.2', '8.3', '8.4'] steps: - name: Checkout @@ -32,14 +32,15 @@ jobs: - name: Get composer cache directory id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + shell: bash - name: "Cache composer" - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }} + key: ${{ runner.os }}-${{ matrix.php-versions }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: | - ${{ runner.os }}-${{ matrix.php-version }}-composer- + ${{ runner.os }}-${{ matrix.php-versions }}-composer- - name: Setup problem matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" diff --git a/tests/ContextTest.php b/tests/ContextTest.php index 73d7397..c752e7a 100644 --- a/tests/ContextTest.php +++ b/tests/ContextTest.php @@ -18,23 +18,23 @@ public function testAddParams(string $name, $value): void $this->assertSame($value, $context->get($name)); } - public function testParamNotFoundMustThrowAnException(): void - { - $this->expectException(InvalidArgumentException::class); - - $context = new Context(['feature2' => 'nice']); - $context->get('feature1'); - } - public function valueProvider(): array { return [ ['string', 'a context value'], ['array', [1, 2, 3]], - ['associative array', ['name' => 'Chandler', 'roomate' => 'Joey', 'friend' => 'Ross']], + ['associative array', ['name' => 'Chandler', 'roommate' => 'Joey', 'friend' => 'Ross']], ['object', new stdClass()], ['bool', false], ['null', null], ]; } + + public function testParamNotFoundMustThrowAnException(): void + { + $this->expectException(InvalidArgumentException::class); + + $context = new Context(['feature2' => 'nice']); + $context->get('feature1'); + } }