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

Mock annotation for classes defined under the test namespace do not work #275

Closed
Syntaf opened this issue Jun 6, 2019 · 0 comments · Fixed by #276
Closed

Mock annotation for classes defined under the test namespace do not work #275

Syntaf opened this issue Jun 6, 2019 · 0 comments · Fixed by #276

Comments

@Syntaf
Copy link
Contributor

Syntaf commented Jun 6, 2019

Classes which live in the same namespace as the test case aren't able to be mocked via annotations currently (unless you use the fully qualified name). Minimal reproducible example:

namespace Foo;

use Bar\TestClass;

class FooHelperClass
{

}

class FooServiceTest
{
    /**
     * This annotation works as expected
     * @var TestClass
     * @Mock
     */
    private $barTestClass;

    /**
     * This annotation does NOT work, Phake does not prepend the Foo\ NS
     * @var FooHelperClass
     * @Mock
     */
    private $fooHelperClass;

    // ...
}
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

Successfully merging a pull request may close this issue.

1 participant