/** * Enable (or disable when false is given) the cache. * * @param bool $enabled default true. * * @return Response */ public function cache($enabled = true) { if (!$enabled) { $this->header('Pragma', 'no-cache'); $this->header('Cache-Control', 'no-store, no-cache'); return $this; } $this->headers->remove('Pragma'); $this->headers->remove('Cache-Control'); return $this; }
/** * @covers ::__construct * @covers ::set * @covers ::all * @covers ::keys * @covers ::values */ public function testSetAndKeysValues() { $collection = new DataCollection(); $expect = array('test1' => true, 'test2' => 2); $collection->set('test1', true); $collection->set('test2', 2); $this->assertEquals($expect, $collection->all()); $this->assertEquals(array_keys($expect), $collection->keys()); $this->assertEquals(array_values($expect), $collection->values()); $this->assertTrue($collection->exists('test1')); $this->assertTrue($collection->exists('test2')); $this->assertFalse($collection->exists('testtest')); $collection->remove('test1'); $this->assertFalse($collection->exists('test1')); }