. */ namespace App\Tests\Services\LabelSystem\PlaceholderProviders; use App\Entity\Base\AbstractDBElement; use App\Entity\Parts\Part; use App\Services\LabelSystem\PlaceholderProviders\AbstractDBElementProvider; use App\Services\LabelSystem\PlaceholderProviders\GlobalProviders; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class AbstractElementProviderTest extends WebTestCase { /** @var AbstractDBElementProvider */ protected $service; protected $target; public function setUp(): void { self::bootKernel(); $this->service = self::$container->get(AbstractDBElementProvider::class); $this->target = new class extends AbstractDBElement { protected $id = 123; /** * @inheritDoc */ public function getIDString(): string { return 'ignore'; } }; } public function dataProvider(): array { return [ ['123', '[[ID]]'], ]; } /** * @dataProvider dataProvider */ public function testReplace(string $expected, string $placeholder): void { $this->assertSame($expected, $this->service->replace($placeholder, $this->target)); } }