Skip to content

REFACTOR Purchasable - setIsAvailable#110

Draft
jsirish wants to merge 1 commit intodynamic:masterfrom
jsirish:feature/setIsAvailable
Draft

REFACTOR Purchasable - setIsAvailable#110
jsirish wants to merge 1 commit intodynamic:masterfrom
jsirish:feature/setIsAvailable

Conversation

@jsirish
Copy link
Copy Markdown
Member

@jsirish jsirish commented Aug 7, 2020

cache $is_available

@jsirish
Copy link
Copy Markdown
Member Author

jsirish commented Aug 7, 2020

So this works great when testing the FE and CMS, and saves 4 queries on page load.

However, it consistently fails PurchasableTest at the following point:
https://github.com/dynamic/silverstripe-foxy/blob/master/tests/Extension/PurchasableTest.php#L113

The test passes if instead of returning $this->is_available I return $this->setIsAvailable() and just return the value of $available vs. setting the static

@jsirish jsirish requested a review from muskie9 August 7, 2020 23:48
@jsirish jsirish marked this pull request as draft August 8, 2020 20:52
@muskie9 muskie9 removed their request for review November 11, 2022 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant