Skip to content

Commit 631e447

Browse files
authored
Merge pull request #76 from Astrotomic/ft-refactor-testsuite
refactor testsuite
2 parents b6bbb29 + 207af8e commit 631e447

Some content is hidden

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

44 files changed

+1335
-1792
lines changed

.circleci/config.yml

Lines changed: 0 additions & 218 deletions
This file was deleted.

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
vendor/
2-
composer.lock
3-
coverage/
4-
.phpunit.result.cache
5-
build/
1+
/vendor/
2+
/composer.lock
3+
/coverage/
4+
/.phpunit.result.cache
5+
/build/

.travis.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
language: php
2+
3+
dist: bionic
4+
5+
services:
6+
- mysql
7+
8+
cache:
9+
directories:
10+
- $HOME/.composer/cache/files
11+
12+
php:
13+
- 7.2
14+
- 7.3
15+
16+
env:
17+
- LARAVEL='5.8.*' COMPOSER_FLAGS='--prefer-lowest'
18+
- LARAVEL='5.8.*' COMPOSER_FLAGS='--prefer-stable'
19+
- LARAVEL='^6.0' COMPOSER_FLAGS='--prefer-lowest'
20+
- LARAVEL='^6.0' COMPOSER_FLAGS='--prefer-stable'
21+
22+
matrix:
23+
include:
24+
- php: 7.4snapshot
25+
env: LARAVEL='^6.0' COMPOSER_FLAGS='--prefer-lowest'
26+
- php: 7.4snapshot
27+
env: LARAVEL='^6.0' COMPOSER_FLAGS='--prefer-stable'
28+
fast_finish: true
29+
allow_failures:
30+
- php: 7.4snapshot
31+
32+
before_install:
33+
- mysql -e 'CREATE DATABASE translatable_test;'
34+
- composer config discard-changes true
35+
- travis_retry composer self-update
36+
- travis_retry composer require --dev "laravel/framework:${LARAVEL}" --no-interaction --no-update
37+
38+
install:
39+
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-suggest --no-interaction
40+
41+
script:
42+
- DB_CONNECTION=mysql DB_DATABASE=translatable_test DB_USERNAME=travis vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
43+
44+
after_script:
45+
- wget https://scrutinizer-ci.com/ocular.phar
46+
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
47+
48+
notifications:
49+
slack:
50+
secure: Mvg61/n1NVIr+LBD+eMymVugFtX0CW/xv6k/RpR5tV+dSvzvs8Vvk23UyslR+UvsYtJ7mDzoWxHBTASi/8cKgchIhotzUSqPC3sepaerwOxDxELMNEUw/XCPEftCVZRcUaLGgIPMjYPU5hhnN5sEDPcSrrkM1nw+TBalWiJN0qyWCZ3JsWSPqMpKCEdx2VFgnbTQd4apJz7Ul7H9YqEVfUPD2Mu7ZlmWwQc3YKrSkEFVds46W8tr07vS9a4SL5A9Xtt+0S1bPJBeCdH6DDIfRAOtAap2pEBSe5cpXX1RVH7MdHM6Kges9bxekVT3Cbrd9mULSqsDPB2ii17yum20TGk8tEsoawr2GhrjCc8mCg9fPWh9oq87WvNXQsZWlCnKG30Wnp/9HGF3y/gEBkpUNKzQzvVbeTPIYQ6kfEb5nJOXoQZ10TsSRtRtFCQG5Sei39hWzD/wCGo8kVqVxcSyJcZMS60gWB5c8/cu0E20IVf6ixymTOpqUAx4rwtDGvztkAnKmogm+SOWy6YPWOJrl1GeVK+gSwMSeZSCs2Ghkyi/XILsa/Jb6sDarrj+RYbJdEjLIGzj5sBsQugBBVXeg1mBUXWVsZBa55bpKlJWQjCZkHZ4F81LD19bkEaI3Olam1DHafjmFbKWYaNZ+mrYiAOvWp5QxOqEipTxS1KeprI=

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Introduction
22

