lithium\tests\mocks\core\MockExposed::tamper PHP Méthode

tamper() public méthode

public tamper ( )
    public function tamper()
    {
        $internal =& $this->_internal;
        return $this->_filter(__METHOD__, array(), function () use(&$internal) {
            $internal = 'tampered';
            return true;
        });
    }

Usage Example

Exemple #1
0
 /**
  * Verifies workaround for accessing protected properties in filtered methods.
  *
  * @return void
  */
 function testFilteringWithProtectedAccess()
 {
     $object = new MockExposed();
     $this->assertEqual($object->get(), 'secret');
     $this->assertTrue($object->tamper());
     $this->assertEqual($object->get(), 'tampered');
 }
MockExposed