Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

issue.static_call

Edson Medina edited this page Jul 7, 2017 · 2 revisions

Static call

function doThis() 
{
    $x = Foo::bar ($y);
}

Why is this a testing issue?

Static calls can't be replaced in run-time. So the method can't be tested in isolation.

Possible refactorigns

Make it non static

function doThis ($foo)
{
    $x = $foo->bar ($y);
}
Clone this wiki locally