Skip to content

Instantly share code, notes, and snippets.

@MortalFlesh
Last active May 16, 2018 11:29
Show Gist options
  • Save MortalFlesh/01a91b0ebe1d6181e5d39bde1fe67e9e to your computer and use it in GitHub Desktop.
Save MortalFlesh/01a91b0ebe1d6181e5d39bde1fe67e9e to your computer and use it in GitHub Desktop.
PHP specific constructs, functions, aproaches etc. which are quite tricky, but usefull sometimes...

PHP Cheat-sheet

PHP specific constructs, functions, aproaches etc. which are quite tricky, but usefull sometimes...

Changing private attribute value

public function testShouldChangeInternalAttributeValue()
{
    $old = new Tenant('all', 'old')
    $new = new Tenant('all', 'new');
    $intent = new Intent('name', 'scope', $old);

    (function (Tenant $newTenant) {
        $this->tenant = $newTenant;
    })->bindTo($intent, $intent)($new);

    $this->assertAttributeEquals($new, 'tenant', $intent);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment