. */ namespace App\Tests\Services\LabelSystem\PlaceholderProviders; use App\Entity\Parts\Part; use App\Services\LabelSystem\PlaceholderProviders\GlobalProviders; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class GlobalProvidersTest extends WebTestCase { /** * @var GlobalProviders */ protected $service; protected $target; protected function setUp(): void { self::bootKernel(); $this->service = self::$container->get(GlobalProviders::class); $this->target = new Part(); } public function dataProvider(): array { return [ ['Part-DB', '[[INSTALL_NAME]]'], ['anonymous', '[[USERNAME]]'], ]; } /** * @dataProvider dataProvider */ public function testReplace(string $expected, string $placeholder): void { $this->assertSame($expected, $this->service->replace($placeholder, $this->target)); } }