Set constant visibility in tests to private where possible.
This commit is contained in:
parent
d71c404a9f
commit
43ce6dfe44
@ -24,7 +24,7 @@ use Symfony\Component\Form\Test\FormPerformanceTestCase;
|
||||
*/
|
||||
class EntityTypePerformanceTest extends FormPerformanceTestCase
|
||||
{
|
||||
const ENTITY_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity';
|
||||
private const ENTITY_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity';
|
||||
|
||||
/**
|
||||
* @var \Doctrine\ORM\EntityManager
|
||||
|
@ -39,14 +39,14 @@ class EntityTypeTest extends BaseTypeTest
|
||||
{
|
||||
const TESTED_TYPE = 'Symfony\Bridge\Doctrine\Form\Type\EntityType';
|
||||
|
||||
const ITEM_GROUP_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\GroupableEntity';
|
||||
const SINGLE_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity';
|
||||
const SINGLE_IDENT_NO_TO_STRING_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdNoToStringEntity';
|
||||
const SINGLE_STRING_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringIdEntity';
|
||||
const SINGLE_ASSOC_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleAssociationToIntIdEntity';
|
||||
const SINGLE_STRING_CASTABLE_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringCastableIdEntity';
|
||||
const COMPOSITE_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIntIdEntity';
|
||||
const COMPOSITE_STRING_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeStringIdEntity';
|
||||
private const ITEM_GROUP_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\GroupableEntity';
|
||||
private const SINGLE_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity';
|
||||
private const SINGLE_IDENT_NO_TO_STRING_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdNoToStringEntity';
|
||||
private const SINGLE_STRING_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringIdEntity';
|
||||
private const SINGLE_ASSOC_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleAssociationToIntIdEntity';
|
||||
private const SINGLE_STRING_CASTABLE_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringCastableIdEntity';
|
||||
private const COMPOSITE_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIntIdEntity';
|
||||
private const COMPOSITE_STRING_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeStringIdEntity';
|
||||
|
||||
/**
|
||||
* @var EntityManager
|
||||
|
@ -23,7 +23,7 @@ class DoctrineFooType extends Type
|
||||
/**
|
||||
* Type name.
|
||||
*/
|
||||
const NAME = 'foo';
|
||||
private const NAME = 'foo';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@ -40,7 +40,7 @@ use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
|
||||
*/
|
||||
class UniqueEntityValidatorTest extends ConstraintValidatorTestCase
|
||||
{
|
||||
const EM_NAME = 'foo';
|
||||
private const EM_NAME = 'foo';
|
||||
|
||||
/**
|
||||
* @var ObjectManager
|
||||
|
@ -23,7 +23,7 @@ use Symfony\Component\Security\Http\Firewall\LogoutListener;
|
||||
|
||||
class FirewallMapTest extends TestCase
|
||||
{
|
||||
const ATTRIBUTE_FIREWALL_CONTEXT = '_firewall_context';
|
||||
private const ATTRIBUTE_FIREWALL_CONTEXT = '_firewall_context';
|
||||
|
||||
public function testGetListenersWithEmptyMap()
|
||||
{
|
||||
|
@ -20,10 +20,9 @@ use Symfony\Contracts\EventDispatcher\Event as ContractsEvent;
|
||||
class EventDispatcherTest extends TestCase
|
||||
{
|
||||
/* Some pseudo events */
|
||||
const preFoo = 'pre.foo';
|
||||
const postFoo = 'post.foo';
|
||||
const preBar = 'pre.bar';
|
||||
const postBar = 'post.bar';
|
||||
private const preFoo = 'pre.foo';
|
||||
private const postFoo = 'post.foo';
|
||||
private const preBar = 'pre.bar';
|
||||
|
||||
/**
|
||||
* @var EventDispatcher
|
||||
|
@ -16,7 +16,7 @@ use Symfony\Component\Form\Extension\Core\DataTransformer\BooleanToStringTransfo
|
||||
|
||||
class BooleanToStringTransformerTest extends TestCase
|
||||
{
|
||||
const TRUE_VALUE = '1';
|
||||
private const TRUE_VALUE = '1';
|
||||
|
||||
/**
|
||||
* @var BooleanToStringTransformer
|
||||
|
@ -32,10 +32,10 @@ use Symfony\Component\Validator\ConstraintViolationInterface;
|
||||
*/
|
||||
class ViolationMapperTest extends TestCase
|
||||
{
|
||||
const LEVEL_0 = 0;
|
||||
const LEVEL_1 = 1;
|
||||
const LEVEL_1B = 2;
|
||||
const LEVEL_2 = 3;
|
||||
private const LEVEL_0 = 0;
|
||||
private const LEVEL_1 = 1;
|
||||
private const LEVEL_1B = 2;
|
||||
private const LEVEL_2 = 3;
|
||||
|
||||
/**
|
||||
* @var EventDispatcherInterface
|
||||
|
@ -20,8 +20,8 @@ use Symfony\Component\HttpFoundation\Session\Storage\Handler\MemcachedSessionHan
|
||||
*/
|
||||
class MemcachedSessionHandlerTest extends TestCase
|
||||
{
|
||||
const PREFIX = 'prefix_';
|
||||
const TTL = 1000;
|
||||
private const PREFIX = 'prefix_';
|
||||
private const TTL = 1000;
|
||||
|
||||
/**
|
||||
* @var MemcachedSessionHandler
|
||||
|
@ -21,7 +21,7 @@ use Symfony\Component\Intl\Exception\ResourceBundleNotFoundException;
|
||||
*/
|
||||
class BundleEntryReaderTest extends TestCase
|
||||
{
|
||||
const RES_DIR = '/res/dir';
|
||||
private const RES_DIR = '/res/dir';
|
||||
|
||||
/**
|
||||
* @var BundleEntryReader
|
||||
|
@ -23,7 +23,7 @@ class GitRepositoryTest extends TestCase
|
||||
{
|
||||
private $targetDir;
|
||||
|
||||
const REPO_URL = 'https://github.com/symfony/intl.git';
|
||||
private const REPO_URL = 'https://github.com/symfony/intl.git';
|
||||
|
||||
/**
|
||||
* @before
|
||||
|
@ -25,7 +25,7 @@ use Symfony\Component\Ldap\Tests\LdapTestCase;
|
||||
*/
|
||||
class AdapterTest extends LdapTestCase
|
||||
{
|
||||
const PAGINATION_REQUIRED_CONFIG = [
|
||||
private const PAGINATION_REQUIRED_CONFIG = [
|
||||
'options' => [
|
||||
'protocol_version' => 3,
|
||||
],
|
||||
|
@ -20,7 +20,7 @@ use Symfony\Component\PropertyAccess\PropertyPathBuilder;
|
||||
*/
|
||||
class PropertyPathBuilderTest extends TestCase
|
||||
{
|
||||
const PREFIX = 'old1[old2].old3[old4][old5].old6';
|
||||
private const PREFIX = 'old1[old2].old3[old4][old5].old6';
|
||||
|
||||
/**
|
||||
* @var PropertyPathBuilder
|
||||
|
@ -21,7 +21,7 @@ use Symfony\Component\Security\Core\Encoder\Argon2iPasswordEncoder;
|
||||
*/
|
||||
class Argon2iPasswordEncoderTest extends TestCase
|
||||
{
|
||||
const PASSWORD = 'password';
|
||||
private const PASSWORD = 'password';
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
|
@ -21,8 +21,8 @@ use Symfony\Component\Security\Core\Encoder\BCryptPasswordEncoder;
|
||||
*/
|
||||
class BCryptPasswordEncoderTest extends TestCase
|
||||
{
|
||||
const PASSWORD = 'password';
|
||||
const VALID_COST = '04';
|
||||
private const PASSWORD = 'password';
|
||||
private const VALID_COST = '04';
|
||||
|
||||
public function testCostBelowRange()
|
||||
{
|
||||
|
@ -23,8 +23,8 @@ use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
|
||||
*/
|
||||
abstract class UserPasswordValidatorTest extends ConstraintValidatorTestCase
|
||||
{
|
||||
const PASSWORD = 's3Cr3t';
|
||||
const SALT = '^S4lt$';
|
||||
private const PASSWORD = 's3Cr3t';
|
||||
private const SALT = '^S4lt$';
|
||||
|
||||
/**
|
||||
* @var TokenStorageInterface
|
||||
|
@ -19,7 +19,7 @@ use Symfony\Component\Security\Csrf\TokenGenerator\UriSafeTokenGenerator;
|
||||
*/
|
||||
class UriSafeTokenGeneratorTest extends TestCase
|
||||
{
|
||||
const ENTROPY = 1000;
|
||||
private const ENTROPY = 1000;
|
||||
|
||||
/**
|
||||
* A non alpha-numeric byte string.
|
||||
|
@ -22,7 +22,7 @@ use Symfony\Component\Security\Csrf\TokenStorage\NativeSessionTokenStorage;
|
||||
*/
|
||||
class NativeSessionTokenStorageTest extends TestCase
|
||||
{
|
||||
const SESSION_NAMESPACE = 'foobar';
|
||||
private const SESSION_NAMESPACE = 'foobar';
|
||||
|
||||
/**
|
||||
* @var NativeSessionTokenStorage
|
||||
|
@ -21,7 +21,7 @@ use Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage;
|
||||
*/
|
||||
class SessionTokenStorageTest extends TestCase
|
||||
{
|
||||
const SESSION_NAMESPACE = 'foobar';
|
||||
private const SESSION_NAMESPACE = 'foobar';
|
||||
|
||||
/**
|
||||
* @var Session
|
||||
|
@ -29,9 +29,8 @@ class FormLoginAuthenticatorTest extends TestCase
|
||||
private $requestWithSession;
|
||||
private $authenticator;
|
||||
|
||||
const LOGIN_URL = 'http://login';
|
||||
const DEFAULT_SUCCESS_URL = 'http://defaultsuccess';
|
||||
const CUSTOM_SUCCESS_URL = 'http://customsuccess';
|
||||
private const LOGIN_URL = 'http://login';
|
||||
private const DEFAULT_SUCCESS_URL = 'http://defaultsuccess';
|
||||
|
||||
public function testAuthenticationFailureWithoutSession()
|
||||
{
|
||||
|
@ -16,9 +16,9 @@ use Symfony\Component\Serializer\Encoder\ChainDecoder;
|
||||
|
||||
class ChainDecoderTest extends TestCase
|
||||
{
|
||||
const FORMAT_1 = 'format1';
|
||||
const FORMAT_2 = 'format2';
|
||||
const FORMAT_3 = 'format3';
|
||||
private const FORMAT_1 = 'format1';
|
||||
private const FORMAT_2 = 'format2';
|
||||
private const FORMAT_3 = 'format3';
|
||||
|
||||
private $chainDecoder;
|
||||
private $decoder1;
|
||||
|
@ -18,9 +18,9 @@ use Symfony\Component\Serializer\Encoder\NormalizationAwareInterface;
|
||||
|
||||
class ChainEncoderTest extends TestCase
|
||||
{
|
||||
const FORMAT_1 = 'format1';
|
||||
const FORMAT_2 = 'format2';
|
||||
const FORMAT_3 = 'format3';
|
||||
private const FORMAT_1 = 'format1';
|
||||
private const FORMAT_2 = 'format2';
|
||||
private const FORMAT_3 = 'format3';
|
||||
|
||||
private $chainEncoder;
|
||||
private $encoder1;
|
||||
|
@ -20,9 +20,9 @@ use Symfony\Component\Serializer\Normalizer\DataUriNormalizer;
|
||||
*/
|
||||
class DataUriNormalizerTest extends TestCase
|
||||
{
|
||||
const TEST_GIF_DATA = 'data:image/gif;base64,R0lGODdhAQABAIAAAP///////ywAAAAAAQABAAACAkQBADs=';
|
||||
const TEST_TXT_DATA = 'data:text/plain,K%C3%A9vin%20Dunglas%0A';
|
||||
const TEST_TXT_CONTENT = "Kévin Dunglas\n";
|
||||
private const TEST_GIF_DATA = 'data:image/gif;base64,R0lGODdhAQABAIAAAP///////ywAAAAAAQABAAACAkQBADs=';
|
||||
private const TEST_TXT_DATA = 'data:text/plain,K%C3%A9vin%20Dunglas%0A';
|
||||
private const TEST_TXT_CONTENT = "Kévin Dunglas\n";
|
||||
|
||||
/**
|
||||
* @var DataUriNormalizer
|
||||
|
@ -23,7 +23,7 @@ use Symfony\Component\Stopwatch\StopwatchEvent;
|
||||
*/
|
||||
class StopwatchEventTest extends TestCase
|
||||
{
|
||||
const DELTA = 37;
|
||||
private const DELTA = 37;
|
||||
|
||||
public function testGetOrigin()
|
||||
{
|
||||
|
@ -23,7 +23,7 @@ use Symfony\Component\Stopwatch\Stopwatch;
|
||||
*/
|
||||
class StopwatchTest extends TestCase
|
||||
{
|
||||
const DELTA = 20;
|
||||
private const DELTA = 20;
|
||||
|
||||
public function testStart()
|
||||
{
|
||||
|
@ -24,10 +24,10 @@ use Symfony\Component\Validator\Tests\Fixtures\PropertyConstraint;
|
||||
|
||||
class ClassMetadataTest extends TestCase
|
||||
{
|
||||
const CLASSNAME = 'Symfony\Component\Validator\Tests\Fixtures\Entity';
|
||||
const PARENTCLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityParent';
|
||||
const PROVIDERCLASS = 'Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderEntity';
|
||||
const PROVIDERCHILDCLASS = 'Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderChildEntity';
|
||||
private const CLASSNAME = 'Symfony\Component\Validator\Tests\Fixtures\Entity';
|
||||
private const PARENTCLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityParent';
|
||||
private const PROVIDERCLASS = 'Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderEntity';
|
||||
private const PROVIDERCHILDCLASS = 'Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderChildEntity';
|
||||
|
||||
protected $metadata;
|
||||
|
||||
|
@ -26,11 +26,9 @@ use Symfony\Component\Validator\Tests\Fixtures\PropertyGetterInterface;
|
||||
|
||||
class LazyLoadingMetadataFactoryTest extends TestCase
|
||||
{
|
||||
const CLASS_NAME = 'Symfony\Component\Validator\Tests\Fixtures\Entity';
|
||||
const PARENT_CLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityParent';
|
||||
const INTERFACE_A_CLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityInterfaceA';
|
||||
const INTERFACE_B_CLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityInterfaceB';
|
||||
const PARENT_INTERFACE_CLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityParentInterface';
|
||||
private const CLASS_NAME = 'Symfony\Component\Validator\Tests\Fixtures\Entity';
|
||||
private const PARENT_CLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityParent';
|
||||
private const INTERFACE_A_CLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityInterfaceA';
|
||||
|
||||
public function testLoadClassMetadataWithInterface()
|
||||
{
|
||||
|
@ -17,7 +17,7 @@ use Symfony\Component\Validator\Tests\Fixtures\Entity;
|
||||
|
||||
class GetterMetadataTest extends TestCase
|
||||
{
|
||||
const CLASSNAME = 'Symfony\Component\Validator\Tests\Fixtures\Entity';
|
||||
private const CLASSNAME = 'Symfony\Component\Validator\Tests\Fixtures\Entity';
|
||||
|
||||
public function testInvalidPropertyName()
|
||||
{
|
||||
|
@ -19,10 +19,10 @@ use Symfony\Component\Validator\Tests\Fixtures\Entity_74_Proxy;
|
||||
|
||||
class PropertyMetadataTest extends TestCase
|
||||
{
|
||||
const CLASSNAME = 'Symfony\Component\Validator\Tests\Fixtures\Entity';
|
||||
const CLASSNAME_74 = 'Symfony\Component\Validator\Tests\Fixtures\Entity_74';
|
||||
const CLASSNAME_74_PROXY = 'Symfony\Component\Validator\Tests\Fixtures\Entity_74_Proxy';
|
||||
const PARENTCLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityParent';
|
||||
private const CLASSNAME = 'Symfony\Component\Validator\Tests\Fixtures\Entity';
|
||||
private const CLASSNAME_74 = 'Symfony\Component\Validator\Tests\Fixtures\Entity_74';
|
||||
private const CLASSNAME_74_PROXY = 'Symfony\Component\Validator\Tests\Fixtures\Entity_74_Proxy';
|
||||
private const PARENTCLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityParent';
|
||||
|
||||
public function testInvalidPropertyName()
|
||||
{
|
||||
|
Reference in New Issue
Block a user