×

Integrating Codeception with Drupal to have added support for TDD

Read Article
Pause
Resume
Stop
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.

What is CODECEPTION?

  • 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

Installation

In composer.json

"require": {
    "codeception/codeception": "2.2"
},

Or

composer require codeception/codeception --dev

Setup

$ 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 :)

Comments

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