Jump to content

Issue while Integrating PHPUnit into Processwire


Mirza
 Share

Recommended Posts

Hi All,

I am trying to include the unit tests into our project which is in Processwire(I love it).

Directory structure for the same will be shown below

5a12ba75d3c46_ScreenShot2017-11-20at3_16_27PM.png.3408f9d16a8fd6e79d0be91105fb19a9.png

 

Here PWTestCase.php is the parent file where it is getting inherited from the PHPUNIT framework TestCase class and It is in same namespace ProcessWire; as shown below

5a12bb0a57bea_ScreenShot2017-11-20at3_22_22PM.png.55cafb147b34e9274de7458816e443a6.png

Now I have a basic unit test(FuncTest.php as shown below) to check the language calling the function getLanguage() residing in site/templates/_func.php.

5a12bc91352a4_ScreenShot2017-11-20at3_28_25PM.png.0cf8e46be976f0892c32f7c95c59983f.png

***when try to run this test, getting undefined function getLanguage as shown below***

5a12bcb83c126_ScreenShot2017-11-20at3_26_46PM.png.6fb724f6f8cff5d9addee399ee650c64.png

 

Since I am using namespace ProcessWire; & bootstraping processwire in PWTestCase why i am not able to access functions? Can you please suggest where i am going wrong?

Thanks in advance.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...