Skip to content

Commit 4e28b39

Browse files
Merge pull request #74 from neo4j-php/improve-testing-coverage
Improve testing coverage
2 parents abf28b6 + 075a105 commit 4e28b39

File tree

318 files changed

+8736
-8358
lines changed

Some content is hidden

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

318 files changed

+8736
-8358
lines changed

.github/workflows/analyse.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: analyse
22

33
on:
44
push:
5+
branches: [ 'main' ]
56
pull_request:
67
workflow_dispatch:
78

.github/workflows/lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: lint
22

33
on:
44
push:
5+
branches: [ 'main' ]
56
pull_request:
67
workflow_dispatch:
78

.github/workflows/test.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: test
22

33
on:
44
push:
5+
branches: ['main']
56
pull_request:
67
workflow_dispatch:
78

@@ -18,7 +19,7 @@ jobs:
1819
env:
1920
COMPOSER_VERSION: 2
2021
COVERAGE_DRIVER: xdebug
21-
MINIMUM_COVERAGE_PERCENTAGE: 80
22+
MINIMUM_COVERAGE_PERCENTAGE: 90
2223
MINIMUM_MSI_PERCENTAGE: 80
2324

2425
steps:
@@ -42,6 +43,9 @@ jobs:
4243
- name: Check coverage
4344
run: php vendor/bin/coverage-check coverage/clover.xml ${{ env.MINIMUM_COVERAGE_PERCENTAGE }}
4445

46+
- name: Run end-to-end tests
47+
run: php vendor/bin/phpunit --testsuite end-to-end --no-coverage
48+
4549
- name: Run mutation tests
4650
run: XDEBUG_MODE=coverage php vendor/bin/infection --show-mutations --min-msi=${{ env.MINIMUM_MSI_PERCENTAGE }} --threads=4
4751

@@ -60,8 +64,7 @@ jobs:
6064
neo4j:
6165
image: neo4j:${{ matrix.neo4j-version }}
6266
env:
63-
NEO4J_AUTH: neo4j/test
64-
NEO4JLABS_PLUGINS: '["apoc"]'
67+
NEO4J_AUTH: none
6568
ports:
6669
- 7687:7687
6770
- 7474:7474
@@ -75,7 +78,6 @@ jobs:
7578
env:
7679
COMPOSER_VERSION: 2
7780
COVERAGE_DRIVER: none
78-
NEO4J_CONNECTIONS: bolt://neo4j:test@localhost,http://neo4j:test@localhost
7981

8082
steps:
8183
- name: Checkout repository

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.DS_Store
22
composer.lock
33
coverage/
4+
doxygen/
45
phpunit.xml
56
vendor/
67
*.idea
78
.phpunit.result.cache
89
.php-cs-fixer.cache
9-
coverage/

.php-cs-fixer.dist.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
$finder = Finder::create()
2323
->files()
2424
->in(__DIR__ . '/src')
25-
->in(__DIR__ . '/tests/Unit')
26-
->in(__DIR__ . '/tests/Integration')
25+
->in(__DIR__ . '/tests/unit')
26+
->in(__DIR__ . '/tests/integration')
27+
->in(__DIR__ . '/tests/end-to-end')
2728
->name('*.php');
2829

2930
$config = new Config();

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Changelog
2+
3+
All notable changes to the php-cypher-dsl project will be documented in this file. A changelog has been kept from version 5.0.0 onwards.
4+
5+
The format is based on [Keep a Changelog], and this project adheres to
6+
[Semantic Versioning].
7+
8+
## 5.0.0 - To be determined
9+
10+
### Added
11+
12+
- Add a blank changelog.
13+
14+
[keep a changelog]: https://keepachangelog.com/en/1.0.0/
15+
[semantic versioning]: https://semver.org/spec/v2.0.0.html

