lithium\net\http\Media::reset PHP Method

reset() public static method

Resets the Media class to its default state. Mainly used for ensuring a consistent state during testing.
public static reset ( )
    public static function reset()
    {
        static::$_handlers = array();
        static::$_types = array();
        static::$_scope = false;
        if (isset(static::$_scopes)) {
            static::$_scopes->reset();
        }
    }

Usage Example

Example #1
0
 /**
  * Tests that the `Media` class' configuration can be reset to its default state.
  *
  * @return void
  */
 public function testStateReset()
 {
     $this->assertFalse(in_array('foo', Media::types()));
     Media::type('foo', 'text/x-foo');
     $this->assertTrue(in_array('foo', Media::types()));
     Media::reset();
     $this->assertFalse(in_array('foo', Media::types()));
 }
All Usage Examples Of lithium\net\http\Media::reset