Skip to content

Commit 740f042

Browse files
committed
chore: update setup
1 parent 36cfdda commit 740f042

5 files changed

Lines changed: 22 additions & 12 deletions

File tree

.php-cs-fixer.dist.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
__DIR__ . '/src',
1313
__DIR__ . '/spec',
1414
])
15-
->notName('#Foobar.php$#')
1615
->append([
1716
__FILE__,
1817
]);

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
},
2020
"require-dev": {
2121
:require_dev_testing,
22-
:require_dev_codestyle
22+
:require_dev_codestyle,
23+
"phpstan/phpstan": "^1.11"
2324
},
2425
"autoload": {
2526
"psr-4": {
@@ -36,13 +37,13 @@
3637
:scripts_codestyle,
3738
"analyze": [
3839
"Composer\\Config::disableProcessTimeout",
39-
"bash -c \"XDEBUG_MODE=off phpstan analyse\""
40+
"bash -c \"XDEBUG_MODE=off vendor/bin/phpstan analyse\""
4041
]
4142
},
4243
"scripts-descriptions": {
4344
"analyze": "Lance l'analyse statique du code du framework",
4445
"test": "Execute les tests unitaires",
45-
"format": "Corriger le style de codage"
46+
"cs:fix": "Corriger le style de codage"
4647
},
4748
"config": {
4849
"sort-packages": true,

configure.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,12 @@ function setupTestingLibrary(string $testingLibrary): void
199199
);
200200

201201
replace_in_file(__DIR__.'/composer.json', [
202-
':require_dev_testing' => '"kahlan/kahlan": "^5.2"',
202+
':require_dev_testing' => '"kahlan/kahlan": "^6.0"',
203203
':scripts_testing' => '"test": "vendor/bin/kahlan",
204-
"test:cov": "vendor/bin/kahlan --coverage=3 --reporter=verbose --clover=clover.xml"',
204+
"test:cov": [
205+
"Composer\\Config::disableProcessTimeout",
206+
"vendor/bin/kahlan --coverage=4 --reporter=verbose --clover=clover.xml"
207+
]',
205208
':plugins_testing,' => '', // Nous devons également supprimer la virgule ici, car il n'y a rien à ajouter
206209
]);
207210
}
@@ -234,7 +237,10 @@ function setupCodeStyleLibrary(string $codeStyleLibrary): void
234237

235238
replace_in_file(__DIR__.'/composer.json', [
236239
':require_dev_codestyle' => '"blitz-php/coding-standard": "^1.4"',
237-
':scripts_codestyle' => '"format": "vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --allow-risky=yes"',
240+
':scripts_codestyle' => '"cs:fix": [
241+
"Composer\\Config::disableProcessTimeout",
242+
"vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --allow-risky=yes"
243+
]',
238244
':plugins_testing' => '',
239245
]);
240246
}

kahlan-config.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@
99
$commandLine = $this->commandLine();
1010
$commandLine->option('ff', 'default', 1);
1111
$commandLine->option('coverage', 'default', 3);
12-
$commandLine->option('coverage-scrutinizer', 'default', 'scrutinizer.xml');
12+
$commandLine->option('coverage-clover', 'default', 'clover.xml');
1313

1414
Filters::apply($this, 'reporting', function ($next) {
1515

1616
// Get the reporter called `'coverage'` from the list of reporters
1717
$reporter = $this->reporters()->get('coverage');
1818

1919
// Abort if no coverage is available.
20-
if (! $reporter || ! $this->commandLine()->exists('coverage-scrutinizer')) {
20+
if (! $reporter || ! $this->commandLine()->exists('coverage-clover')) {
2121
return $next();
2222
}
2323

2424
// Use the `Coveralls` class to write the JSON coverage into a file
2525
Clover::write([
2626
'collector' => $reporter,
27-
'file' => $this->commandLine()->get('coverage-scrutinizer'),
27+
'file' => $this->commandLine()->get('coverage-clover'),
2828
]);
2929

3030
return $next();

tests/ExampleTestKahlan.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<?php
22

3-
it('can test', function () {
4-
expect(true)->toBeTruthy();
3+
use function Kahlan\expect;
4+
5+
describe('Package', function() {
6+
it('can test', function () {
7+
expect(true)->toBeTruthy();
8+
});
59
});

0 commit comments

Comments
 (0)