8000 [HttpFoundation] MongoDbSessionHandler supports auto expiry via configurable expiry_field by catchamonkey · Pull Request #11510 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpFoundation] MongoDbSessionHandler supports auto expiry via configurable expiry_field #11510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Modifies the gc tests to use positive values
  • Loading branch information
catchamonkey committed Aug 1, 2014
commit fc962db8aa906039383caf1ea1fd6683ed147d60
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ public function testGc()
->method('remove')
->will($this->returnCallback(function ($criteria) use ($that) {
$that->assertInstanceOf('MongoDate', $criteria[$that->options['time_field']]['$lt']);
$that->assertGreaterThanOrEqual(time() - -1, $criteria[$that->options['time_field']]['$lt']->sec);
$that->assertGreaterThanOrEqual(time() - 1, $criteria[$that->options['time_field']]['$lt']->sec);
}));

$this->assertTrue($this->storage->gc(-1));
$this->assertTrue($this->storage->gc(1));
}

public function testGcWhenUsingExpiresField()
Expand Down Expand Up @@ -230,10 +230,10 @@ public function testGcWhenUsingExpiresField()
->method('remove')
->will($this->returnCallback(function ($criteria) use ($that) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will() can be removed, as you expect it will never be called

$that->assertInstanceOf('MongoDate', $criteria[$that->options['time_field']]['$lt']);
$that->assertGreaterThanOrEqual(time() - -1, $criteria[$that->options['time_field']]['$lt']->sec);
$that->assertGreaterThanOrEqual(time() - 1, $criteria[$that->options['time_field']]['$lt']->sec);
}));

$this->assertTrue($this->storage->gc(-1));
$this->assertTrue($this->storage->gc(1));
}

private function createMongoCollectionMock()
Expand Down
0