restrictionUtil = $this->get(RestrictionUtil::class); $this->sectionTree = $this->get(SectionTree::class); } /** @dataProvider data_testRestrictSections */ public function testRestrictSections(string $showEmptySections, int $expectedCount): void { \Settings::getDefault()->cat_show_empty = $showEmptySections; $sections = $this->restrictionUtil->restrictSections( $this->sectionTree->getTree() ); $this->assertCount($expectedCount, $sections); } public function data_testRestrictSections(): iterable { yield 'Show empty sections is disabled' => ['N', 1]; yield 'Show empty sections is enabled' => ['Y', 3]; } protected function getDataSet() { return $this->getJsonDataSetFromFile(); } }