You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _docs/developer/testing/php_unit_tests.md
+3-22Lines changed: 3 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -8,32 +8,13 @@ To validate the unit behavior of the site code, we utilize
8
8
9
9
### Dependencies
10
10
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:
14
12
15
13
1. Install [Composer](https://getcomposer.org/download/) through the command-line installation copy-paste.
16
14
2.`cd` to `/usr/local/submitty/GIT_CHECKOUT/Submitty/site/`.
17
15
3. run `composer update`
18
16
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.*
37
18
38
19
### Running PHP Unit Tests
39
20
@@ -42,7 +23,7 @@ Before running PHP Unit Tests, you must install the required dependencies. You m
42
23
To run the PHP unit test suite locally, `cd` to `/usr/local/submitty/GIT_CHECKOUT/Submitty/site/` and type:
43
24
44
25
```
45
-
php vendor/bin/phpunit
26
+
sudo -u submitty_php php vendor/bin/phpunit
46
27
```
47
28
48
29
To run just an individual class or test, you can use the `--filter` flag on PHPUnit.
0 commit comments