public function MenuTreeParametersTest::providerTestSetMinDepth in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Menu/MenuTreeParametersTest.php \Drupal\Tests\Core\Menu\MenuTreeParametersTest::providerTestSetMinDepth()
Provides test data for testSetMinDepth().
File
- core/
tests/ Drupal/ Tests/ Core/ Menu/ MenuTreeParametersTest.php, line 25 - Contains \Drupal\Tests\Core\Menu\MenuTreeParametersTest.
Class
- MenuTreeParametersTest
- Tests the menu link tree parameters value object.
Namespace
Drupal\Tests\Core\MenuCode
public function providerTestSetMinDepth() {
$data = array();
// Valid values at the extremes and in the middle.
$data[] = array(
1,
1,
);
$data[] = array(
2,
2,
);
$data[] = array(
9,
9,
);
// Invalid values are mapped to the closest valid value.
$data[] = array(
-10000,
1,
);
$data[] = array(
0,
1,
);
// … except for those invalid values that reach beyond the maximum depth,
// because MenuTreeParameters is a value object and hence cannot depend
// on anything; to know the actual maximum depth, it'd have to depend on the
// MenuTreeStorage service.
$data[] = array(
10,
10,
);
$data[] = array(
100000,
100000,
);
return $data;
}