Skip to content

Commit

Permalink
Merge pull request #116 from sugarcrm/unit-tests
Browse files Browse the repository at this point in the history
Update the way we run our unit tests
  • Loading branch information
mmarum-sugarcrm authored Oct 18, 2018
2 parents 0538bbb + ac4c3f1 commit bd70fbc
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 66 deletions.
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ Currently, we have PHPUnit tests and Postman tests.
#### PHPUnit tests for the Professor M Module Loadable Package
[PHPUnit](https://phpunit.de/) is a testing framework for PHP. The PHPUnit test files are located in
[package/src/custom/tests/School/unit-php](package/src/custom/tests/School/unit-php).
[package/src/custom/tests/unit-php/School](package/src/custom/tests/unit-php/School).
##### Manual execution
Expand Down Expand Up @@ -698,7 +698,7 @@ for instructions on setting up a development environment.
You will also need to get a copy of the Sugar provided unit tests and put them in your Sugar source code directory. See
the [SugarCRM unit tests GitHub repo](https://github.com/sugarcrm/unit-tests) for more information.
Prepare to run the Sugar provided PHPUnit tests by executing the following commands:
Prepare to run the Sugar provided PHPUnit tests and the Professor M PHPUnit tests by executing the following commands:
```
$ cd /path/to/sugar_source_dir
$ composer install
Expand All @@ -717,17 +717,10 @@ Install the **standard** version of the Professor M Module Loadable Package usin
if you have not already done so. The code for
Professor M and the associated tests will be installed in to the Sugar source directory.
Prepare to run the Professor M PHPUnit tests by executing the following commands:
```
$ cd /path/to/sugar_source_dir
$ cd custom/tests/School/unit-php
$ chmod +x ../../../../vendor/bin/phpunit
```
Run the Professor M PHPUnit tests by executing the following command from the `/custom/tests/School/unit-php` directory:
Run the Professor M PHPUnit tests by executing the following command from the `tests/unit-php` directory:
```
$ ../../../../vendor/bin/phpunit
$ ../../vendor/bin/phpunit --testsuite custom
```
##### Automatic execution in Travis CI
Expand Down
53 changes: 0 additions & 53 deletions package/src/custom/tests/School/unit-php/phpunit.xml.dist

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/RunProfMPHPUnitTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
######################################################################

# Change to the directory where the Sugar PHPUnit tests are stored and update permissions
docker exec sugar-web1 bash -c "cd custom/tests/School/unit-php && chmod +x ../../../../vendor/bin/phpunit"
docker exec sugar-web1 bash -c "cd tests/unit-php/ && chmod +x ../../vendor/bin/phpunit"

######################################################################
# Run the Professor M PHPUnit tests
######################################################################

echo "Running the PHPUnit tests for the Professor M Module Loadable Package..."
docker exec sugar-web1 bash -c "cd custom/tests/School/unit-php && ../../../../vendor/bin/phpunit"
docker exec sugar-web1 bash -c "cd tests/unit-php && ../../vendor/bin/phpunit --testsuite custom"

0 comments on commit bd70fbc

Please sign in to comment.