Changeset 3299
- Timestamp:
- 01/17/07 07:20:21 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/test/unit/config/sfViewConfigHandlerTest.php
r3289 r3299 40 40 41 41 EOF; 42 $t->is( $handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() adds stylesheets to the response');43 44 $handler->mergeConfig(array( 45 'myView' => array( 46 'javascripts' => array('foobar'), 47 ), 48 )); 49 $content = <<<EOF 50 \$response->addJavascript('foobar'); 51 52 EOF; 53 $t->is( $handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() adds JavaScript to the response');42 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds stylesheets to the response'); 43 44 $handler->mergeConfig(array( 45 'myView' => array( 46 'javascripts' => array('foobar'), 47 ), 48 )); 49 $content = <<<EOF 50 \$response->addJavascript('foobar'); 51 52 EOF; 53 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds JavaScript to the response'); 54 54 55 55 // Insertion order for stylesheets … … 69 69 70 70 EOF; 71 $t->is( $handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() adds view-specific stylesheets after application-wide assets');71 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds view-specific stylesheets after application-wide assets'); 72 72 73 73 $handler->mergeConfig(array( … … 84 84 85 85 EOF; 86 $t->is( $handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() adds view-specific stylesheets after application-wide assets');86 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds view-specific stylesheets after application-wide assets'); 87 87 88 88 $handler->mergeConfig(array( … … 99 99 100 100 EOF; 101 $t->is( $handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() adds view-specific stylesheets after default assets');101 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds view-specific stylesheets after default assets'); 102 102 103 103 $handler->mergeConfig(array( … … 114 114 115 115 EOF; 116 $t->is( $handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() adds view-specific stylesheets after default assets');116 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds view-specific stylesheets after default assets'); 117 117 118 118 $handler->mergeConfig(array( … … 129 129 130 130 EOF; 131 $t->is( $handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() adds application-specific stylesheets after default assets');131 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds application-specific stylesheets after default assets'); 132 132 133 133 $handler->mergeConfig(array( … … 144 144 145 145 EOF; 146 $t->is( $handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() adds application-specific stylesheets after default assets');146 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds application-specific stylesheets after default assets'); 147 147 148 148 // Insertion order for javascripts … … 162 162 163 163 EOF; 164 $t->is( $handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() adds view-specific javascripts after application-wide assets');164 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds view-specific javascripts after application-wide assets'); 165 165 166 166 $handler->mergeConfig(array( … … 177 177 178 178 EOF; 179 $t->is( $handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() adds view-specific javascripts after application-wide assets');179 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds view-specific javascripts after application-wide assets'); 180 180 181 181 $handler->mergeConfig(array( … … 192 192 193 193 EOF; 194 $t->is( $handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() adds view-specific javascripts after default assets');194 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds view-specific javascripts after default assets'); 195 195 196 196 $handler->mergeConfig(array( … … 207 207 208 208 EOF; 209 $t->is( $handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() adds view-specific javascripts after default assets');209 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds view-specific javascripts after default assets'); 210 210 211 211 $handler->mergeConfig(array( … … 222 222 223 223 EOF; 224 $t->is( $handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() adds application-specific javascripts after default assets');224 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds application-specific javascripts after default assets'); 225 225 226 226 $handler->mergeConfig(array( … … 237 237 238 238 EOF; 239 $t->is( $handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() adds application-specific javascripts after default assets');239 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() adds application-specific javascripts after default assets'); 240 240 241 241 // removal of assets … … 255 255 256 256 EOF; 257 $t->is( $handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() supports the - option to remove one stylesheet previously added');257 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() supports the - option to remove one stylesheet previously added'); 258 258 259 259 $handler->mergeConfig(array( … … 270 270 271 271 EOF; 272 $t->is( $handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() supports the - option to remove one javascript previously added');272 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() supports the - option to remove one javascript previously added'); 273 273 274 274 $handler->mergeConfig(array( … … 281 281 282 282 EOF; 283 $t->is( $handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() supports the -* option to remove all stylesheets previously added');283 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() supports the -* option to remove all stylesheets previously added'); 284 284 285 285 $handler->mergeConfig(array( … … 292 292 293 293 EOF; 294 $t->is( $handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() supports the -* option to remove all javascripts previously added');294 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() supports the -* option to remove all javascripts previously added'); 295 295 296 296 $handler->mergeConfig(array( … … 306 306 307 307 EOF; 308 $t->is($handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() supports the -* option to remove all assets previously added'); 309 308 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() supports the -* option to remove all assets previously added'); 310 309 311 310 $handler->mergeConfig(array( … … 328 327 329 328 EOF; 330 $t->is($handler->addHtmlAsset('myView'), $content, 'addHtmlAsset() supports the -* option to remove all assets previously added'); 329 $t->is(fix_content($handler->addHtmlAsset('myView')), fix_content($content), 'addHtmlAsset() supports the -* option to remove all assets previously added'); 330 331 function fix_content($content) 332 { 333 return str_replace(array("\r\n", "\n", "\r"), "\n", $content); 334 }