Changeset 29990
- Timestamp:
- 06/25/10 19:06:20 (2 years ago)
- Files:
-
- branches/1.3/lib/escaper/sfOutputEscaperObjectDecorator.class.php (modified) (1 diff)
- branches/1.3/test/unit/escaper/sfOutputEscaperObjectDecoratorTest.php (modified) (2 diffs)
- branches/1.4/lib/escaper/sfOutputEscaperObjectDecorator.class.php (modified) (1 diff)
- branches/1.4/test/unit/escaper/sfOutputEscaperObjectDecoratorTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.3/lib/escaper/sfOutputEscaperObjectDecorator.class.php
r29818 r29990 100 100 101 101 /** 102 * Asks the wrapped object whether a property is set. 103 * 104 * @return boolean 105 */ 106 public function __isset($key) 107 { 108 return isset($this->value->$key); 109 } 110 111 /** 102 112 * Returns the size of the object if it implements Countable (is required by the Countable interface). 103 113 * branches/1.3/test/unit/escaper/sfOutputEscaperObjectDecoratorTest.php
r29818 r29990 25 25 sfConfig::set('sf_charset', 'UTF-8'); 26 26 27 $t = new lime_test( 6);27 $t = new lime_test(8); 28 28 29 29 class OutputEscaperTest … … 87 87 $t->is(count($foo), 1, '->count() returns 1 if the embedded object does not implement the Countable interface'); 88 88 $t->is(count($fooc), 2, '->count() returns the count() for the embedded object'); 89 90 // ->__isset() 91 $t->diag('->__isset()'); 92 93 $raw = new stdClass(); 94 $raw->foo = 'bar'; 95 $esc = sfOutputEscaper::escape('esc_entities', $raw); 96 $t->ok(isset($esc->foo), '->__isset() asks the wrapped object whether a property is set'); 97 unset($raw->foo); 98 $t->ok(!isset($esc->foo), '->__isset() asks the wrapped object whether a property is set'); branches/1.4/lib/escaper/sfOutputEscaperObjectDecorator.class.php
r29818 r29990 100 100 101 101 /** 102 * Asks the wrapped object whether a property is set. 103 * 104 * @return boolean 105 */ 106 public function __isset($key) 107 { 108 return isset($this->value->$key); 109 } 110 111 /** 102 112 * Returns the size of the object if it implements Countable (is required by the Countable interface). 103 113 * branches/1.4/test/unit/escaper/sfOutputEscaperObjectDecoratorTest.php
r29818 r29990 25 25 sfConfig::set('sf_charset', 'UTF-8'); 26 26 27 $t = new lime_test( 6);27 $t = new lime_test(8); 28 28 29 29 class OutputEscaperTest … … 87 87 $t->is(count($foo), 1, '->count() returns 1 if the embedded object does not implement the Countable interface'); 88 88 $t->is(count($fooc), 2, '->count() returns the count() for the embedded object'); 89 90 // ->__isset() 91 $t->diag('->__isset()'); 92 93 $raw = new stdClass(); 94 $raw->foo = 'bar'; 95 $esc = sfOutputEscaper::escape('esc_entities', $raw); 96 $t->ok(isset($esc->foo), '->__isset() asks the wrapped object whether a property is set'); 97 unset($raw->foo); 98 $t->ok(!isset($esc->foo), '->__isset() asks the wrapped object whether a property is set');