$response->addStylesheet('first2', 'first'); $response->addStylesheet('multiple', 'last'); $filterChain->execute(); // sfCommmonFilter has executed all its code } } $context = sfContext::getInstance(); $context->request = new myRequest(); $response = new sfWebResponse(); $response->initialize($context); $context->response = $response; $selector = execute_filter_chain($context, $t); check_javascripts_included($t, $selector); check_stylesheets_included($t, $selector); // test disabling javascript and stylesheet automatic inclusion $response->setParameter('stylesheets_included', true, 'symfony/view/asset'); $response->setParameter('javascripts_included', true, 'symfony/view/asset'); $selector = execute_filter_chain($context, $t); $t->is($selector->getElements('head script'), array(), '->execute() does not add javascripts if you used get_javascripts() helper'); $t->is($selector->getElements('head link'), array(), '->execute() does not add stylesheets if you used get_stylesheets() helper'); $response->setParameter('stylesheets_included', true, 'symfony/view/asset'); $response->setParameter('javascripts_included', false, 'symfony/view/asset'); $selector = execute_filter_chain($context, $t); check_javascripts_included($t, $selector); $t->is($selector->getElements('head link'), array(), '->execute() does not add javascripts if you used get_javascripts() helper'); $response->setParameter('stylesheets_included', false, 'symfony/view/asset'); $response->setParameter('javascripts_included', true, 'symfony/view/asset'); $selector = execute_filter_chain($context, $t); $t->is($selector->getElements('head script'), array(), '->execute() does not add javascripts if you used get_javascripts() helper'); check_stylesheets_included($t, $selector); function check_stylesheets_included($t, $selector)