Removed create_function() function usage#32
Removed create_function() function usage#32magento-engcom-team merged 1 commit intomagento-engcom:2.3-developfrom
create_function() function usage#32Conversation
| $mock = $this->getMockBuilder('Foo') | ||
| ->setMethods(['getValue']) | ||
| ->getMock(); | ||
| $mock->method('getValue') |
There was a problem hiding this comment.
Looks like section ->expects($this->once()) is missing here
There was a problem hiding this comment.
It doesn't matter how many times getValue will be called, that's why expects is not needed.
There was a problem hiding this comment.
In this case would be better to use ->expects($this->any()) to make it clear
There was a problem hiding this comment.
For this test case, in general, it doesn't matter how many times the method will be called, so any() is redundant. The expects() may sense to use when we need to know if the method is called or not (corner cases, like business logic conditionals) or how many times it was called - for performance reasons.
I don't see, how any() makes test a cleaner.
There was a problem hiding this comment.
Ok. Good point. Let's leave it as is
#32 CMS block coverage
…ions #32 - Merge Pull Request magento/bulk-api-ce#32 from magento/bulk-api-ce:amqp-optional-consummers - Merged commits: 1. 9a757cb
Removed
create_function()function usageFixed Issues
Changes for EE in the internal branch https://github.com/magento-mpi/magento2ee/tree/G%238
Contribution checklist