Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
18 changes: 9 additions & 9 deletions tests/ContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
Loading