Development

Changeset 17711

You must first sign up to be able to contribute.

Changeset 17711

Show
Ignore:
Timestamp:
04/28/09 15:26:45 (6 years ago)
Author:
FabianLange
Message:

[1.1, 1.2, 1.3] added test that proves that passing a position to stylesheets and javascripts in view.yml is possible (refs #6242)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/test/unit/config/sfViewConfigHandlerTest.php

    r7812 r17711  
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(20, new lime_output_color()); 
     13$t = new lime_test(22, new lime_output_color()); 
    1414 
    1515class myViewConfigHandler extends sfViewConfigHandler 
     
    4444$handler->setConfiguration(array( 
    4545  'myView' => array( 
    46     'javascripts' => array('foobar'), 
    47   ), 
    48 )); 
    49 $content = <<<EOF 
    50   \$response->addJavascript('foobar', '', array ()); 
     46    'stylesheets' => array(array('foobar' => array('position' => 'last'))), 
     47  ), 
     48)); 
     49$content = <<<EOF 
     50  \$response->addStylesheet('foobar', 'last', array ()); 
     51 
     52EOF; 
     53$t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds stylesheets to the response'); 
     54 
     55$handler->setConfiguration(array( 
     56  'myView' => array( 
     57    'javascripts' => array('foobar'), 
     58  ), 
     59)); 
     60$content = <<<EOF 
     61  \$response->addJavascript('foobar', '', array ()); 
     62 
     63EOF; 
     64$t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds JavaScript to the response'); 
     65 
     66$handler->setConfiguration(array( 
     67  'myView' => array( 
     68    'javascripts' => array(array('foobar' => array('position' => 'last'))), 
     69  ), 
     70)); 
     71$content = <<<EOF 
     72  \$response->addJavascript('foobar', 'last', array ()); 
    5173 
    5274EOF; 
  • branches/1.2/test/unit/config/sfViewConfigHandlerTest.php

    r7812 r17711  
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(20, new lime_output_color()); 
     13$t = new lime_test(22, new lime_output_color()); 
    1414 
    1515class myViewConfigHandler extends sfViewConfigHandler 
     
    4444$handler->setConfiguration(array( 
    4545  'myView' => array( 
    46     'javascripts' => array('foobar'), 
    47   ), 
    48 )); 
    49 $content = <<<EOF 
    50   \$response->addJavascript('foobar', '', array ()); 
     46    'stylesheets' => array(array('foobar' => array('position' => 'last'))), 
     47  ), 
     48)); 
     49$content = <<<EOF 
     50  \$response->addStylesheet('foobar', 'last', array ()); 
     51 
     52EOF; 
     53$t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds stylesheets to the response'); 
     54 
     55$handler->setConfiguration(array( 
     56  'myView' => array( 
     57    'javascripts' => array('foobar'), 
     58  ), 
     59)); 
     60$content = <<<EOF 
     61  \$response->addJavascript('foobar', '', array ()); 
     62 
     63EOF; 
     64$t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds JavaScript to the response'); 
     65 
     66$handler->setConfiguration(array( 
     67  'myView' => array( 
     68    'javascripts' => array(array('foobar' => array('position' => 'last'))), 
     69  ), 
     70)); 
     71$content = <<<EOF 
     72  \$response->addJavascript('foobar', 'last', array ()); 
    5173 
    5274EOF; 
  • branches/1.3/test/unit/config/sfViewConfigHandlerTest.php

    r7812 r17711  
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(20, new lime_output_color()); 
     13$t = new lime_test(22, new lime_output_color()); 
    1414 
    1515class myViewConfigHandler extends sfViewConfigHandler 
     
    4444$handler->setConfiguration(array( 
    4545  'myView' => array( 
    46     'javascripts' => array('foobar'), 
    47   ), 
    48 )); 
    49 $content = <<<EOF 
    50   \$response->addJavascript('foobar', '', array ()); 
     46    'stylesheets' => array(array('foobar' => array('position' => 'last'))), 
     47  ), 
     48)); 
     49$content = <<<EOF 
     50  \$response->addStylesheet('foobar', 'last', array ()); 
     51 
     52EOF; 
     53$t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds stylesheets to the response'); 
     54 
     55$handler->setConfiguration(array( 
     56  'myView' => array( 
     57    'javascripts' => array('foobar'), 
     58  ), 
     59)); 
     60$content = <<<EOF 
     61  \$response->addJavascript('foobar', '', array ()); 
     62 
     63EOF; 
     64$t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds JavaScript to the response'); 
     65 
     66$handler->setConfiguration(array( 
     67  'myView' => array( 
     68    'javascripts' => array(array('foobar' => array('position' => 'last'))), 
     69  ), 
     70)); 
     71$content = <<<EOF 
     72  \$response->addJavascript('foobar', 'last', array ()); 
    5173 
    5274EOF;