Skip to content

Commit 443077e

Browse files
committed
Shortened instructions to reflect Alex's changes
1 parent 85b3ef3 commit 443077e

File tree

1 file changed

+3
-22
lines changed

1 file changed

+3
-22
lines changed

_docs/developer/testing/php_unit_tests.md

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,13 @@ To validate the unit behavior of the site code, we utilize
88

99
### Dependencies
1010

11-
Before running PHP Unit Tests, you must install the required dependencies. You may either run your tests locally or inside the VM:
12-
13-
##### Inside the Vagrant VM
11+
Before running PHP Unit Tests, you must install the required dependencies:
1412

1513
1. Install [Composer](https://getcomposer.org/download/) through the command-line installation copy-paste.
1614
2. `cd` to `/usr/local/submitty/GIT_CHECKOUT/Submitty/site/`.
1715
3. run `composer update`
1816

19-
*Please be aware that many unit tests will not work inside the VM. It is suggested that you run tests individually.*
20-
21-
##### On Mac
22-
23-
1. Install [Composer](https://getcomposer.org/download/) using brew.
24-
2. `cd` to your `Submitty/site/` folder.
25-
3. run `composer install`
26-
27-
##### On Windows (Not Suggested)
28-
29-
1. Navigate to your php folder, and open the php configuration settings file.
30-
2. Ctrl-F and uncomment the line labelled `extension=fileinfo` (remove the semi-colon). Do the same for the line labelled `extension=sodium`.
31-
3. Install [Composer](https://getcomposer.org/download/), click the link labelled Composer-Setup.exe.
32-
4. Restart your terminal.
33-
5. `cd` to your `Submitty/site/` folder.
34-
6. Run `composer update`. If you are getting timeout errors, try using a VPN.
35-
36-
*This is not a good way to run unit tests because many file paths will be broken. Like with the vagrant VM, it is suggested that you run tests individually.*
17+
*If tests are failing on main, you may need to run `apt install php-sqlite3`, especially if you haven't vagrant upped from scratch in a while.*
3718

3819
### Running PHP Unit Tests
3920

@@ -42,7 +23,7 @@ Before running PHP Unit Tests, you must install the required dependencies. You m
4223
To run the PHP unit test suite locally, `cd` to `/usr/local/submitty/GIT_CHECKOUT/Submitty/site/` and type:
4324

4425
```
45-
php vendor/bin/phpunit
26+
sudo -u submitty_php php vendor/bin/phpunit
4627
```
4728

4829
To run just an individual class or test, you can use the `--filter` flag on PHPUnit.

0 commit comments

Comments
 (0)