11 | | I've come up with a pretty simple outline of a solution that I'll attach a patch for that introduces a new class `BP_LoggedIn_User` which uses a magic `__get()` to fetch property values from WP as needed. I think it's what John was hinting at above. Anyway, it seems to work, though I'm not currently able to run our unit tests, so don't know what that will uncover. |
| 11 | I've come up with a pretty simple outline of a solution that I'll attach a patch for that introduces a new class `BP_LoggedIn_User` which uses a magic `__get()` to fetch property values from WP as needed. I think it's what John was hinting at above. Anyway, it seems to work, and running the unit tests fails on two tests that look like they should fail: |
| 12 | |
| 13 | {{{ |
| 14 | 1) BP_Tests_BP_Groups_Group_TestCases::test_is_member_property |
| 15 | Failed asserting that 354 is false. |
| 16 | |
| 17 | /var/www/html/wp-content/plugins/buddypress/tests/phpunit/testcases/groups/class-bp-groups-group.php:1762 |
| 18 | |
| 19 | 2) BP_Tests_BP_Groups_Group_TestCases::test_is_invited_property |
| 20 | Failed asserting that 40 is false. |
| 21 | |
| 22 | /var/www/html/wp-content/plugins/buddypress/tests/phpunit/testcases/groups/class-bp-groups-group.php:1788. |
| 23 | }}} |