public function get() { $value = $this->input->cookie($this->options['name']); if ($value) { return json_decode($value); } }
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()); }