phpmock\AbstractMockTest::testPassingByReference PHP Method

testPassingByReference() public method

Test passing by reference.
    public function testPassingByReference()
    {
        $this->mockFunction(__NAMESPACE__, "exec", function ($a, &$b, &$c) {
            $a = "notExpected";
            $b[] = "test1";
            $b[] = "test2";
            $c = "test";
        });
        $noReference = "expected";
        $b = [];
        $c = "";
        exec($noReference, $b, $c);
        $this->assertEquals(["test1", "test2"], $b);
        $this->assertEquals("test", $c);
        $this->assertEquals("test", $c);
        $this->assertEquals("expected", $noReference);
    }