LIFECYCLE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Version lifecycle
2+
3+
Since php-cypher-dsl version 5.0.0, support is governed by this version lifecycle.
4+
5+
**Bugfix support** means that issues will be fixed for a version of php-cypher-dsl. Bugfix support for every major release `X` ends **six months** after the release of the next major version (`X+1`). Bugfix support for minor release `X.Y` will end with the release of the next minor version (`X.(Y+1)`).
6+
7+
It is strongly recommended to use a version of php-cypher-dsl that has active bugfix support. Versions that are no longer receiving bugfix support will not receive any security or bug fixes. They may contain known critical vulnerabilities and other major bugs, including the threat of possible data loss and/or corruption.
8+
9+
## Supported versions
10+
11+
| Major version | PHP version | Initial release | End of bugfix support |
12+
|------------------|-------------|------------------|-----------------------|
13+
| php-cypher-dsl 5 | >=7.4 | To be determined | To be determined |

phpstan.neon.dist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
parameters:
22
paths:
33
- src
4-
level: 7
4+
level: 7
5+
treatPhpDocTypesAsCertain: false

phpunit.xml.dist

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,25 @@
66
>
77
<testsuites>
88
<testsuite name="unit">
9-
<directory>tests/Unit</directory>
9+
<directory>tests/unit</directory>
10+
</testsuite>
11+
<testsuite name="end-to-end">
12+
<directory>tests/end-to-end</directory>
1013
</testsuite>
1114
<testsuite name="integration">
12-
<directory>tests/Integration</directory>
15+
<directory>tests/integration</directory>
1316
</testsuite>
1417
</testsuites>
1518
<coverage processUncoveredFiles="true" cacheDirectory="coverage/cache" pathCoverage="true">
1619
<report>
1720
<clover outputFile="coverage/clover.xml" />
21+
<html outputDirectory="coverage/" />
1822
</report>
1923
<include>
2024
<directory suffix=".php">src</directory>
2125
</include>
26+
<exclude>
27+
<file>src/functions.php</file>
28+
</exclude>
2229
</coverage>
2330
</phpunit>

src/Clauses/CallClause.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* This file is part of php-cypher-dsl.
44
*
5-
* Copyright (C) 2021- Wikibase Solutions
5+
* Copyright (C) Wikibase Solutions
66
*
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
@@ -30,7 +30,7 @@ final class CallClause extends Clause
3030
use ErrorTrait;
3131

3232
/**
33-
* @var Query|null The subquery to call, or NULL if no subquery has been set yet
33+
* @var null|Query The sub-query to call, or NULL if no sub-query has been set yet
3434
*/
3535
private ?Query $subQuery = null;
3636

@@ -40,9 +40,10 @@ final class CallClause extends Clause
4040
private array $withVariables = [];
4141

4242
/**
43-
* Sets the query to call. This overwrites any previously set subquery.
43+
* Sets the query to call. This overwrites any previously set sub-query.
44+
*
45+
* @param Query $subQuery The sub-query to call
4446
*
45-
* @param Query $subQuery The subquery to call
4647
* @return $this
4748
*/
4849
public function withSubQuery(Query $subQuery): self
@@ -55,7 +56,8 @@ public function withSubQuery(Query $subQuery): self
5556
/**
5657
* Add one or more variables to include in the WITH clause.
5758
*
58-
* @param Variable|Pattern|string ...$variables
59+
* @param Pattern|string|Variable ...$variables
60+
*
5961
* @return $this
6062
*
6163
* @see https://neo4j.com/docs/cypher-manual/current/clauses/call-subquery/#subquery-correlated-importing
@@ -76,8 +78,6 @@ public function addWithVariable(...$variables): self
7678
/**
7779
* Returns the query that is being called. This query does not include the WITH clause that is inserted
7880
* if there are any correlated variables.
79-
*
80-
* @return Query|null
8181
*/
8282
public function getSubQuery(): ?Query
8383
{

0 commit comments

Comments
 (0)