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

Already on GitHub? Sign in to your account

[Cache/CouchbaseCache] Return false instead of null for compat. #240

Merged
merged 2 commits into from Jan 7, 2013

Conversation

Projects
None yet
5 participants
Contributor

daschl commented Jan 7, 2013

This changeset fixes and verifies that instead of null, false is returned
from the fetch method. This fixes a bug which causes CouchbaseCache not
to work in combination with the ORM library. Test added.

@daschl daschl [Cache/CouchbaseCache] Return false instead of null for compat.
This changeset fixes and verifies that instead of null, false is returned
from the fetch method. This fixes a bug which causes CouchbaseCache not
to work in combination with the ORM library. Test added.
fc81e68

Hello,

thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

http://doctrine-project.org/jira/browse/DCOM-158

@lsmith77 lsmith77 and 1 other commented on an outdated diff Jan 7, 2013

tests/Doctrine/Tests/Common/Cache/CouchbaseCacheTest.php
@@ -38,6 +38,13 @@ public function testLongLifetime()
$this->assertTrue($cache->contains('key'), 'Couchbase provider should support TTL > 30 days');
}
+ public function testFalseOnFailedFetch() {
@lsmith77

lsmith77 Jan 7, 2013

Member

opening { should be on the next line

@Ocramius

Ocramius Jan 7, 2013

Owner

Not only for couchbase?

@daschl daschl [Cache] Refactoring testFalseOnFailedFetch into CacheTest
This changeset makes sure that all supported caches return
false and not null when a key is not found. This ensures
compatibility with the ORM layer.
dee33aa
Contributor

daschl commented Jan 7, 2013

Okay, this also refactors the method one level up the tree so that it will be used for all caching adapters. I think this is necessary in order to make sure we don't break compatibility to the ORM layer which expects false and not null when no doc is found on fetch.

If possible, please merge since the CouchbaseCache doesn't work in combination with the ORM layer otherwise.

@stof stof added a commit that referenced this pull request Jan 7, 2013

@stof stof Merge pull request #240 from daschl/couchbase-cache-orm-bugfix
[Cache/CouchbaseCache] Return false instead of null for compat.
c07ce5f

@stof stof merged commit c07ce5f into doctrine:master Jan 7, 2013

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment