Skip to content

Commit 1b5f6c3

Browse files
PratikshaPratiksha
authored andcommitted
Merge remote-tracking branch 'origin/main' into configuration-injection-factory-method
2 parents 0e61cff + 1065e8d commit 1b5f6c3

39 files changed

+823
-7462
lines changed

.github/workflows/cs-fixer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
19-
php-version: 8.2
19+
php-version: 8.1
2020
tools: composer
2121

2222
- name: Install dependencies

.github/workflows/psalm.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ jobs:
99
name: Run Psalm
1010
runs-on: ubuntu-latest
1111

12+
1213
steps:
1314
- name: Checkout code
1415
uses: actions/checkout@v3
1516

1617
- name: Set up PHP
1718
uses: shivammathur/setup-php@v2
1819
with:
19-
php-version: 8.3
20+
php-version: 8.1
2021
tools: composer, psalm
2122

2223
- name: Install dependencies

.github/workflows/test.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,30 @@ concurrency:
1010

1111
jobs:
1212
tests:
13+
services:
14+
neo4j:
15+
image: neo4j:latest
16+
ports:
17+
- 7474:7474
18+
- 7687:7687
19+
env:
20+
NEO4J_AUTH: neo4j/password
21+
options: >-
22+
--health-cmd "wget --no-verbose --tries=1 --spider localhost:7474 || exit 1"
23+
--health-interval 10s
24+
--health-retries 5
25+
--health-timeout 5s
26+
1327
name: Run PHPUnit Tests
1428
runs-on: ubuntu-latest
15-
1629
steps:
1730
- name: Checkout code
1831
uses: actions/checkout@v3
1932

2033
- name: Set up PHP
2134
uses: shivammathur/setup-php@v2
2235
with:
23-
php-version: 8.2
36+
php-version: 8.1
2437
tools: composer, xdebug
2538

2639
- name: Cache Composer dependencies
@@ -35,7 +48,7 @@ jobs:
3548

3649
- name: Run Tests without phpunit.xml
3750
env:
38-
NEO4J_ADDRESS: ${{ secrets.NEO4J_ADDRESS }}
39-
NEO4J_USERNAME: ${{ secrets.NEO4J_USERNAME }}
40-
NEO4J_PASSWORD: ${{ secrets.NEO4J_PASSWORD }}
51+
NEO4J_ADDRESS: "http://localhost:7474"
52+
NEO4J_USERNAME: "neo4j"
53+
NEO4J_PASSWORD: "password"
4154
run: vendor/bin/phpunit --configuration phpunit.dist.xml

.github/workflows/testaura.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Test Neo4j Aura
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch: # Allows manual trigger
8+
9+
concurrency:
10+
group: neo4j-aura-test-main
11+
cancel-in-progress: true
12+
13+
jobs:
14+
tests-aura:
15+
name: Run PHPUnit Tests with Neo4j Aura
16+
runs-on: ubuntu-latest
17+
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v3
22+
23+
- name: Set up PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: 8.1
27+
tools: composer, xdebug
28+
29+
- name: Cache Composer dependencies
30+
uses: actions/cache@v3
31+
with:
32+
path: vendor
33+
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
34+
restore-keys: ${{ runner.os }}-composer-
35+
36+
- name: Install dependencies
37+
run: composer install --no-progress --prefer-dist
38+
39+
- name: Run Tests
40+
env:
41+
NEO4J_ADDRESS: ${{ secrets.NEO4J_ADDRESS }}
42+
NEO4J_USERNAME: ${{ secrets.NEO4J_USERNAME }}
43+
NEO4J_PASSWORD: ${{ secrets.NEO4J_PASSWORD }}
44+
run: vendor/bin/phpunit --configuration phpunit.dist.xml

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ test
1313
#PHP-CS-FIXER
1414
.php-cs-fixer.php
1515
.php-cs-fixer.cache
16+
17+
18+
coverage
19+
20+
composer.lock

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Use an official PHP image as the base image
2+
FROM php:8.1-cli
3+
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 \
6+
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
7+
&& docker-php-ext-install gd zip
8+
9+
# Set working directory
10+
WORKDIR /var/www
11+
12+
# Copy the composer.phar file to the container
13+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

composer.json

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@
33
"name": "neo4j-php/query-api",
44
"description": "Easy to use class to run Cypher queries on the Query API",
55
"require": {
6-
"guzzlehttp/guzzle": "^7.9",
76
"psr/http-client": "^1.0",
87
"ext-json": "*",
98
"php": "^8.1",
10-
"nyholm/psr7": "^1.8"
9+
"nyholm/psr7": "^1.8",
10+
"php-http/discovery": "^1.17"
1111
},
1212
"require-dev": {
13-
"phpunit/phpunit": "^11.0",
13+
"guzzlehttp/guzzle": "^7.9",
14+
"phpunit/phpunit": "^10.0",
1415
"friendsofphp/php-cs-fixer": "^3.68",
15-
"vimeo/psalm": "^6.5"
16-
16+
"vimeo/psalm": "^6.8",
17+
"dg/bypass-finals": "^1.9",
18+
"psalm/plugin-phpunit": "^0.19.2"
1719
},
20+
1821
"autoload": {
1922
"psr-4": {
2023
"Neo4j\\QueryAPI\\": "src/"
@@ -28,7 +31,15 @@
2831
"authors": [
2932
{
3033
"name": "p123-stack",
31-
"email": "[email protected]"
34+
"email": "[email protected]"
35+
},
36+
{
37+
"name": "123kiran17",
38+
"email": "[email protected]"
39+
},
40+
{
41+
"name": "Ghlen Nagels",
42+
"email": "[email protected]"
3243
}
3344
],
3445
"config": {
@@ -40,7 +51,7 @@
4051
"scripts": {
4152
"cs": "vendor/bin/php-cs-fixer fix --dry-run --diff --allow-risky=yes",
4253
"cs:fix": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
43-
"psalm": "vendor/bin/psalm"
54+
"psalm": "vendor/bin/psalm --no-cache --show-info=true"
4455
}
4556

4657
}

0 commit comments

Comments
 (0)