Changeset 7733
- Timestamp:
- 03/04/08 11:22:41 (6 months ago)
- Files:
-
- branches/1.1/lib/response/sfWebResponse.class.php (modified) (3 diffs)
- branches/1.1/test/unit/response/sfWebResponseTest.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/response/sfWebResponse.class.php
r7723 r7733 575 575 576 576 /** 577 * Adds a nstylesheet to the current web response.577 * Adds a stylesheet to the current web response. 578 578 * 579 579 * @param string Stylesheet … … 589 589 590 590 /** 591 * Removes a stylesheet from the current web response. 592 * 593 * @param string Stylesheet 594 * @param string Position 595 */ 596 public function removeStylesheet($css, $position = '') 597 { 598 $this->validatePosition($position); 599 600 unset($this->stylesheets[$position][$css]); 601 } 602 603 /** 591 604 * Retrieves javascript code from the current web response. 592 605 * … … 619 632 620 633 $this->javascripts[$position][$js] = $options; 634 } 635 636 /** 637 * Removes javascript code from the current web response. 638 * 639 * @param string Javascript code 640 * @param string Position 641 */ 642 public function removeJavascript($js, $position = '') 643 { 644 $this->validatePosition($position); 645 646 unset($this->javascripts[$position][$js]); 621 647 } 622 648 branches/1.1/test/unit/response/sfWebResponseTest.php
r7723 r7733 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test( 68, new lime_output_color());13 $t = new lime_test(70, new lime_output_color()); 14 14 15 15 class myWebResponse extends sfWebResponse … … 208 208 $t->is($response->getStylesheets('last'), array('last' => array()), '->getStylesheets() takes a position as its first argument'); 209 209 210 $t->diag('->removeStylesheet()'); 211 $response->removeStylesheet('foo'); 212 $t->is($response->getStylesheets(), array('test' => array(), 'bar' => array('media' => 'print')), '->getStylesheets() does no longer contain removed stylesheets'); 213 210 214 // ->addJavascript() 211 215 $t->diag('->addJavascript()'); … … 236 240 $t->is($response->getJavascripts('last'), array('last_js' => array()), '->getJavascripts() takes a position as its first argument'); 237 241 242 $t->diag('->removeJavascript()'); 243 $response->removeJavascript('test'); 244 $t->is($response->getJavascripts(), array('foo' => array('raw_name' => true)), '->getJavascripts() does no longer contain removed javascripts'); 245 238 246 // ->setCookie() ->getCookies() 239 247 $t->diag('->setCookie() ->getCookies()');