Skip to content

Commit

Permalink
Remove usage of @dataProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Feb 26, 2025
1 parent 29a2678 commit 50cdb7b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 18 deletions.
4 changes: 0 additions & 4 deletions src/Test/IntegrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ protected function getUndefinedTokenParserCallbacks(): array
}

/**
* @dataProvider getTests
*
* @return void
*/
#[DataProvider('getTests')]
Expand All @@ -111,8 +109,6 @@ public function testIntegration($file, $message, $condition, $templates, $except
}

/**
* @dataProvider getLegacyTests
*
* @group legacy
*
* @return void
Expand Down
2 changes: 0 additions & 2 deletions src/Test/NodeTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ public function getTests()
abstract public static function provideTests(): iterable;

/**
* @dataProvider provideTests
*
* @return void
*/
#[DataProvider('provideTests')]
Expand Down
4 changes: 1 addition & 3 deletions tests/ErrorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,7 @@ public function testTwigExceptionUpdateFileAndLineTogether()
}
}

/**
* @dataProvider getErrorWithoutLineAndContextData
*/
#[DataProvider('getErrorWithoutLineAndContextData')]
public function testErrorWithoutLineAndContext(LoaderInterface $loader, bool $debug, bool $addDebugInfo, bool $exceptionWithLineAndContext, int $errorLine)
{
$twig = new Environment($loader, ['debug' => $debug, 'cache' => false]);
Expand Down
4 changes: 1 addition & 3 deletions tests/ExpressionParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,7 @@ public function operator(Compiler $compiler): Compiler
$this->expectNotToPerformAssertions();
}

/**
* @dataProvider getBindingPowerTests
*/
#[DataProvider('getBindingPowerTests')]
public function testBindingPower(string $expression, string $expectedExpression, mixed $expectedResult, array $context = [])
{
$env = new Environment(new ArrayLoader([
Expand Down
8 changes: 2 additions & 6 deletions tests/LexerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,7 @@ public static function getTemplateForInlineCommentsForComment()
#}'];
}

/**
* @dataProvider getTemplateForUnclosedBracketInExpression
*/
#[DataProvider('getTemplateForUnclosedBracketInExpression')]
public function testUnclosedBracketInExpression(string $template, string $bracket)
{
$lexer = new Lexer(new Environment(new ArrayLoader()));
Expand All @@ -584,9 +582,7 @@ public static function getTemplateForUnclosedBracketInExpression()
yield ['{{ (([1]) + 3 }}', '('];
}

/**
* @dataProvider getTemplateForUnexpectedBracketInExpression
*/
#[DataProvider('getTemplateForUnexpectedBracketInExpression')]
public function testUnexpectedBracketInExpression(string $template, string $bracket)
{
$lexer = new Lexer(new Environment(new ArrayLoader()));
Expand Down

0 comments on commit 50cdb7b

Please sign in to comment.