Repository: symfony/symfony
File: src/Symfony/Component/Form/Tests/Extension/Core/Type/CurrencyTypeTest.php (PHP)

Code before:
    }

    #[RequiresPhpExtension('intl')]
    public function testAnExpiredCurrencyIn2007()
    {
        $choices = $this->factory
            ->create(static::TESTED_TYPE, null, [
                'choice_translation_locale' => 'fr',
                'legal_tender' => true,
                // The SIT currency expired the 2007-01-14.
                'active_at' => new \DateTimeImmutable('2007-01-15', new \DateTimeZone('Etc/UTC')),
            ])
            ->createView()->vars['choices'];

        $this->assertNotContainsEquals(new ChoiceView('SIT', 'SIT', 'tolar slovène'), $choices);
    }

    #[RequiresPhpExtension('intl')]
    public function testRetrieveExpiredCurrenciesIn2007()
    {
        $choices = $this->factory
            ->create(static::TESTED_TYPE, null, [
                'choice_translation_locale' => 'fr',
                'legal_tender' => true,
                'active_at' => null,
                // The SIT currency expired the 2007-01-14.
                'not_active_at' => new \DateTimeImmutable('2007-01-15', new \DateTimeZone('Etc/UTC')),
            ])
            ->createView()->vars['choices'];

        $this->assertContainsEquals(new ChoiceView('SIT', 'SIT', 'tolar slovène'), $choices);
    }

    public function testAnExceptionShouldBeThrownWhenTheActiveAtAndNotActiveAtOptionsAreBothSet()
    {
        $this->expectException(InvalidOptionsException::class);

        $this->expectExceptionMessage('The "active_at" and "not_active_at" options cannot be used at the same time. Remove one of them.');

        $this->factory
            ->create(static::TESTED_TYPE, null, [
                'active_at' => new \DateTimeImmutable(),
                'not_active_at' => new \DateTimeImmutable(),
            ])
            ->createView();
    }
}


Review comment (suggestion):
```suggestion
                // The SIT currency expired on 2007-01-14.
```

Code after:

    #[RequiresPhpExtension('intl')]
    public function testAnExpiredCurrencyIn2007()
    {
        $choices = $this->factory
            ->create(static::TESTED_TYPE, null, [
                'choice_translation_locale' => 'fr',
                'legal_tender' => true,
                // The SIT currency expired on 2007-01-14.
                'active_at' => new \DateTimeImmutable('2007-01-15', new \DateTimeZone('Etc/UTC')),
            ])
            ->createView()->vars['choices'];

        $this->assertNotContainsEquals(new ChoiceView('SIT', 'SIT', 'tolar slovène'), $choices);
    }

    #[RequiresPhpExtension('intl')]
    public function testRetrieveExpiredCurrenciesIn2007()
    {
        $choices = $this->factory
            ->create(static::TESTED_TYPE, null, [
                'choice_translation_locale' => 'fr',
                'legal_tender' => true,
                'active_at' => null,
                // The SIT currency expired on 2007-01-14.
                'not_active_at' => new \DateTimeImmutable('2007-01-15', new \DateTimeZone('Etc/UTC')),
            ])
            ->createView()->vars['choices'];

        $this->assertContainsEquals(new ChoiceView('SIT', 'SIT', 'tolar slovène'), $choices);
    }

    public function testAnExceptionShouldBeThrownWhenTheActiveAtAndNotActiveAtOptionsAreBothSet()
    {
        $this->expectException(InvalidOptionsException::class);

        $this->expectExceptionMessage('The "active_at" and "not_active_at" options cannot be used together.');

        $this->factory
            ->create(static::TESTED_TYPE, null, [
                'active_at' => new \DateTimeImmutable(),
                'not_active_at' => new \DateTimeImmutable(),
            ])
            ->createView();
    }
}