33
[![Total Downloads](https://img.shields.io/packagist/dt/astrotomic/laravel-translatable.svg?label=Downloads&style=flat-square&cacheSeconds=600)](https://packagist.org/packages/astrotomic/laravel-translatable)
4-
[![CircleCI](https://img.shields.io/circleci/build/github/Astrotomic/laravel-translatable/master.svg?label=CircleCI&style=flat-square&cacheSeconds=600)](https://circleci.com/gh/Astrotomic/laravel-translatable)
4+
[![TravisCI](https://img.shields.io/travis/Astrotomic/laravel-translatable/master?label=TravisCI&style=flat-square&cacheSeconds=600)](https://travis-ci.org/Astrotomic/laravel-translatable/branches)
55
[![StyleCI](https://styleci.io/repos/192333549/shield)](https://styleci.io/repos/192333549)
66
[![ScrutinizerCI](https://img.shields.io/scrutinizer/quality/g/Astrotomic/laravel-translatable/master.svg?label=ScrutinizerCI&style=flat-square&cacheSeconds=600)](https://scrutinizer-ci.com/g/Astrotomic/laravel-translatable/)
77
[![Code Climate](https://img.shields.io/codeclimate/maintainability/Astrotomic/laravel-translatable.svg?label=CodeClimate&style=flat-square&cacheSeconds=600)](https://codeclimate.com/github/Astrotomic/laravel-translatable)
@@ -88,11 +88,13 @@ Please see [SECURITY](SECURITY.md) for details.
8888

8989
- [Tom Witkowski](https://github.com/Gummibeer)
9090
- [Dimitrios Savvopoulos](https://github.com/dimsav)
91+
- [David Llop](https://github.com/Lloople)
9192
- [All Contributors](https://github.com/Astrotomic/laravel-translatable/graphs/contributors)
9293

9394
## Versions
9495

9596
| Package | Laravel | PHP |
9697
| :--- | :--- | :--- |
98+
| **v11.6** | `5.8.* / 6.*` | `>=7.2` |
9799
| **v11.4 - v11.5** | `5.6.* / 5.7.* / 5.8.* / 6.*` | `>=7.1.3` |
98100
| **v11.0 - v11.3** | `5.6.* / 5.7.* / 5.8.*` | `>=7.1.3` |

composer.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
}
2424
],
2525
"require": {
26-
"php": ">=7.1.3",
27-
"illuminate/contracts": "5.6.* || 5.7.* || 5.8.* || ^6.0",
28-
"illuminate/database": "5.6.* || 5.7.* || 5.8.* || ^6.0",
29-
"illuminate/support": "5.6.* || 5.7.* || 5.8.* || ^6.0"
26+
"php": ">=7.2",
27+
"illuminate/contracts": "5.8.* || ^6.0",
28+
"illuminate/database": "5.8.* || ^6.0",
29+
"illuminate/support": "5.8.* || ^6.0"
3030
},
3131
"require-dev": {
32-
"orchestra/testbench": "3.6.* || 3.7.* || 3.8.* || ^4.0",
33-
"orchestra/testbench-core": "3.6.* || 3.7.* || 3.8.* || ^4.0"
32+
"orchestra/testbench": "3.8.* || ^4.0",
33+
"phpunit/phpunit": "^8.0"
3434
},
3535
"config": {
3636
"sort-packages": true
@@ -48,12 +48,14 @@
4848
}
4949
},
5050
"autoload-dev": {
51-
"classmap": [
52-
"tests"
53-
]
51+
"psr-4": {
52+
"Astrotomic\\Translatable\\Tests\\": "tests/"
53+
}
5454
},
5555
"scripts": {
56-
"csfix": "php-cs-fixer fix --using-cache=no"
56+
"csfix": "php-cs-fixer fix --using-cache=no",
57+
"test": "vendor/bin/phpunit",
58+
"test-coverage": "vendor/bin/phpunit --coverage-html=build"
5759
},
5860
"support": {
5961
"issues": "https://github.com/Astrotomic/laravel-translatable/issues",

docs/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Introduction
22

3-
[![Total Downloads](https://img.shields.io/packagist/dt/astrotomic/laravel-translatable.svg?style=flat-square)](https://packagist.org/packages/astrotomic/laravel-translatable) [![CircleCI](https://img.shields.io/circleci/build/github/Astrotomic/laravel-translatable/master.svg?label=CircleCI&style=flat-square)](https://circleci.com/gh/Astrotomic/laravel-translatable) [![StyleCI](https://styleci.io/repos/192333549/shield)](https://styleci.io/repos/192333549) [![ScrutinizerCI](https://img.shields.io/scrutinizer/quality/g/Astrotomic/laravel-translatable/master.svg?label=ScrutinizerCI&style=flat-square)](https://scrutinizer-ci.com/g/Astrotomic/laravel-translatable/) [![Code Climate](https://img.shields.io/codeclimate/maintainability/Astrotomic/laravel-translatable.svg?label=CodeClimate&style=flat-square)](https://codeclimate.com/github/Astrotomic/laravel-translatable) [![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/Astrotomic/laravel-translatable/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/Astrotomic/laravel-translatable/) [![Latest Version](http://img.shields.io/packagist/v/astrotomic/laravel-translatable.svg?style=flat-square)](https://packagist.org/packages/astrotomic/laravel-translatable) ![MIT License](https://img.shields.io/github/license/Astrotomic/laravel-translatable.svg?color=blue&style=flat-square) [![Open Collective](https://img.shields.io/opencollective/all/astrotomic?label=Open%20Collective&style=flat-square&cacheSeconds=600)](https://opencollective.com/astrotomic)
3+
[![Total Downloads](https://img.shields.io/packagist/dt/astrotomic/laravel-translatable.svg?style=flat-square)](https://packagist.org/packages/astrotomic/laravel-translatable) [![TravisCI](https://img.shields.io/travis/Astrotomic/laravel-translatable/master?label=TravisCI&style=flat-square&cacheSeconds=600)](https://travis-ci.org/Astrotomic/laravel-translatable/branches) [![StyleCI](https://styleci.io/repos/192333549/shield)](https://styleci.io/repos/192333549) [![ScrutinizerCI](https://img.shields.io/scrutinizer/quality/g/Astrotomic/laravel-translatable/master.svg?label=ScrutinizerCI&style=flat-square)](https://scrutinizer-ci.com/g/Astrotomic/laravel-translatable/) [![Code Climate](https://img.shields.io/codeclimate/maintainability/Astrotomic/laravel-translatable.svg?label=CodeClimate&style=flat-square)](https://codeclimate.com/github/Astrotomic/laravel-translatable) [![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/Astrotomic/laravel-translatable/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/Astrotomic/laravel-translatable/) [![Latest Version](http://img.shields.io/packagist/v/astrotomic/laravel-translatable.svg?style=flat-square)](https://packagist.org/packages/astrotomic/laravel-translatable) ![MIT License](https://img.shields.io/github/license/Astrotomic/laravel-translatable.svg?color=blue&style=flat-square) [![Open Collective](https://img.shields.io/opencollective/all/astrotomic?label=Open%20Collective&style=flat-square&cacheSeconds=600)](https://opencollective.com/astrotomic)
44

55
![Laravel Translatable](.gitbook/assets/laravel-translatable-2-1.png)
66

@@ -65,12 +65,14 @@ echo $post->translate('fr')->title; // Mon premier post
6565

6666
- [Tom Witkowski](https://github.com/Gummibeer)
6767
- [Dimitrios Savvopoulos](https://github.com/dimsav)
68+
- [David Llop](https://github.com/Lloople)
6869
- [All Contributors](https://github.com/Astrotomic/laravel-translatable/graphs/contributors)
6970

7071
## Versions
7172

7273
| Package | Laravel | PHP |
7374
| :--- | :--- | :--- |
75+
| **v11.6** | `5.8.* / 6.*` | `>=7.2` |
7476
| **v11.4 - v11.5** | `5.6.* / 5.7.* / 5.8.* / 6.*` | `>=7.1.3` |
7577
| **v11.0 - v11.3** | `5.6.* / 5.7.* / 5.8.*` | `>=7.1.3` |
7678

docs/changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## v11
44

5+
### v11.6.0
6+
7+
* Drop PHP 7.1 support
8+
* Drop Laravel 5.6 & 5.7 support
9+
* Add PHP side translation cascade deletion - [\#98](https://github.com/Astrotomic/laravel-translatable/pull/98) (_disabled by default_)
10+
511
### v11.5.2
612

713
* Fix scope `orderByTranslation()` to return all translations - [\#72](https://github.com/Astrotomic/laravel-translatable/pull/72)

docs/usage/methods.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,14 @@ disables autoload and returns parent attributes
125125

126126
does not change the default behavior logic
127127

128+
## Translation cascade deletion
129+
130+
If the `delete()` method is called it's possible to delete all assigned translations. The eloquent `delete()` method will be used so you will get all events but it creates 1+n queries.
131+
132+
### static disableDeleteTranslationsCascade\(\)
133+
134+
disables cascade deletion on PHP side
135+
136+
### static enableDeleteTranslationsCascade\(\)
137+
138+
enables cascade deletion on PHP side

0 commit comments

Comments
 (0)