Skip to content

Commit

Permalink
Add not equal operator for StringOperatorType
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Nov 10, 2020
1 parent bb4b462 commit ad87301
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Form/Type/Operator/StringOperatorType.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ final class StringOperatorType extends AbstractType
public const TYPE_EQUAL = 3;
public const TYPE_STARTS_WITH = 4;
public const TYPE_ENDS_WITH = 5;
public const TYPE_NOT_EQUAL = 6;

/**
* @return void
Expand All @@ -39,6 +40,7 @@ public function configureOptions(OptionsResolver $resolver)
'label_type_equals' => self::TYPE_EQUAL,
'label_type_starts_with' => self::TYPE_STARTS_WITH,
'label_type_ends_with' => self::TYPE_ENDS_WITH,
'label_type_not_equals' => self::TYPE_NOT_EQUAL,
],
]);
}
Expand Down
1 change: 1 addition & 0 deletions tests/Form/Type/Operator/StringOperatorTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function testConfigureOptions(): void
'label_type_equals' => StringOperatorType::TYPE_EQUAL,
'label_type_starts_with' => StringOperatorType::TYPE_STARTS_WITH,
'label_type_ends_with' => StringOperatorType::TYPE_ENDS_WITH,
'label_type_not_equals' => StringOperatorType::TYPE_NOT_EQUAL,
];
$formType->configureOptions($optionsResolver);
$options = $optionsResolver->resolve([]);
Expand Down

0 comments on commit ad87301

Please sign in to comment.