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
[GH-7633] disallow cache partial objects #8050
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1099,6 +1099,21 @@ public function testCacheablePartialQueryException() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
->getResult(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* @expectedException \Doctrine\ORM\Cache\CacheException | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* @expectedExceptionMessage Second level cache does not support partial entities. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
public function testCacheableForcePartialLoadHintQueryException() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$this->evictRegions(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$this->loadFixturesCountries(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$this->_em->createQuery("SELECT c FROM Doctrine\Tests\Models\Cache\Country c") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
->setCacheable(true) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
->getResult(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We might need to import
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 99 occurrences of this in tests on 2.7, i move this to a mainteance task for 2.8 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* @expectedException \Doctrine\ORM\Cache\CacheException | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* @expectedExceptionMessage Second-level cache query supports only select statements. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we can do this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like to keep it this way now.