Generates a large CSS string.

Paramètres

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.

Sujets associés

1 call to advagg_test_generate_selector_css()
AdvAggCascadingStylesheetsTestCase::testRenderFile dans tests/advagg.test
Tests rendering the stylesheets.

Fichier

tests/advagg.test, line 46

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;
}