function advagg_test_generate_selector_css in Advanced CSS/JS Aggregation 7.2
Generates a large CSS string.
Parameters
int $selector_count: The number of selectors to generate.
int $denominator: The max string length of the selector names.
Return value
string Generated CSS string.
Related topics
1 call to advagg_test_generate_selector_css()
- AdvAggCascadingStylesheetsTestCase::testRenderFile in tests/
advagg.test - Tests rendering the stylesheets.
File
- tests/
advagg.test, line 46 - Tests for advagg.module.
Code
function advagg_test_generate_selector_css($selector_count, $denominator = 5) {
static $count = 0;
$pool = array_merge(range('a', 'z'), range('A', 'Z'));
$selector_count = 10000;
$css = '';
while ($selector_count > 0) {
$rand_string = advagg_test_randon_string($selector_count % $denominator + 3, $pool);
$css .= ".{$rand_string}, ";
--$selector_count;
}
$css .= "#last{$count} {z-index: 2; margin-left: -1px; content: \" \"; display: table;}";
++$count;
return $css;
}