Cake Integration Testing in CakePHP 2.0

I am a rails developer and I want to make some capybara + style (rspec or cucumber) to integrate with cakephp 2.0. I used PHPUnit (the standard test environment for cake 2.0), but I donโ€™t know how to integrate it with Selenium and Cake at the same time to get the full stack effect that you have on rails

So, for experienced php developers who used cake 2.0 ... how do you guys do proper integration testing?

+6
source share
1 answer

I am not surprised that there is no answer to this question - the community of testers in CakePHP seems very small. I worked on large projects with a huge number of functional and unit tests (currently a set of about 1,500 tests), but for this I need to expand the functionality of the CakePHP test suite (you can take a look at my now slightly outdated TDD plugin ).

When we started, we did not know much about integration testing, and creating a decent module testing environment was quite a challenge. Now we use Rails :)

In principle, this is not a fair way. To get something working, you need an extension for the framework - it will also require a new test case class that extends PHPUnit_Extensions_Selenium2TestCase and combines any necessary functions from CakeTestCase and ControllerTestCase .

I hope you get somewhere! If you do, it would be great if you could share this code with the rest of the community.

+2
source

Source: https://habr.com/ru/post/914847/


All Articles