mirror of
https://github.com/Respect/Validation.git
synced 2026-03-17 15:50:03 +01:00
Apply "Generic.NamingConventions.CamelCapsFunctionName"
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
parent
5bdffaa51b
commit
1cccfd00a0
13 changed files with 20 additions and 19 deletions
|
|
@ -23,6 +23,7 @@
|
|||
<property name="spacing" value="0" />
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="Generic.NamingConventions.CamelCapsFunctionName" />
|
||||
<rule ref="Generic.PHP.NoSilencedErrors" />
|
||||
<rule ref="Generic.Strings.UnnecessaryStringConcat">
|
||||
<properties>
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class NestedValidationExceptionTest extends TestCase
|
|||
/**
|
||||
* @test
|
||||
*/
|
||||
public function addingTheSameInstanceShouldAddJustASingleReference(): void
|
||||
public function addingTheSameInstanceShouldAddJustOneSingleReference(): void
|
||||
{
|
||||
$composite = new AttributeException('input', 'id', [], 'trim');
|
||||
$node = new IntValException('input', 'id', [], 'trim');
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ final class ValidationExceptionTest extends TestCase
|
|||
/**
|
||||
* @test
|
||||
*/
|
||||
public function itShouldRetrieveASingleParameter(): void
|
||||
public function itShouldRetrieveOneSingleParameter(): void
|
||||
{
|
||||
$name = 'any name';
|
||||
$value = 'any value';
|
||||
|
|
@ -85,7 +85,7 @@ final class ValidationExceptionTest extends TestCase
|
|||
/**
|
||||
* @test
|
||||
*/
|
||||
public function itShouldHaveADefaultTemplate(): void
|
||||
public function itShouldHaveTemplateByDefault(): void
|
||||
{
|
||||
$sut = new ValidationException('input', 'id', [], 'trim');
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ final class FactoryTest extends TestCase
|
|||
/**
|
||||
* @test
|
||||
*/
|
||||
public function shouldCreateARuleByNameBasedOnNamespace(): void
|
||||
public function shouldCreateRuleByNameBasedOnNamespace(): void
|
||||
{
|
||||
$factory = new Factory([self::TEST_RULES_NAMESPACE], [], 'trim');
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ final class FactoryTest extends TestCase
|
|||
/**
|
||||
* @test
|
||||
*/
|
||||
public function shouldDefineConstructorArgumentsWhenCreatingARule(): void
|
||||
public function shouldDefineConstructorArgumentsWhenCreatingRule(): void
|
||||
{
|
||||
$constructorArguments = [true, false, true, false];
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ final class AbstractCompositeTest extends TestCase
|
|||
/**
|
||||
* @test
|
||||
*/
|
||||
public function shouldNotUpdateInternalRuleAlreadyHasAName(): void
|
||||
public function shouldNotUpdateInternalRuleWhenItAlreadyHasName(): void
|
||||
{
|
||||
$rule = $this->createMock(Validatable::class);
|
||||
$rule
|
||||
|
|
@ -140,7 +140,7 @@ final class AbstractCompositeTest extends TestCase
|
|||
/**
|
||||
* @test
|
||||
*/
|
||||
public function shouldDefineNameForInternalRulesWhenItHasNotAName(): void
|
||||
public function shouldDefineNameForInternalRulesWhenItDoesNotHaveName(): void
|
||||
{
|
||||
$ruleName = 'something';
|
||||
|
||||
|
|
@ -166,7 +166,7 @@ final class AbstractCompositeTest extends TestCase
|
|||
/**
|
||||
* @test
|
||||
*/
|
||||
public function shouldNotDefineNameForInternalRulesWhenItHasAName(): void
|
||||
public function shouldNotDefineNameForInternalRulesWhenItAlreadyHasName(): void
|
||||
{
|
||||
$ruleName = 'something';
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ final class AbstractRelatedTest extends TestCase
|
|||
/**
|
||||
* @test
|
||||
*/
|
||||
public function shouldDefineRuleNameAsReferenceWhenRuleDoesNotHaveAName(): void
|
||||
public function shouldDefineRuleNameAsReferenceWhenRuleDoesNotHaveName(): void
|
||||
{
|
||||
$reference = 'something';
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ final class AbstractRelatedTest extends TestCase
|
|||
/**
|
||||
* @test
|
||||
*/
|
||||
public function shouldNotDefineRuleNameAsReferenceWhenRuleDoesHaveAName(): void
|
||||
public function shouldNotDefineRuleNameAsReferenceWhenRuleDoesHaveName(): void
|
||||
{
|
||||
$reference = 'something';
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ final class AlwaysInvalidTest extends TestCase
|
|||
*
|
||||
* @dataProvider providerForInvalidInput
|
||||
*/
|
||||
public function itShouldValidateInputWhenItIsAValidAlwaysInvalid($input): void
|
||||
public function itShouldAlwaysBeInvalid($input): void
|
||||
{
|
||||
$rule = new AlwaysInvalid();
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ final class AlwaysValidTest extends TestCase
|
|||
*
|
||||
* @dataProvider providerForValidInput
|
||||
*/
|
||||
public function itShouldValidateInputWhenItIsAValidAlwaysValid($input): void
|
||||
public function itAlwaysBeValid($input): void
|
||||
{
|
||||
$rule = new AlwaysValid();
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ final class CallbackTest extends RuleTestCase
|
|||
{
|
||||
return [
|
||||
[new Callback('is_a', 'stdClass'), new \stdClass()],
|
||||
[new Callback([$this, 'thisIsASampleCallbackUsedInsideThisTest']), 'test'],
|
||||
[new Callback([$this, 'sampleCallbackUsedInsideThisTest']), 'test'],
|
||||
[new Callback('is_string'), 'test'],
|
||||
[
|
||||
new Callback(function () {
|
||||
|
|
@ -46,7 +46,7 @@ final class CallbackTest extends RuleTestCase
|
|||
];
|
||||
}
|
||||
|
||||
public function thisIsASampleCallbackUsedInsideThisTest()
|
||||
public function sampleCallbackUsedInsideThisTest()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class HexRgbColorTest extends TestCase
|
|||
*
|
||||
* @test
|
||||
*/
|
||||
public function hexRgbColorValuesONLYShouldReturnTrue($validHexRgbColor): void
|
||||
public function hexRgbColorValuesOnlyShouldReturnTrue($validHexRgbColor): void
|
||||
{
|
||||
$validator = new HexRgbColor();
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ final class KeySetTest extends TestCase
|
|||
* @expectedException \Respect\Validation\Exceptions\ComponentException
|
||||
* @expectedExceptionMessage KeySet rule accepts only Key rules
|
||||
*/
|
||||
public function shouldNotAcceptAllOfWithANonKeyRule(): void
|
||||
public function shouldNotAcceptAllOfWithNonKeyRule(): void
|
||||
{
|
||||
$alwaysValid = new AlwaysValid();
|
||||
$allOf = new AllOf($alwaysValid);
|
||||
|
|
@ -84,7 +84,7 @@ final class KeySetTest extends TestCase
|
|||
* @expectedException \Respect\Validation\Exceptions\ComponentException
|
||||
* @expectedExceptionMessage KeySet rule accepts only Key rules
|
||||
*/
|
||||
public function shouldNotAcceptANonKeyRule(): void
|
||||
public function shouldNotAcceptNonKeyRule(): void
|
||||
{
|
||||
$alwaysValid = new AlwaysValid();
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ final class SfTest extends TestCase
|
|||
/**
|
||||
* @test
|
||||
*/
|
||||
public function itShouldHaveAValidatorByDefault(): void
|
||||
public function itShouldHaveTheValidatorByDefault(): void
|
||||
{
|
||||
$sut = new Sf(new IsNull());
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class SubdivisionCodeTest extends TestCase
|
|||
/**
|
||||
* @test
|
||||
*/
|
||||
public function shouldDefineASubdivisionCodeFormatOnConstructor(): void
|
||||
public function shouldDefineSubdivisionCodeFormatOnConstructor(): void
|
||||
{
|
||||
$countryCode = 'US';
|
||||
$countrySubdivision = new SubdivisionCode($countryCode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue