Skip to content

Commit

Permalink
Added full support for PHPUnit 10.x and created unit tests with mocks…
Browse files Browse the repository at this point in the history
… for services.
  • Loading branch information
TonyKaravasilev committed Apr 8, 2023
1 parent 3d15f7f commit 4fdcf56
Show file tree
Hide file tree
Showing 35 changed files with 4,908 additions and 1,633 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/cryptomanana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ jobs:
restore-keys: ${{ runner.os }}-composer-

- name: Project Installation
run: composer install --no-progress --no-interaction --prefer-dist
run: composer install --no-progress --no-interaction --prefer-dist ; cp phpunit.xml.dist phpunit.xml

- name: Test Suite Configuration
run: if [[ "${{ matrix.php }}" =~ ^(7.3|7.4|8.0|8.1|8.2)$ ]] ; then vendor/bin/phpunit --migrate-configuration; fi

- name: Running Tests
run: vendor/bin/phpunit --no-coverage
Expand Down Expand Up @@ -80,7 +83,10 @@ jobs:
update: true

- name: Project Installation
run: composer install --no-progress --no-interaction --prefer-dist
run: composer install --no-progress --no-interaction --prefer-dist ; cp phpunit.xml.dist phpunit.xml

- name: Test Suite Configuration
run: if ( ${{ matrix.php }} -ge 7.3 ) { vendor/bin/phpunit --migrate-configuration }

- name: Running Tests
run: vendor/bin/phpunit --no-coverage
Expand Down Expand Up @@ -109,7 +115,10 @@ jobs:
update: true

- name: Project Installation
run: composer install --no-progress --no-interaction --prefer-dist
run: composer install --no-progress --no-interaction --prefer-dist ; cp phpunit.xml.dist phpunit.xml

- name: Test Suite Configuration
run: if [[ "${{ matrix.php }}" =~ ^(7.3|7.4|8.0|8.1|8.2)$ ]] ; then vendor/bin/phpunit --migrate-configuration; fi

- name: Running Tests
run: vendor/bin/phpunit --no-coverage
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ composer

# PHPUnit Related Files and Folders
.phpunit.result.cache
.phpunit.cache/
tests/config.php
phpunit.phar
phpunit.xml
Expand Down
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@ jobs:
env:
- USE_OPCACHE=1
- php: 8.1
dist: jammy
dist: focal
env:
- USE_OPCACHE=1
- php: master
dist: jammy
env:
- USE_OPCACHE=1
# - php: 8.2 <---- months and no valid build is available (installation failure)
# dist: focal
# env:
# - USE_OPCACHE=1

cache:
timeout: 3600
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
CHANGELOG
=========

v1.1.1, 2023-04-08
------------------

- Moved existing tests for cryptographic services and utilities as a separate integration test suite;
- Added true unit tests for cryptographic services and utilities via PHPUnit mocks/stubs;
- Enabled the running of unit tests with PHPUnit 10.x under PHP 8.1 and 8.2;
- Updated the configuration of Travis CI and GitHub actions CI/CD workflow;
- Updated the phpDocumentor schema configuration file and its settings;
- Fixes a few small bugs/typos and updated some of the framework's tests;
- Generated an online DOI number via Zenodo and CERN integration;
- Purged the image caches for the GitHub repository;
- Release is signed with a GitHub GPG signature.

v1.1.0, 2022-12-23
------------------

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ psr: vendor/autoload.php

.PHONY: tests
tests: vendor/autoload.php
vendor/bin/phpunit --verbose --no-coverage
vendor/bin/phpunit --no-coverage

.PHONY: check-system
check-system:
Expand Down Expand Up @@ -42,7 +42,7 @@ download-new-phpdoc:
generate-docs:
@if [ -f ./phpdoc.phar ]; then\
rm -rf docs/ && mkdir docs;\
php -ddisplay_errors=0 -dopcache.enable_cli=0 phpdoc.phar;\
php -ddisplay_errors=0 -dopcache.enable_cli=0 phpdoc.phar --sourcecode;\
if grep -i -q "No errors have been found" ./docs/api/reports/errors.html; then\
echo 'PHPDoc Inspection: 100%';\
else \
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
"ext-mbstring": "*",
"ext-reflection": "*",
"squizlabs/php_codesniffer": "^3.3",
"phpunit/phpunit": "^9 || ^8 || ^7 || ^6 || ^5.7 || ^4.8"
"phpunit/phpunit": "^10 || ^9 || ^8 || ^7 || ^6 || ^5.7 || ^4.8"
},
"suggest": {
"ext-mbstring": "Use only for multi-byte string encodings support and implementations.",
Expand Down Expand Up @@ -277,10 +277,10 @@
"install-phar": "php composer.phar install --profile -vv",
"autoload-dev": "composer dump-autoload --profile -vv",
"autoload-phar": "php composer.phar dump-autoload --profile -vv",
"execute-tests": "vendor/bin/phpunit --verbose --testdox --no-coverage",
"execute-tests-phar": "php phpunit.phar --verbose --testdox --no-coverage",
"scan-coverage": "vendor/bin/phpunit --coverage-text --verbose --stop-on-failure",
"scan-coverage-phar": "php phpunit.phar --coverage-text --verbose --stop-on-failure",
"execute-tests": "vendor/bin/phpunit --testdox --no-coverage",
"execute-tests-phar": "php phpunit.phar --testdox --no-coverage",
"scan-coverage": "vendor/bin/phpunit --coverage-text --stop-on-failure",
"scan-coverage-phar": "php phpunit.phar --coverage-text --stop-on-failure",
"export-testdox": "vendor/bin/phpunit --no-coverage --testdox-html coverage/agile.html",
"export-testdox-phar": "php phpunit.phar --no-coverage --testdox-html coverage/agile.html",
"export-coverage": "vendor/bin/phpunit --coverage-html coverage/report/",
Expand All @@ -297,7 +297,7 @@
"check-psr-phar": "php phpcs.phar",
"fix-psr": "vendor/bin/phpcbf",
"fix-psr-phar": "php phpcbf.phar",
"export-docs-phar": "php -ddisplay_errors=0 phpdoc.phar"
"export-docs-phar": "php -ddisplay_errors=0 -dopcache.enable_cli=0 phpdoc.phar --sourcecode"
},
"extra": {
"branch-alias": {
Expand Down
2 changes: 1 addition & 1 deletion phpdoc.dist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<phpdoc>

<!-- Project ruleset description: -->
<title>PHPDoc scanning for the CryptoManana Framework.</title>
<title>Technical API Documentation for the CryptoManana Framework</title>

<!-- Code scanning options: -->
<parser>
Expand Down
5 changes: 4 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@
</php>

<!-- Test suite name and location: -->
<testsuite name="CryptoManana - Unit Test Suite">
<testsuite name="CryptoManana - Test Suite">
<!-- Unit Tests -->
<directory suffix="Test.php">./tests/CryptoManana/Tests/TestSuite/</directory>
<!-- Integration Tests -->
<directory suffix="Test.php">./tests/CryptoManana/Tests/IntegrationSuite/</directory>
</testsuite>

<!-- Include directory paths for scanning: -->
Expand Down
Loading

0 comments on commit 4fdcf56

Please sign in to comment.