LegacyPerson example

$this->assertSame('OK', $translator->trans('ok_label', [], 'legacy'));
        $this->assertSame('OK', $translator->trans('ok_label', [], 'modern'));
    }

    public function testBundleValidationConfigDir()
    {
        static::bootKernel(['test_case' => 'BundlePaths']);
        $validator = static::getContainer()->get('validator.alias');

        $this->assertTrue($validator->hasMetadataFor(LegacyPerson::class));
        $this->assertCount(1, $constraintViolationList = $validator->validate(new LegacyPerson('john', 5)));
        $this->assertSame('This value should be greater than 18.', $constraintViolationList->get(0)->getMessage());

        $this->assertTrue($validator->hasMetadataFor(ModernPerson::class));
        $this->assertCount(1, $constraintViolationList = $validator->validate(new ModernPerson('john', 5)));
        $this->assertSame('This value should be greater than 18.', $constraintViolationList->get(0)->getMessage());
    }

    public function testBundleSerializationConfigDir()
    {
        static::bootKernel(['test_case' => 'BundlePaths']);
        $serializer = static::getContainer()->get('serializer.alias');

        
Home | Imprint | This part of the site doesn't use cookies.