Log message #4149977

# At Username Text
# Jun 11th 2018, 15:58 neon1024 https://phpunit.de/manual/6.5/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.data-providers
# Jun 11th 2018, 15:58 neon1024 Do you mean this? https://gist.github.com/davidyell/2498236846a8d71c4f84e46ff7eae483#file-testingtimewindow-php-L87
# Jun 11th 2018, 15:57 birdy247 Yes, presumably something needs to use the use the provider?
# Jun 11th 2018, 15:57 neon1024 In other news, can I mix `matching` and `notMatching` in the same query?
# Jun 11th 2018, 15:56 neon1024 I should edit it to make the class and test different parts of the gist, but #effort
# Jun 11th 2018, 15:56 neon1024 ..and you’ll want a way to set the date into the Entity
# Jun 11th 2018, 15:56 birdy247 That looks sweeet
# Jun 11th 2018, 15:55 neon1024 Here is an example I was working on last week, https://gist.github.com/davidyell/2498236846a8d71c4f84e46ff7eae483#file-testingtimewindow-php-L48
# Jun 11th 2018, 15:54 neon1024 I would use a data provider, and test multiple days
# Jun 11th 2018, 15:47 birdy247 test works ok
# Jun 11th 2018, 15:47 birdy247 $this->assertTrue($this->InvoiceItem->get('last_day_of_month'));
# Jun 11th 2018, 15:44 saeideng @birdy247 and your code?
# Jun 11th 2018, 15:27 birdy247 I created a new EntityNameTest
# Jun 11th 2018, 15:27 birdy247 I think I am going about it the wrong way
# Jun 11th 2018, 15:26 birdy247 virtual property
# Jun 11th 2018, 15:26 birdy247 I am trying to test a getter in an entity
# Jun 11th 2018, 14:57 jeremyharris :+1:
# Jun 11th 2018, 14:56 itmpls yep ty
# Jun 11th 2018, 14:53 itmpls ah, lemme clear
# Jun 11th 2018, 14:53 jeremyharris maybe orm cache?
# Jun 11th 2018, 14:53 jeremyharris then no reason
# Jun 11th 2018, 14:53 itmpls entity
# Jun 11th 2018, 14:53 jeremyharris oh
# Jun 11th 2018, 14:53 jeremyharris or in the array before it’s patched
# Jun 11th 2018, 14:53 itmpls i don't have an accessible array at all
# Jun 11th 2018, 14:53 jeremyharris order on the entity?
# Jun 11th 2018, 14:53 jeremyharris if it’s a new column that you’re trying to save, and you have a strict $_accessible array (which is good), then yes you will need to make it accessible
# Jun 11th 2018, 14:52 itmpls $this->SpecialOffers->save($specialOfferEntity); and before that I manipulate $specialOfferEntity->special_offer_dates and set 'order' within
# Jun 11th 2018, 14:52 itmpls @jeremyharris is there a reason why my generated 'order' field for special_offers_dates wouldn't save to the table with the column int(11) unsigned? do I manually need to make it accessible?
# Jun 11th 2018, 14:31 jeremyharris it’s programming I guess. there are many ways to do the same thing. I usually start with the easiest and worry about performance later
# Jun 11th 2018, 14:31 itmpls dont know why i seem to complicate things sometimes :S
# Jun 11th 2018, 14:30 itmpls i guess it's really just an order field
# Jun 11th 2018, 14:29 itmpls lemme try :slightly_smiling_face: thanks for the input
# Jun 11th 2018, 14:28 itmpls i might need both
# Jun 11th 2018, 14:28 jeremyharris I’ve not used the counter cache very much, so you might want to ask someone else about using it :slightly_smiling_face:
# Jun 11th 2018, 14:28 jeremyharris yeah it might
# Jun 11th 2018, 14:28 itmpls that would save a lot of hassle perhaps
# Jun 11th 2018, 14:28 itmpls when i save it
# Jun 11th 2018, 14:28 itmpls you know i wonder if i should just save the x in [x] of [y] to the record
# Jun 11th 2018, 14:26 itmpls i guess i could reverse it
# Jun 11th 2018, 14:26 itmpls i'm pulling from special offer dates though, not the parent entity in my query which seemed easier before the counting