/** * @covers LosMiddleware\RateLimit\Storage\FileStorage::__construct * @covers LosMiddleware\RateLimit\Storage\FileStorage::set * @covers LosMiddleware\RateLimit\Storage\FileStorage::get * @covers LosMiddleware\RateLimit\Storage\FileStorage::getFile */ public function testCanOverwride() { $this->object->set('key', 'value'); $this->assertSame('value', $this->object->get('key')); $this->object->set('key', 'value2'); $this->assertSame('value2', $this->object->get('key')); }
/** * @covers LosMiddleware\RateLimit\Storage\ApcStorage::__construct * @covers LosMiddleware\RateLimit\Storage\ApcStorage::set * @covers LosMiddleware\RateLimit\Storage\ApcStorage::get */ public function testSetGet() { if (!getenv('TESTS_APC_ENABLED')) { $this->markTestSkipped('Enable TESTS_APC_ENABLED to run this test'); } $this->object->set('key', 'value'); $this->assertSame('value', $this->object->get('key')); $this->assertSame('not', $this->object->get('nokey', 'not')); }
/** * @covers LosMiddleware\RateLimit\Storage\ZendSessionStorage::__construct * @covers LosMiddleware\RateLimit\Storage\ZendSessionStorage::set * @covers LosMiddleware\RateLimit\Storage\ZendSessionStorage::get */ public function testSetGet() { $this->object->set('key', 'value'); $this->assertSame('value', $this->object->get('key')); $this->assertSame('not', $this->object->get('nokey', 'not')); }