File tree Expand file tree Collapse file tree 6 files changed +126
-16
lines changed Expand file tree Collapse file tree 6 files changed +126
-16
lines changed Original file line number Diff line number Diff line change 9
9
name : Run Psalm
10
10
runs-on : ubuntu-latest
11
11
12
+
12
13
steps :
13
14
- name : Checkout code
14
15
uses : actions/checkout@v3
Original file line number Diff line number Diff line change @@ -10,9 +10,22 @@ concurrency:
10
10
11
11
jobs :
12
12
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
+
13
27
name : Run PHPUnit Tests
14
28
runs-on : ubuntu-latest
15
-
16
29
steps :
17
30
- name : Checkout code
18
31
uses : actions/checkout@v3
35
48
36
49
- name : Run Tests without phpunit.xml
37
50
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 "
41
54
run : vendor/bin/phpunit --configuration phpunit.dist.xml
Original file line number Diff line number Diff line change
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.2
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
Original file line number Diff line number Diff line change
1
+ # Use an official PHP image as the base image
2
+ FROM php:8.2-fpm
3
+
4
+ # Install necessary extensions (e.g., for Composer)
5
+ RUN apt-get update && apt-get install -y libpng-dev libjpeg-dev libfreetype6-dev \
6
+ && docker-php-ext-configure gd --with-freetype --with-jpeg \
7
+ && docker-php-ext-install gd
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
14
+
15
+ # Expose PHP-FPM port
16
+ EXPOSE 9000
17
+
18
+ # Start PHP-FPM server
19
+ CMD ["php-fpm" ]
Original file line number Diff line number Diff line change
1
+ version : ' 3.8'
2
+
3
+ services :
4
+ # PHP Service
5
+ app :
6
+ build :
7
+ context : .
8
+ dockerfile : Dockerfile
9
+ container_name : php-app
10
+ working_dir : /var/www
11
+ volumes :
12
+ - .:/var/www
13
+ networks :
14
+ - mynetwork
15
+ ports :
16
+ - " 9000:9000" # Exposing port for PHP-FPM
17
+
18
+ # Composer Service
19
+ composer :
20
+ image : composer:latest
21
+ container_name : composer
22
+ volumes :
23
+ - .:/var/www
24
+ working_dir : /var/www
25
+ networks :
26
+ - mynetwork
27
+ command : ["install", "--no-progress", "--prefer-dist"]
28
+
29
+ # Neo4j Service (Optional, if you need Neo4j)
30
+ neo4j :
31
+ image : neo4j:latest
32
+ container_name : neo4j
33
+ environment :
34
+ - NEO4J_AUTH=neo4j/password
35
+ ports :
36
+ - " 7474:7474" # Web interface
37
+ - " 7687:7687" # Bolt protocol
38
+ networks :
39
+ - mynetwork
40
+
41
+ # Define a network for communication between containers
42
+ networks :
43
+ mynetwork :
44
+ driver : bridge
Original file line number Diff line number Diff line change @@ -393,18 +393,7 @@ public function testInvalidQueryException(): void
393
393
}
394
394
}
395
395
396
- public function testCreateDuplicateConstraintException (): void
397
- {
398
- try {
399
- $ this ->api ->run ('CREATE CONSTRAINT person_name FOR (n:Person1) REQUIRE n.name IS UNIQUE ' , []);
400
- $ this ->fail ('Expected a Neo4jException to be thrown. ' );
401
- } catch (Neo4jException $ e ) {
402
- // $errorMessages = $e->getErrorType() . $e->errorSubType() . $e->errorName();
403
- $ this ->assertInstanceOf (Neo4jException::class, $ e );
404
- $ this ->assertEquals ('Neo.ClientError.Schema.EquivalentSchemaRuleAlreadyExists ' , $ e ->getErrorCode ());
405
- $ this ->assertNotEmpty ($ e ->getMessage ());
406
- }
407
- }
396
+
408
397
409
398
public function testWithExactNames (): void
410
399
{
You can’t perform that action at this time.
0 commit comments