This commits changes WC_Product_Variation to raise an exception when the
class is instantiated with an ID that belongs to a post object that is
not a product variation.
This is necessary to avoid problems like the one described in #24956
where passing a variable product ID to WC_Product_Variation would result
in transparently modifying the variable product title and excerpt.
This commit fixes all 1533 PHPCS errors that PHPCBF can fix automatically in the tests/ directory. Before this change there was a total of 3106 PHPCS errors in the WooCommerce repository and now there is 1573 errors.