[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
@daschl
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.

[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.
@doctrinebot

This comment has been minimized.

Show comment Hide comment
@doctrinebot

doctrinebot Jan 7, 2013

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

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

View changes

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() {

This comment has been minimized.

Show comment Hide comment
@lsmith77

lsmith77 Jan 7, 2013

Member

opening { should be on the next line

@lsmith77

lsmith77 Jan 7, 2013

Member

opening { should be on the next line

This comment has been minimized.

Show comment Hide comment
@Ocramius

Ocramius Jan 7, 2013

Owner

Not only for couchbase?

@Ocramius

Ocramius Jan 7, 2013

Owner

Not only for couchbase?

[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.
@daschl

This comment has been minimized.

Show comment Hide comment
@daschl

daschl Jan 7, 2013

Contributor

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.

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 added a commit that referenced this pull request Jan 7, 2013

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

@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