Skip to content

Commit 2605a55

Browse files
p123-stackPratikshapratikshazalte69123kiran17transistive
authored
Unit-tests (#29)
* main branch * implemented the unit tests for authentication and objects * fixed the CI and Psalm * fixed the CI and Psalm show-infor errors * removed PersonUnitTest * implemented unit test * DEBUG * DEBUG * enabled the mocking of final classes in PHPUnit * enabled the mocking of final classes in PHPUnit * Debug * Debug * Removed the getters from resultCounters * updated the TransactionUnitTest * fixed integration test for resultcounters * fixed integration test * fixed integration test * updated tests * seperated all integration tests * removed all the final keyword * DEBUG * resolved changes according to comments * resolved changes * invalidbooktest is created * Added unit test for ResultRow * chore: remove invalid import * psalm info issues are fixed * Added unit test for ResultRow * Added unit test for ResultRow * Added final keyword * fixed broken test and added schema for phpunit.xml * updated README.md * Added final keyword to all neccesary classes * minor errors * propertynotsetinconstructor is removed * fixed all warnings * add coverage options * explicitly mark test folder in phpunit tests * remove coverage filter from phpunit xml * winp * Deprecations fixed * Deprecations fixed * added a new phunitCoverage.xml file for generating a code coverage report * added a new phunitCoverage.xml file for generating a code coverage report * removed phunit.cache file and xml-coverage folder --------- Co-authored-by: Pratiksha <pratiksha@Pratiksha-Nagels> Co-authored-by: pratikshazalte69 <[email protected]> Co-authored-by: Kiran Chandani <[email protected]> Co-authored-by: Ghlen Nagels <[email protected]>
1 parent f54a948 commit 2605a55

Some content is hidden

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

58 files changed

+3895
-551
lines changed

.github/workflows/psalm.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,15 @@ jobs:
2424
run: composer install --no-progress --prefer-dist
2525

2626
- name: Run Psalm
27-
run: vendor/bin/psalm --output-format=github
27+
run: vendor/bin/psalm --show-info=true --output-format=github
28+
29+
- name: Run Psalm
30+
id: psalm
31+
run: |
32+
# Run Psalm and use tee to print output and save it to psalm.log
33+
vendor/bin/psalm --no-cache --show-info=true --output-format=github | tee psalm.log || true
34+
# If any warnings are found, print a message and exit with a failure code
35+
if grep -q "warning" psalm.log; then
36+
echo "Warnings detected in Psalm output. Failing build."
37+
exit 1
38+
fi

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ jobs:
5151
NEO4J_ADDRESS: "http://localhost:7474"
5252
NEO4J_USERNAME: "neo4j"
5353
NEO4J_PASSWORD: "password"
54-
run: vendor/bin/phpunit --configuration phpunit.dist.xml
54+
run: vendor/bin/phpunit --configuration phpunit.dist.xml ./tests

.github/workflows/testaura.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ jobs:
4141
NEO4J_ADDRESS: ${{ secrets.NEO4J_ADDRESS }}
4242
NEO4J_USERNAME: ${{ secrets.NEO4J_USERNAME }}
4343
NEO4J_PASSWORD: ${{ secrets.NEO4J_PASSWORD }}
44-
run: vendor/bin/phpunit --configuration phpunit.dist.xml
44+
run: vendor/bin/phpunit --configuration phpunit.dist.xml ./tests

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ test
1313
#PHP-CS-FIXER
1414
.php-cs-fixer.php
1515
.php-cs-fixer.cache
16-
16+
.phpunit.cache
1717

1818
coverage
19-
19+
xml-coverage
2020
composer.lock

Dockerfile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
# Use an official PHP image as the base image
22
FROM php:8.1-cli
33

4-
# Install necessary extensions (e.g., for Composer)
5-
RUN apt-get update && apt-get install -y libpng-dev libjpeg-dev libfreetype6-dev git libzip-dev zip \
4+
RUN apt-get update && \
5+
apt-get install -y \
6+
libpng-dev \
7+
libjpeg-dev \
8+
libfreetype6-dev \
9+
git \
10+
libzip-dev \
11+
zip \
612
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
713
&& docker-php-ext-install gd zip
814

15+
RUN pecl install xdebug pcov && docker-php-ext-enable xdebug pcov
16+
17+
# Configure Xdebug for coverage
18+
# RUN echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
19+
920
# Set working directory
1021
WORKDIR /var/www
1122

12-
# Copy the composer.phar file to the container
1323
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

clover.xml

Lines changed: 529 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)