Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 1.41 KB

readme.md

File metadata and controls

34 lines (22 loc) · 1.41 KB

Unit tests

lxHive supports testing with PHPUnit. PHPunit is included as a require-dev dependency. A phpunit.xml file is setup in the project root folder of your lxHive app.

Structure

The tests directory contains two sub-directories directories:

namespace folder notes
\Tests\Unit ./Unit/* Assorted Unit tests, tests for issues, feature tests etc
\Tests\API ./src/xAPI/* Mirrors the app code's \API namespace and folder structure
\Tests\Integration ./Integration/* Integration tests, most notably for testing (mock) requests and request validation

Test files have to follow the *Test.php suffix pattern, i.e. FoobarTest.php

An ExampleTest.php file is provided in the Unit test directory.

Installation

Some tests may require a http-like connection x to your LRS, including basic authentication and xAPI headers.

  • Copy Config.template.php to Config.php
  • Update Config::$lrs with your lrs data including valid authentication

Usage

./vendor/bin/phpunit

For more information and available command line options see the PHPUnit documentation