Integrating Codeception with Drupal to have added support for TDD

Integrating Codeception with Drupal to have added support for TDD

On26th Mar 2017, 2024-11-21T08:30:46+05:30 ByKarthik Kumar D K | read
Listen Pause Resume Stop

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"},Orcomposer 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 :)

Related Articles

Recent Articles

Recent Quick Read

Recent Great People

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