diff --git a/lib/Helper/Filter/RecipeStubFilter.php b/lib/Helper/Filter/RecipeStubFilter.php index c137d29e..35700f3d 100644 --- a/lib/Helper/Filter/RecipeStubFilter.php +++ b/lib/Helper/Filter/RecipeStubFilter.php @@ -2,25 +2,10 @@ namespace OCA\Cookbook\Helper\Filter; -use OCA\Cookbook\Helper\Filter\JSON\CleanCategoryFilter; -use OCA\Cookbook\Helper\Filter\JSON\ExtractImageUrlFilter; -use OCA\Cookbook\Helper\Filter\JSON\FixDescriptionFilter; -use OCA\Cookbook\Helper\Filter\JSON\FixDurationsFilter; -use OCA\Cookbook\Helper\Filter\JSON\FixImageSchemeFilter; -use OCA\Cookbook\Helper\Filter\JSON\FixIngredientsFilter; -use OCA\Cookbook\Helper\Filter\JSON\FixInstructionsFilter; -use OCA\Cookbook\Helper\Filter\JSON\FixKeywordsFilter; -use OCA\Cookbook\Helper\Filter\JSON\FixNutritionFilter; -use OCA\Cookbook\Helper\Filter\JSON\FixRecipeYieldFilter; -use OCA\Cookbook\Helper\Filter\JSON\FixToolsFilter; -use OCA\Cookbook\Helper\Filter\JSON\FixUrlFilter; use OCA\Cookbook\Helper\Filter\JSON\RecipeIdCopyFilter; use OCA\Cookbook\Helper\Filter\JSON\RecipeIdTypeFilter; -use OCA\Cookbook\Helper\Filter\JSON\RecipeNameFilter; -use OCA\Cookbook\Helper\Filter\JSON\SchemaConformityFilter; -class RecipeStubFilter -{ +class RecipeStubFilter { /** @var AbstractJSONFilter[] */ private $filters; @@ -34,8 +19,7 @@ class RecipeStubFilter ]; } - public function apply(array $json): array - { + public function apply(array $json): array { foreach ($this->filters as $filter) { $filter->apply($json); } diff --git a/tests/Integration/Helper/Filter/JSON/RecipeFixIdsTest.php b/tests/Integration/Helper/Filter/JSON/RecipeFixIdsTest.php index 8f4443e4..5b4f747e 100644 --- a/tests/Integration/Helper/Filter/JSON/RecipeFixIdsTest.php +++ b/tests/Integration/Helper/Filter/JSON/RecipeFixIdsTest.php @@ -7,12 +7,10 @@ use OCA\Cookbook\Helper\Filter\RecipeStubFilter; use PHPUnit\Framework\TestCase; class RecipeFixIdsTest extends TestCase { - /** @var RecipeStubFilter */ private $dut; - protected function setUp(): void - { + protected function setUp(): void { parent::setUp(); $app = new Application(); @@ -20,7 +18,7 @@ class RecipeFixIdsTest extends TestCase { $this->dut = $container->get(RecipeStubFilter::class); } - public function dp(){ + public function dp() { $stub = [ 'name' => 'The name of te recipe', 'date' => '1970-01-12', @@ -28,7 +26,7 @@ class RecipeFixIdsTest extends TestCase { $src = $stub; $src['recipe_id'] = 123; - + $expected = $stub; $expected['recipe_id'] = 123; $expected['id'] = '123'; @@ -41,8 +39,10 @@ class RecipeFixIdsTest extends TestCase { /** * @dataProvider dp + * @param mixed $original + * @param mixed $expected */ - public function testRecipeStubs($original, $expected){ + public function testRecipeStubs($original, $expected) { $ret = $this->dut->apply($original); $this->assertSame($expected, $ret); }