Integrating Codeception with Drupal to have added support for TDD

ByKarthik Kumar D Kon26th Mar 2017, 2022-12-01T08:00:00+05:30
Read Article
Integrating Codeception with Drupal to have added support for TDD

Getting Codeception into Drupal, will have added support for Test Driven Development.. Specifically in having the Acceptance Tests in the project.. Since Test Driven Development would be one the most integral part of the project.. And also internal team and vendor team would be having more confidence in the version releases of their project.. one can prefer TDD.

Test driven development is an evolutionary approach to development which combines test-first development where you write a test before you write just enough production code to fulfill that test and refactoring.

  • For the entire lifespan of your project, you have tests for the features you build.
  • Speeds up development
  • Ensures you write good quality code/build good quality features

So, here we get Codeception for having our TDD approach.


  • Powered by PHPUnit
  • VERY easy to extend
  • Run any type of test you may want to
    • Acceptance
    • Functional
    • Unit
  • Build your own suite with a combination of provided modules (CLI suite for custom Drush commands)
  • Run all your different test types from one source


In composer.json

"require": {
    "codeception/codeception": "2.2"


composer require codeception/codeception --dev


$ php vendor/bin/codecept bootstrap

How to Run it

php vendor/bin/codecept run

Its well documented, in the Codeception docs, like how to generate the test cases, extend and run those..

And I have a Demo piece of code in the Git which helps to setup very easily..

Thank you :)

We Need Your Consent
By clicking “Accept Cookies”, you agree to the storing of cookies on your device to enhance your site navigation experience.
I Accept Cookies