diff --git a/src/Context/FieldSelector.php b/src/Context/FieldSelector.php index acd946d..5a694e2 100644 --- a/src/Context/FieldSelector.php +++ b/src/Context/FieldSelector.php @@ -69,7 +69,7 @@ private function resolvePart(mixed $data, string $part): mixed // Try magic __get method as last resort try { $data = $data->__get($key); - } catch (Throwable $e) { + } catch (Throwable) { throw new InvalidArgumentException("Key '{$key}' does not exist or is not accessible via __get method."); } } else { @@ -141,7 +141,7 @@ private static function getObjectProperty(object $item, string $key): mixed if (method_exists($item, '__get')) { try { return $item->__get($key); - } catch (Throwable $e) { + } catch (Throwable) { return null; } } diff --git a/src/Context/ObjectContext.php b/src/Context/ObjectContext.php index 3b66e2b..feecc84 100644 --- a/src/Context/ObjectContext.php +++ b/src/Context/ObjectContext.php @@ -7,6 +7,9 @@ use JsonException; use Stringable; +/** + * @see ObjectContextTest + */ final class ObjectContext implements ContextInterface, Stringable { public function __construct( diff --git a/tests/Actions/CallableActionTest.php b/tests/Actions/CallableActionTest.php index b6f32de..f697a60 100644 --- a/tests/Actions/CallableActionTest.php +++ b/tests/Actions/CallableActionTest.php @@ -8,7 +8,6 @@ use Maniaba\RuleEngine\Actions\CallableAction; use Maniaba\RuleEngine\Context\ArrayContext; use Maniaba\RuleEngine\Context\ContextInterface; -use PHPUnit\Framework\Attributes\Group; use RuntimeException; use Tests\Support\TestCase; @@ -17,7 +16,6 @@ * * @internal */ -#[Group('Others')] final class CallableActionTest extends TestCase { public function testExecutesCallableWithContext(): void diff --git a/tests/Builders/ArrayBuilderTest.php b/tests/Builders/ArrayBuilderTest.php index 1f4316f..7ff35ea 100644 --- a/tests/Builders/ArrayBuilderTest.php +++ b/tests/Builders/ArrayBuilderTest.php @@ -13,7 +13,6 @@ use Maniaba\RuleEngine\Context\ContextInterface; use Maniaba\RuleEngine\Exceptions\BuilderException; use Maniaba\RuleEngine\Rules\RuleSet; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\Actions\DummyArgumentsAction; use Tests\Support\TestCase; @@ -22,7 +21,6 @@ * * @description Testing the ArrayBuilder class. Tests building a RuleSet based on configuration from the self::configBuilder() array. */ -#[Group('Others')] final class ArrayBuilderTest extends TestCase { use BuilderTestDemoConfigTrait; diff --git a/tests/Builders/JsonBuilderTest.php b/tests/Builders/JsonBuilderTest.php index afea5f5..52d8b4c 100644 --- a/tests/Builders/JsonBuilderTest.php +++ b/tests/Builders/JsonBuilderTest.php @@ -9,7 +9,6 @@ use Maniaba\RuleEngine\Builders\JsonBuilder; use Maniaba\RuleEngine\Context\ContextInterface; use Maniaba\RuleEngine\Rules\RuleSet; -use PHPUnit\Framework\Attributes\Group; use SplFileInfo; use Tests\Support\Actions\DummyArgumentsAction; use Tests\Support\TestCase; @@ -19,7 +18,6 @@ * * @internal */ -#[Group('Others')] final class JsonBuilderTest extends TestCase { use BuilderTestDemoConfigTrait; diff --git a/tests/Conditions/ArrayContainsAllConditionTest.php b/tests/Conditions/ArrayContainsAllConditionTest.php index cadd22b..e86a3d9 100644 --- a/tests/Conditions/ArrayContainsAllConditionTest.php +++ b/tests/Conditions/ArrayContainsAllConditionTest.php @@ -6,13 +6,11 @@ use Maniaba\RuleEngine\Conditions\ArrayContainsAllCondition; use Maniaba\RuleEngine\Context\ContextInterface; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** * @internal */ -#[Group('Others')] final class ArrayContainsAllConditionTest extends TestCase { use MockContextTrait; diff --git a/tests/Conditions/ArrayContainsAnyConditionTest.php b/tests/Conditions/ArrayContainsAnyConditionTest.php index 0892e67..c974700 100644 --- a/tests/Conditions/ArrayContainsAnyConditionTest.php +++ b/tests/Conditions/ArrayContainsAnyConditionTest.php @@ -5,13 +5,11 @@ namespace Tests\Conditions; use Maniaba\RuleEngine\Conditions\ArrayContainsAnyCondition; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** * @internal */ -#[Group('Others')] final class ArrayContainsAnyConditionTest extends TestCase { use MockContextTrait; diff --git a/tests/Conditions/ArrayContainsConditionTest.php b/tests/Conditions/ArrayContainsConditionTest.php index bbde0b1..f6e6ba0 100644 --- a/tests/Conditions/ArrayContainsConditionTest.php +++ b/tests/Conditions/ArrayContainsConditionTest.php @@ -5,13 +5,11 @@ namespace Tests\Conditions; use Maniaba\RuleEngine\Conditions\ArrayContainsCondition; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** * @internal */ -#[Group('Others')] final class ArrayContainsConditionTest extends TestCase { use MockContextTrait; diff --git a/tests/Conditions/ArrayContextTest.php b/tests/Conditions/ArrayContextTest.php deleted file mode 100644 index a388af1..0000000 --- a/tests/Conditions/ArrayContextTest.php +++ /dev/null @@ -1,62 +0,0 @@ - $value]); - - $this->assertSame($expected, $context->getField($field), 'Field value mismatch.'); - - $this->assertTrue($context->hasField($field), 'Field not found.'); - } - - public static function provideGetField(): iterable - { - $std = new stdClass(); - $std->foo = 'bar'; - - yield 'foo -> bar' => ['foo', 'bar', 'bar']; - - yield 'null value' => ['baz', null, null]; - - yield 'null value 2' => ['foo', null, null]; - - yield 'bool value' => ['foo', false, false]; - - yield 'int value' => ['foo', 0, 0]; - - yield 'empty string value' => ['foo', '', '']; - - yield 'empty array value' => ['foo', [], []]; - - yield 'stdClass value' => ['foo', $std, $std]; - - yield 'array value' => ['foo', ['bar'], ['bar']]; - - yield 'array multidimensional value' => ['foo', ['bar' => 'baz'], ['bar' => 'baz']]; - } - - public function testHasField(): void - { - $context = new ArrayContext(['foo' => 'bar']); - - $this->assertTrue($context->hasField('foo')); - $this->assertFalse($context->hasField('baz')); - } -} diff --git a/tests/Conditions/CollectionConditionTest.php b/tests/Conditions/CollectionConditionTest.php index 782083e..8fb454c 100644 --- a/tests/Conditions/CollectionConditionTest.php +++ b/tests/Conditions/CollectionConditionTest.php @@ -8,14 +8,12 @@ use Maniaba\RuleEngine\Conditions\CollectionCondition; use Maniaba\RuleEngine\Conditions\ConditionInterface; use Maniaba\RuleEngine\Enums\CollectionConditionType; -use PHPUnit\Framework\Attributes\Group; use stdClass; use Tests\Support\TestCase; /** * @internal */ -#[Group('Others')] final class CollectionConditionTest extends TestCase { use MockContextTrait; diff --git a/tests/Conditions/EndsWithConditionTest.php b/tests/Conditions/EndsWithConditionTest.php index 2faf203..8ba60ce 100644 --- a/tests/Conditions/EndsWithConditionTest.php +++ b/tests/Conditions/EndsWithConditionTest.php @@ -5,13 +5,11 @@ namespace Tests\Conditions; use Maniaba\RuleEngine\Conditions\EndsWithCondition; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** * @internal */ -#[Group('Others')] final class EndsWithConditionTest extends TestCase { use MockContextTrait; diff --git a/tests/Conditions/EqualsConditionTest.php b/tests/Conditions/EqualsConditionTest.php index b7ae5fc..7c7e710 100644 --- a/tests/Conditions/EqualsConditionTest.php +++ b/tests/Conditions/EqualsConditionTest.php @@ -5,13 +5,11 @@ namespace Tests\Conditions; use Maniaba\RuleEngine\Conditions\EqualsCondition; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** * @internal */ -#[Group('Others')] final class EqualsConditionTest extends TestCase { use MockContextTrait; diff --git a/tests/Conditions/GreaterThanConditionTest.php b/tests/Conditions/GreaterThanConditionTest.php index de73cb9..4e63d03 100644 --- a/tests/Conditions/GreaterThanConditionTest.php +++ b/tests/Conditions/GreaterThanConditionTest.php @@ -6,13 +6,11 @@ use Maniaba\RuleEngine\Conditions\GreaterThanCondition; use Maniaba\RuleEngine\Context\ContextInterface; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** * @internal */ -#[Group('Others')] final class GreaterThanConditionTest extends TestCase { public function testEvaluateConditionPassesWhenValueIsGreater(): void diff --git a/tests/Conditions/GreaterThanOrEqualConditionTest.php b/tests/Conditions/GreaterThanOrEqualConditionTest.php index a7ea170..a4eef14 100644 --- a/tests/Conditions/GreaterThanOrEqualConditionTest.php +++ b/tests/Conditions/GreaterThanOrEqualConditionTest.php @@ -6,13 +6,11 @@ use Maniaba\RuleEngine\Conditions\GreaterThanOrEqualCondition; use Maniaba\RuleEngine\Context\ContextInterface; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** * @internal */ -#[Group('Others')] final class GreaterThanOrEqualConditionTest extends TestCase { public function testEvaluateConditionPassesWhenValueIsGreater(): void diff --git a/tests/Conditions/IfElseConditionTest.php b/tests/Conditions/IfElseConditionTest.php index 3316612..cd5cb65 100644 --- a/tests/Conditions/IfElseConditionTest.php +++ b/tests/Conditions/IfElseConditionTest.php @@ -11,14 +11,12 @@ use Maniaba\RuleEngine\Conditions\IfElseCondition; use Maniaba\RuleEngine\Context\ContextInterface; use Maniaba\RuleEngine\Enums\CollectionConditionType; -use PHPUnit\Framework\Attributes\Group; use stdClass; use Tests\Support\TestCase; /** * @internal */ -#[Group('Others')] final class IfElseConditionTest extends TestCase { public function testIfConditionSatisfiedExecutesThenAction(): void diff --git a/tests/Conditions/LessThanConditionTest.php b/tests/Conditions/LessThanConditionTest.php index 80ee098..7b916f3 100644 --- a/tests/Conditions/LessThanConditionTest.php +++ b/tests/Conditions/LessThanConditionTest.php @@ -5,13 +5,11 @@ namespace Tests\Conditions; use Maniaba\RuleEngine\Conditions\LessThanCondition; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** * @internal */ -#[Group('Others')] final class LessThanConditionTest extends TestCase { use MockContextTrait; diff --git a/tests/Conditions/LessThanOrEqualConditionTest.php b/tests/Conditions/LessThanOrEqualConditionTest.php index 54721f2..1ee7854 100644 --- a/tests/Conditions/LessThanOrEqualConditionTest.php +++ b/tests/Conditions/LessThanOrEqualConditionTest.php @@ -5,13 +5,11 @@ namespace Tests\Conditions; use Maniaba\RuleEngine\Conditions\LessThanOrEqualCondition; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** * @internal */ -#[Group('Others')] final class LessThanOrEqualConditionTest extends TestCase { use MockContextTrait; diff --git a/tests/Conditions/NotConditionTest.php b/tests/Conditions/NotConditionTest.php index b69fc46..ec4feb2 100644 --- a/tests/Conditions/NotConditionTest.php +++ b/tests/Conditions/NotConditionTest.php @@ -11,13 +11,11 @@ use Maniaba\RuleEngine\Context\ArrayContext; use Maniaba\RuleEngine\Context\ContextInterface; use Maniaba\RuleEngine\Enums\CollectionConditionType; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** * @internal */ -#[Group('Others')] final class NotConditionTest extends TestCase { use MockContextTrait; diff --git a/tests/Conditions/NumericInRangeConditionTest.php b/tests/Conditions/NumericInRangeConditionTest.php index c2e12ac..408dc4c 100644 --- a/tests/Conditions/NumericInRangeConditionTest.php +++ b/tests/Conditions/NumericInRangeConditionTest.php @@ -6,13 +6,11 @@ use InvalidArgumentException; use Maniaba\RuleEngine\Conditions\NumericInRangeCondition; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** * @internal */ -#[Group('Others')] final class NumericInRangeConditionTest extends TestCase { use MockContextTrait; diff --git a/tests/Conditions/StartsWithConditionTest.php b/tests/Conditions/StartsWithConditionTest.php index 95e2858..5295fe2 100644 --- a/tests/Conditions/StartsWithConditionTest.php +++ b/tests/Conditions/StartsWithConditionTest.php @@ -5,13 +5,11 @@ namespace Tests\Conditions; use Maniaba\RuleEngine\Conditions\StartsWithCondition; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** * @internal */ -#[Group('Others')] final class StartsWithConditionTest extends TestCase { use MockContextTrait; diff --git a/tests/Conditions/StringContainConditionTest.php b/tests/Conditions/StringContainConditionTest.php index 545b862..411866e 100644 --- a/tests/Conditions/StringContainConditionTest.php +++ b/tests/Conditions/StringContainConditionTest.php @@ -5,13 +5,11 @@ namespace Tests\Conditions; use Maniaba\RuleEngine\Conditions\StringContainCondition; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** * @internal */ -#[Group('Others')] final class StringContainConditionTest extends TestCase { use MockContextTrait; diff --git a/tests/Context/ArrayContextTest.php b/tests/Context/ArrayContextTest.php new file mode 100644 index 0000000..be2df3f --- /dev/null +++ b/tests/Context/ArrayContextTest.php @@ -0,0 +1,129 @@ + $value]); + + $this->assertSame($expected, $context->getField($field), 'Field value mismatch.'); + + $this->assertTrue($context->hasField($field), 'Field not found.'); + } + + public static function provideGetField(): iterable + { + $std = new stdClass(); + $std->foo = 'bar'; + + yield 'foo -> bar' => ['foo', 'bar', 'bar']; + + yield 'null value' => ['baz', null, null]; + + yield 'null value 2' => ['foo', null, null]; + + yield 'bool value' => ['foo', false, false]; + + yield 'int value' => ['foo', 0, 0]; + + yield 'empty string value' => ['foo', '', '']; + + yield 'empty array value' => ['foo', [], []]; + + yield 'stdClass value' => ['foo', $std, $std]; + + yield 'array value' => ['foo', ['bar'], ['bar']]; + + yield 'array multidimensional value' => ['foo', ['bar' => 'baz'], ['bar' => 'baz']]; + } + + public function testHasField(): void + { + $context = new ArrayContext(['foo' => 'bar']); + + $this->assertTrue($context->hasField('foo')); + $this->assertFalse($context->hasField('baz')); + } + + public function testToString(): void + { + $data = ['foo' => 'bar', 'baz' => 1]; + $context = new ArrayContext($data); + $this->assertJsonStringEqualsJsonString(json_encode($data, JSON_THROW_ON_ERROR), (string) $context); + } + + public function testGetDataAndToArray(): void + { + $data = ['a' => 1, 'b' => 2]; + $context = new ArrayContext($data); + $this->assertSame($data, $context->getData()); + $this->assertSame($data, $context->toArray()); + } + + public function testSetField(): void + { + $context = new ArrayContext([]); + $context->setField('foo', 'bar'); + $this->assertSame('bar', $context->getField('foo')); + } + + public function testRemoveField(): void + { + $context = new ArrayContext(['foo' => 'bar', 'baz' => 1]); + $context->removeField('foo'); + $this->assertFalse($context->hasField('foo')); + $this->assertTrue($context->hasField('baz')); + } + + public function testClear(): void + { + $context = new ArrayContext(['foo' => 'bar']); + $context->clear(); + $this->assertTrue($context->isEmpty()); + $this->assertSame([], $context->getData()); + } + + public function testMerge(): void + { + $context = new ArrayContext(['a' => 1]); + $context->merge(['b' => 2, 'a' => 3]); + $this->assertSame(['a' => 3, 'b' => 2], $context->getData()); + } + + public function testGetKeysAndValues(): void + { + $context = new ArrayContext(['x' => 10, 'y' => 20]); + $this->assertSame(['x', 'y'], $context->getKeys()); + $this->assertSame([10, 20], $context->getValues()); + } + + public function testCountAndIsEmpty(): void + { + $context = new ArrayContext([]); + $this->assertSame(0, $context->count()); + $this->assertTrue($context->isEmpty()); + $context->setField('foo', 'bar'); + $this->assertSame(1, $context->count()); + $this->assertFalse($context->isEmpty()); + } + + public function testFilter(): void + { + $context = new ArrayContext(['a' => 1, 'b' => 2, 'c' => 3]); + $filtered = $context->filter(static fn ($v) => $v % 2 === 1); + $this->assertSame(['a' => 1, 'c' => 3], $filtered); + } +} diff --git a/tests/Context/FieldSelectorTest.php b/tests/Context/FieldSelectorTest.php index c6e3bc6..102d305 100644 --- a/tests/Context/FieldSelectorTest.php +++ b/tests/Context/FieldSelectorTest.php @@ -8,7 +8,6 @@ use InvalidArgumentException; use Maniaba\RuleEngine\Context\FieldSelector; use PHPUnit\Framework\Attributes\DataProvider; -use PHPUnit\Framework\Attributes\Group; use stdClass; use Tests\Support\Enums\EnumIntTest; use Tests\Support\Enums\SimpleEnum; @@ -17,7 +16,6 @@ /** * @internal */ -#[Group('Others')] final class FieldSelectorTest extends TestCase { /** diff --git a/tests/Context/ObjectContextTest.php b/tests/Context/ObjectContextTest.php new file mode 100644 index 0000000..611fd6e --- /dev/null +++ b/tests/Context/ObjectContextTest.php @@ -0,0 +1,70 @@ + 'bar']; + $context = new ObjectContext($obj); + $this->assertSame('bar', $context->getField('foo')); + } + + public function testGetFieldReturnsNullIfNotExists(): void + { + $obj = (object) []; + $context = new ObjectContext($obj); + $this->assertNull($context->getField('missing')); + } + + public function testHasFieldReturnsTrueIfExists(): void + { + $obj = (object) ['foo' => 123]; + $context = new ObjectContext($obj); + $this->assertTrue($context->hasField('foo')); + } + + public function testHasFieldReturnsFalseIfNotExists(): void + { + $obj = (object) []; + $context = new ObjectContext($obj); + $this->assertFalse($context->hasField('foo')); + } + + public function testGetObjectReturnsOriginalObject(): void + { + $obj = (object) ['a' => 1]; + $context = new ObjectContext($obj); + $this->assertSame($obj, $context->getObject()); + } + + public function testToStringReturnsJson(): void + { + $obj = (object) ['x' => 1, 'y' => 2]; + $context = new ObjectContext($obj); + $json = (string) $context; + $this->assertJson($json); + $this->assertSame(json_encode($obj, JSON_THROW_ON_ERROR), $json); + } + + public function testToStringThrowsOnJsonError(): void + { + $obj = (object) ['invalid' => INF]; + $context = new ObjectContext($obj); + $this->expectException(JsonException::class); + $cast = (string) $context; + + /** @phpstan-ignore-next-line */ + $this->assertNotFalse($cast, 'Expected to throw JsonException on invalid JSON conversion'); + } +} diff --git a/tests/Evaluators/AbstractEvaluatorTest.php b/tests/Evaluators/AbstractEvaluatorTest.php new file mode 100644 index 0000000..2d6402d --- /dev/null +++ b/tests/Evaluators/AbstractEvaluatorTest.php @@ -0,0 +1,65 @@ +failedRules = $failedRules; + } + + public function evaluate(RuleSet $ruleSet, ContextInterface $context): array + { + return []; + } + + public function execute(RuleSet $ruleSet, ContextInterface $context): void + { + } + }; + } + + /** + * @throws Exception + */ + public function testGetFailedRulesReturnsFailedRules(): void + { + $mockRule1 = $this->createMock(RuleInterface::class); + $mockRule2 = $this->createMock(RuleInterface::class); + $failed = [$mockRule1, $mockRule2]; + $evaluator = $this->getMockEvaluator($failed); + $this->assertSame($failed, $evaluator->getFailedRules()); + } + + /** + * @throws Exception + */ + public function testHasErrorsReturnsTrueIfFailedRulesNotEmpty(): void + { + $mockRule = $this->createMock(RuleInterface::class); + $evaluator = $this->getMockEvaluator([$mockRule]); + $this->assertTrue($evaluator->hasErrors()); + } + + public function testHasErrorsReturnsFalseIfFailedRulesEmpty(): void + { + $evaluator = $this->getMockEvaluator([]); + $this->assertFalse($evaluator->hasErrors()); + } +} diff --git a/tests/Evaluators/BasicEvaluatorTest.php b/tests/Evaluators/BasicEvaluatorTest.php index 419e057..df4d330 100644 --- a/tests/Evaluators/BasicEvaluatorTest.php +++ b/tests/Evaluators/BasicEvaluatorTest.php @@ -8,7 +8,6 @@ use Maniaba\RuleEngine\Evaluators\BasicEvaluator; use Maniaba\RuleEngine\Rules\RuleInterface; use Maniaba\RuleEngine\Rules\RuleSet; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** @@ -16,7 +15,6 @@ * * @internal */ -#[Group('Others')] final class BasicEvaluatorTest extends TestCase { public function testEvaluateEmptyRuleSet(): void diff --git a/tests/Evaluators/LazyEvaluatorTest.php b/tests/Evaluators/LazyEvaluatorTest.php index 8191de2..c82a23b 100644 --- a/tests/Evaluators/LazyEvaluatorTest.php +++ b/tests/Evaluators/LazyEvaluatorTest.php @@ -8,7 +8,6 @@ use Maniaba\RuleEngine\Evaluators\LazyEvaluator; use Maniaba\RuleEngine\Rules\RuleInterface; use Maniaba\RuleEngine\Rules\RuleSet; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** @@ -16,7 +15,6 @@ * * @internal */ -#[Group('Others')] final class LazyEvaluatorTest extends TestCase { public function testEvaluateEmptyRuleSet(): void diff --git a/tests/Evaluators/PriorityEvaluatorTest.php b/tests/Evaluators/PriorityEvaluatorTest.php index 4256192..4388b63 100644 --- a/tests/Evaluators/PriorityEvaluatorTest.php +++ b/tests/Evaluators/PriorityEvaluatorTest.php @@ -8,7 +8,6 @@ use Maniaba\RuleEngine\Evaluators\PriorityEvaluator; use Maniaba\RuleEngine\Rules\RuleInterface; use Maniaba\RuleEngine\Rules\RuleSet; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** @@ -16,7 +15,6 @@ * * @internal */ -#[Group('Others')] final class PriorityEvaluatorTest extends TestCase { public function testEvaluateSortsRulesByPriority(): void diff --git a/tests/Factories/ActionFactoryTest.php b/tests/Factories/ActionFactoryTest.php index a1d6f82..b111288 100644 --- a/tests/Factories/ActionFactoryTest.php +++ b/tests/Factories/ActionFactoryTest.php @@ -8,7 +8,6 @@ use Maniaba\RuleEngine\Actions\CallableAction; use Maniaba\RuleEngine\Context\ContextInterface; use Maniaba\RuleEngine\Factories\ActionFactory; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\Factories\TestAction; use Tests\Support\Factories\TestActionWithConstructorException; use Tests\Support\TestCase; @@ -16,7 +15,6 @@ /** * @internal */ -#[Group('Others')] final class ActionFactoryTest extends TestCase { private ActionFactory $actionFactory; diff --git a/tests/Factories/ConditionFactoryTest.php b/tests/Factories/ConditionFactoryTest.php index 7ff2330..d56275e 100644 --- a/tests/Factories/ConditionFactoryTest.php +++ b/tests/Factories/ConditionFactoryTest.php @@ -19,13 +19,11 @@ use Maniaba\RuleEngine\Conditions\StringContainCondition; use Maniaba\RuleEngine\Context\ContextInterface; use Maniaba\RuleEngine\Factories\ConditionFactory; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** * @internal */ -#[Group('Others')] final class ConditionFactoryTest extends TestCase { public function testCreateEqualsCondition(): void diff --git a/tests/Rules/RuleSetTest.php b/tests/Rules/RuleSetTest.php index 1617054..48f348b 100644 --- a/tests/Rules/RuleSetTest.php +++ b/tests/Rules/RuleSetTest.php @@ -7,13 +7,11 @@ use Maniaba\RuleEngine\Context\ContextInterface; use Maniaba\RuleEngine\Rules\RuleInterface; use Maniaba\RuleEngine\Rules\RuleSet; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** * @internal */ -#[Group('Others')] final class RuleSetTest extends TestCase { public function testAddAndGetRules(): void diff --git a/tests/Rules/RuleTest.php b/tests/Rules/RuleTest.php index 78b4b12..79b7625 100644 --- a/tests/Rules/RuleTest.php +++ b/tests/Rules/RuleTest.php @@ -8,7 +8,6 @@ use Maniaba\RuleEngine\Conditions\ConditionInterface; use Maniaba\RuleEngine\Context\ContextInterface; use Maniaba\RuleEngine\Rules\Rule; -use PHPUnit\Framework\Attributes\Group; use Tests\Support\TestCase; /** @@ -16,7 +15,6 @@ * * @internal */ -#[Group('Others')] final class RuleTest extends TestCase { public function testEvaluateReturnsTrueWhenConditionIsSatisfied(): void