Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

Unit Tests Guidelines

Fatima Rafiqui edited this page Aug 30, 2017 · 11 revisions

Software Testing is necessary to make the code bug free. Test Driven Development (TDD) is the best approach to make the code reliable and free of errors.

For this project, we have included the following testing strategies:

  • JavaScript Unit Testing (client-side)
  • PHP Unit Testing (server-side)

Jasmine-Karma: JavaScript Testing

Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks.

For testing your code against the JavaScript tests run the following command:

./node_modules/karma/bin/karma start jasmine.config.js --single-run

Reference Links to Installation and Getting Started:

PHPUnit: PHP Unit Testing

PHPUnit is a programmer-oriented testing framework for PHP. For mocking the object we are using Mockery, which is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit.

For testing your code against the PHP tests run the following command:

./vendor/bin/phpunit tests/phpUnitTests/

Reference Links to Installation and Getting Started: