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

Function uopz_set_mock don't work when Xdebug extension is loaded #61

Closed
vasyl-khomko opened this issue Aug 15, 2017 · 4 comments
Closed

Comments

@vasyl-khomko
Copy link

test code:

<?php

class A1 {
  public function test() {
    print "a1\n";
  }
}

class A2 {
  public function test() {
    print "a2\n";
  }
}

uopz_set_mock('A1', 'A2');

$a = new A1();
$a->test();

print get_class($a) . "\n";

output:

a1
A1

expected output:

a2
A2
@cmb69
Copy link
Collaborator

cmb69 commented Oct 3, 2017

I can confirm this issue. However, I only needed the uopz and Xdebug combination to produce code coverage reports via PHPUnit, so switching to phpdbg provides a viable workaround.

@JakeQZ
Copy link

JakeQZ commented May 24, 2018

Static methods still seem to be replaced as expected - e.g. the example at https://secure.php.net/manual/en/function.uopz-set-mock.php still works. (PHP 7.1.11 Windows x86 TS.)

@omarysadek
Copy link

PHP 7.1.16
Xdebug 2.5.5
PHPUnit 5.7.27
Still having issue to replace new instance of a class, is there any planned fix for that issue?

krakjoe added a commit that referenced this issue Dec 31, 2018
@krakjoe
Copy link
Owner

krakjoe commented Dec 31, 2018

Fixed in edfca8d

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

5 participants