Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename method to and fro breaks the script #101

Open
elmar-hinz opened this issue May 12, 2016 · 0 comments
Open

Rename method to and fro breaks the script #101

elmar-hinz opened this issue May 12, 2016 · 0 comments

Comments

@elmar-hinz
Copy link

I wrote a unit test to examine the options of runkit. When renaming a method to and fro the test simply breaks when trying to call the method again.

protected function demo($count = 0)
{
    $count += 1;
    return $count;
}

/**
 * @test
 */
public function methodRename()
{
    $this->assertTrue(method_exists($this, 'demo'));
    $this->assertFalse(method_exists($this, 'demo1'));

    $this->assertEquals(1, $this->demo());
    runkit_method_rename(get_class($this), 'demo', 'demo1');
    $this->assertEquals(1, $this->demo1());
    $this->assertFalse(method_exists($this, 'demo'));
    $this->assertTrue(method_exists($this, 'demo1'));

    runkit_method_rename(get_class($this), 'demo1', 'demo');
    $this->assertTrue(method_exists($this, 'demo'));
    $this->assertFalse(method_exists($this, 'demo1'));
    // Here the execution of the unit test breaks:
    $this->assertEquals(1, $this->demo());
}

runkit

runkit support => enabled
version => 1.0.4-dev
Custom Superglobal support => enabled
Sandbox Support => disable or unavailable
Runtime Manipulation => enabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant