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

Comments: Unit Testing Tutorial Part V: Mock Methods and Overriding Constructors #10

Open
jtreminio opened this issue Dec 17, 2018 · 5 comments

Comments

@jtreminio
Copy link
Owner

https://jtreminio.com/blog/unit-testing-tutorial-part-v-mock-methods-and-overriding-constructors/

@jtreminio jtreminio changed the title Unit Testing Tutorial Part V: Mock Methods and Overriding Constructors Comments: Unit Testing Tutorial Part V: Mock Methods and Overriding Constructors Dec 18, 2018
@gastoncs
Copy link

Gracias por publicar el tutorial muy bien llevado y fácil de entender.

Saludos

@thannaske
Copy link

Thank you for your series, it's a very very helpful resource for looking up things while writing PhpUnit tests. Highly appreciated!

@supkoder
Copy link

supkoder commented Jan 15, 2021

I just discovered your series about PHPUnit, but it is really helpful. Great job, thanks.

@jonyen
Copy link

jonyen commented Feb 6, 2021

Thanks for your blog post! Very helpful.

In regards to the callExit() stub, I think it works better to have it throw an exception, and wrap it around with a try/catch clause. Then you can check the state of any variable within that stub, rather than having to use expectOutputString, as I don't think people would normally have echo/print statements within production level code for testing.

Copy link

sbarza commented Oct 12, 2023

Hello.
Thanks a lot about this explanation! It really clarified some questions I had.

I have a question: if we had the attribute $html private instead of public, how could we get around this problem?

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

6 participants