Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .github/workflows/ci-mysql.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/ci-pgsql.yml

This file was deleted.

108 changes: 0 additions & 108 deletions .github/workflows/main.yml

This file was deleted.

21 changes: 11 additions & 10 deletions .github/workflows/ci-mssql.yml → .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
---

name: 🧪 Tests

on: # yamllint disable-line rule:truthy
pull_request:
push:
branches:
- 1.x
pull_request: null

name: MSSQL

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

permissions:
contents: read

jobs:
phpunit:
uses: cycle/gh-actions/.github/workflows/db-mssql.yml@master
testo:
name: Testo
uses: cycle/gh-actions/.github/workflows/testo.yml@master
with:
php: '["8.2","8.3","8.4","8.5"]'
stability: '["prefer-lowest","prefer-stable"]'
coverage: true
secrets: inherit

...
22 changes: 12 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,25 @@ Please make sure that the following requirements are satisfied before submitting
> Use our discord server to check for the advice or suggestion https://discord.gg/FZ9BCWg

## Testing Cycle ORM Entity Behavior
To test Cycle ORM Entity Behavior locally, download the `cycle/entity-behavior` repository and start docker containers inside the tests folder:
Tests run on [Testo](https://github.com/php-testo/testo) through the `cycle/testing` harness: `tests/Unit` needs no
database, `tests/Feature` runs once per database driver.
Reproductions of reported issues go to `tests/Regression/Issue<N>/`; `composer test:new-case -- <N>` writes a runnable
case there to start from.

```bash
$ cd tests/
$ docker-composer up
```

To run full test suite:
Unit and SQLite tests need no docker:

```bash
$ ./vendor/bin/phpunit
composer test:unit
composer test:sqlite
```

To run quick test suite:
The other drivers run against the shared test databases:

```bash
$ ./vendor/bin/phpunit --group driver-sqlite
composer db:up # or: composer db:up -- mysql
composer test # every suite; drivers whose server is down are skipped
composer test:mysql # also test:postgres, test:sqlserver
composer db:down
```

## Help Needed In
Expand Down
26 changes: 22 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@
"bamarni/composer-bin-plugin": "^1.8",
"buggregator/trap": "^1.20",
"cycle/annotated": "^4.6",
"cycle/testing": "^0.1.1",
"llm/skills": "^1.20",
"phpunit/phpunit": "^11.5",
"ramsey/uuid": "^4.9",
"roxblnfk/unpoly": "^1.8",
"spiral/tokenizer": "^3.18"
"spiral/tokenizer": "^3.18",
"testo/testo": "^0.10.60"
},
"autoload": {
"psr-4": {
Expand All @@ -60,9 +61,15 @@
},
"autoload-dev": {
"psr-4": {
"Cycle\\ORM\\Entity\\Behavior\\Tests\\": "tests/Behavior"
"Cycle\\ORM\\Entity\\Behavior\\Tests\\": "tests/"
}
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/cycle/testing"
}
],
"config": {
"sort-packages": true,
"allow-plugins": {
Expand All @@ -75,10 +82,21 @@
"scripts": {
"cs:diff": "php-cs-fixer fix --dry-run -v --diff --config=vendor-bin/code-style/.php-cs-fixer.dist.php",
"cs:fix": "php-cs-fixer fix -v --config=vendor-bin/code-style/.php-cs-fixer.dist.php",
"db:down": "docker compose -f vendor/cycle/testing/resources/docker/compose.yaml down -v",
"db:up": "docker compose -f vendor/cycle/testing/resources/docker/compose.yaml up -d --wait",
"psalm": "psalm -c vendor-bin/psalm/psalm.xml",
"psalm:baseline": "psalm -c vendor-bin/psalm/psalm.xml --set-baseline=vendor-bin/psalm/psalm-baseline.xml",
"psalm:ci": "psalm -c vendor-bin/psalm/psalm.xml --output-format=github --shepherd --show-info=false --stats --threads=4",
"test": "phpunit --color=always"
"test": "testo",
"test:mysql": "testo --suite=Feature/MySQL --suite=Regression/MySQL",
"test:new-case": "cycle-testing new-case --template=orm-behaviors",
"test:postgres": "testo --suite=Feature/Postgres --suite=Regression/Postgres",
"test:sqlite": "testo --suite=Feature/SQLite --suite=Regression/SQLite",
"test:sqlserver": "testo --suite=Feature/SQLServer --suite=Regression/SQLServer",
"test:unit": "testo --suite=Unit"
},
"scripts-descriptions": {
"test:new-case": "Write a regression case into tests/Regression/Issue<N>: composer test:new-case -- <N>"
},
"extra": {
"bamarni-bin": {
Expand Down
31 changes: 0 additions & 31 deletions phpunit.xml

This file was deleted.

12 changes: 12 additions & 0 deletions testo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

use Cycle\Testing\Config;
use Cycle\Testing\ORM\OrmPlugin;

return Config::forPackage('cycle/entity-behavior', root: __DIR__)
->unit('tests/Unit')
->feature('tests/Feature', plugins: [new OrmPlugin()])
->regression('tests/Regression', plugins: [new OrmPlugin()])
->build();
51 changes: 0 additions & 51 deletions tests/Behavior/Functional/Driver/Common/BaseListenerTest.php

This file was deleted.

Loading
Loading