Skip to content

Commit

Permalink
DOC Update PHPUnit code sample
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Sep 11, 2024
1 parent 322df84 commit 7fd42fb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions en/02_Developer_Guides/04_Configuration/00_Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,14 +403,15 @@ use App\Service\MyService;
use SilverStripe\Config\Collections\MutableConfigCollectionInterface;
use SilverStripe\Core\Config\Config;
use SilverStripe\Dev\SapphireTest;
use PHPUnit\Framework\Attributes\DataProvider;
class MyServiceTest extends SapphireTest
{
/**
* @dataProvider testValuesProvider
* @param string $value
* @param string $expected
*/
#[DataProvider('provideConfigValues')]
public function testConfigValues($value, $expected)
{
$result = Config::withConfig(function (MutableConfigCollectionInterface $config) use ($value) {
Expand All @@ -427,7 +428,7 @@ class MyServiceTest extends SapphireTest
$this->assertEquals($expected, $result);
}
public function testValuesProvider(): array
public function provideConfigValues(): array
{
return [
['test value 1', 'expected value 1'],
Expand Down

0 comments on commit 7fd42fb

Please sign in to comment.