Cartalyst\Sentinel\Cookies\CICookie::get PHP Method

get() public method

{@inheritDoc}
public get ( )
    public function get()
    {
        $value = $this->input->cookie($this->options['name']);
        if ($value) {
            return json_decode($value);
        }
    }

Usage Example

Beispiel #1
0
 public function testGet()
 {
     $cookie = new CICookie($input = m::mock('CI_Input'), 'foo');
     $input->shouldReceive('cookie')->with('foo')->once()->andReturn(serialize('baz'));
     $this->assertEquals('baz', $cookie->get());
 }