Last active
December 18, 2015 02:49
-
-
Save mpartel/5714229 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Asserts that all data in the fields of $from is present in $to, | |
* except don't care about $exceptFields in $from. | |
* | |
* Works with private fields. Ignores static fields. Ignores empty fields. | |
* | |
* This is useful as a basic sanity check that data was copied without | |
* asserting it field-by-field, which is error-prone. | |
* If a new field appears in the source object, the test breaks and forces | |
* you to consider it. | |
* | |
* @todo Support $from and $to being arrays. | |
* | |
* @param object $from | |
* @param object $to | |
* @param array $exceptFields | |
*/ | |
protected function assertDataWasCopied($from, $to, $exceptFields = []) | |
{ | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment