Sunday, September 14, 2014

Installation and Configuration of Codeception with Composer

Installation and Configuration of Codeception with Composer:

What is Composer: Basically composer is dependency manager for php.If you have ever worked with PHP you must have got the feeling that for some of the common tasks you need to look for the dependencies for various frameworks like zend, laravel or symphony etc.
This is where Composer comes into play.
It will manage all the dependencies required for different frameworks.
Composer will pull all the required stuffs(libraries,dependencies) and put them all in a common place.


1. Install composer to your projects root folder.
You can download the composer here.

2. Then we need to download all the codeception libraries and dependencies.

3. So create a new test folder say MyFirstTest and within this folder create a new json file called Composer.json.
Include the below lines od code within the Composer.json

{
"require-dev": {
"codeception/codeception": "*"
}
}


4. Now navigate to the MyFirstTest test folderand fire the below command.

composer install

You will notice a new folder called 'vendor' is added within our test folder.

5. Now to initialize our testing environment we need to install bootstrap.
Simply navigate to the path Codecept/vendor/bin and fire the below command.

codecept bootstrap

6. A new folder called tests should be added under bin folder after bootstrap installation.

7. Navigate to tests folder and you will see all unit,functional and acceptance folder has been created to define our tests.

Now we are ready to define our first acceptance test.

I have already discussed in my previous post. Please find it here.

0 comments:

Post a Comment

Powered by Blogger.