Skip to content

Commit ea62ffc

Browse files
committed
Merge branch 'main' into patch-6
2 parents 3d41d58 + c0b7e1e commit ea62ffc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+3291
-679
lines changed

.github/workflows/functional.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: docker-compose-phpunit-functional
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
docker-compose-phpunit-functional:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
submodules: true
15+
- name: setup PHP
16+
uses: shivammathur/setup-php@v2
17+
with:
18+
php-version: "8.3"
19+
tools: composer
20+
- name: install composer dependencies
21+
run: composer update
22+
- name: Run docker compose
23+
uses: hoverkraft-tech/[email protected]
24+
with:
25+
compose-file: "./tools/docker-dev/docker-compose.yml"
26+
- name: Execute tests in the running services
27+
run: docker compose -f ./tools/docker-dev/docker-compose.yml exec -w '/var/www/unity-web-portal' web ./vendor/bin/phpunit --testsuite=functional

.github/workflows/lint.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/phpunit.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: phpunit
2+
3+
on: [push]
4+
5+
jobs:
6+
phpunit:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
with:
11+
submodules: true
12+
- name: setup PHP
13+
uses: shivammathur/setup-php@v2
14+
with:
15+
php-version: "8.3"
16+
# php extensions also listed in tools/docker-dev/web/Dockerfile and README.md
17+
extensions: curl,mysql,ldap,pdo,redis,intl
18+
tools: composer:v2
19+
- name: Install dependencies
20+
run: composer install --prefer-dist --no-progress
21+
- name: Run PHPUnit tests
22+
run: vendor/bin/phpunit --colors=always --testsuite unit

.github/workflows/pre-commit.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
submodules: true
15+
- uses: actions/setup-python@v3
16+
- name: setup PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: "8.3"
20+
tools: composer, phpcs, phpcbf
21+
- uses: pre-commit/[email protected]

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ composer.lock
1616
deployment/*
1717
!deployment/**/README.md
1818
!deployment/deploy.sh
19+
20+
.phpunit.result.cache

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "hakasapl/phpopenldaper"]
2+
path = resources/lib/phpopenldaper
3+
url = https://github.com/hakasapl/phpopenldaper.git

.pre-commit-config.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# intentionally malformed files
2+
# pre-commit automatically excludes submodules
3+
exclude: |
4+
(?x)^(
5+
test/.*|
6+
)$
7+
8+
repos:
9+
# auto formatters (no work required) #############################################################
10+
# - repo: https://github.com/pre-commit/pre-commit-hooks
11+
# rev: v5.0.0
12+
# hooks:
13+
# - id: trailing-whitespace
14+
# - id: end-of-file-fixer
15+
- repo: local
16+
hooks:
17+
- id: phpcbf
18+
name: PHP Code Beautifier and Fixer
19+
entry: phpcbf
20+
language: system
21+
files: \.php$
22+
args: [--standard=PSR2, --colors]
23+
24+
# linters (work required) ########################################################################
25+
# - repo: https://github.com/pre-commit/pre-commit-hooks
26+
# rev: v5.0.0
27+
# hooks:
28+
# - id: check-yaml
29+
# - id: check-json
30+
# - id: check-xml
31+
# - id: check-added-large-files
32+
# - id: check-executables-have-shebangs
33+
# - repo: https://github.com/gitleaks/gitleaks
34+
# rev: v8.23.1
35+
# hooks:
36+
# - id: gitleaks
37+
- repo: local
38+
hooks:
39+
- id: phpcs
40+
name: PHP CodeSniffer
41+
entry: phpcs
42+
language: system
43+
files: \.php$
44+
args: [--standard=PSR2, --colors]
45+
- id: php-l
46+
name: php -l
47+
entry: php
48+
language: system
49+
files: \.php$
50+
args: [-l]
51+
- id: assert-no-die-exit
52+
name: Assert no die()/exit()
53+
entry: ./test/assert-no-die-exit.bash
54+
language: system
55+
files: \.php$
56+
exclude: resources/lib/UnitySite\.php$

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ The following users are available for testing:
5151

5252
### Changes to Dev Environment
5353

54-
Should the default schema of the web portal change, the `ldap/bootstrap.ldif` and `sql/bootstrap.sql` must be updated for the LDAP server and the MySQL server, respectively.
54+
Should the default schema of the web portal change, the `ldap/bootstrap.ldif` and `sql/bootstrap.sql` must be updated for the LDAP server and the MySQL server, respectively.

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,19 @@ Unity Web Portal is a PHP application built in top of MariaDB and LDAP which act
2121
1. Some HTTP Authentication mechanism (such as Shibboleth SP)
2222
1. Composer (`apt install composer` on Ubuntu)
2323
1. PHP Extensions
24+
1. `php-cli`
25+
1. `php-curl`
26+
1. `php-intl`
2427
1. `php-ldap`
25-
2. `php-curl`
26-
3. `php-redis`
27-
4. `php-cli`
28-
5. `php-mysql`
29-
6. `php-pdo`
28+
1. `php-mbstring`
29+
1. `php-mysql`
30+
1. `php-pdo`
31+
1. `php-redis`
32+
1. `php-xml`
3033
2. Composer packages
3134
1. `cd` to this repository
32-
2. Install packages `composer update`
35+
1. Setup git submodules `git submodule update --init --checkout`
36+
1. Install packages `composer update`
3337
3. Setup config file `config/config.ini` according to your site deployment
3438
4. Setup branding file `config/branding/config.ini` according to your site deployment
3539
5. Point your web server's document root to `webroot` in this repo

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{
22
"require": {
33
"psr/log": "1.1.4",
4-
"phpseclib/phpseclib": "3.0.16",
5-
"phpmailer/phpmailer": "6.6.4",
6-
"hakasapl/phpopenldaper": "1.0.5"
4+
"phpseclib/phpseclib": "3.0.43",
5+
"phpmailer/phpmailer": "6.6.4"
6+
},
7+
"require-dev": {
8+
"phpunit/phpunit": "<12.1"
79
}
810
}

0 commit comments

Comments
 (0)