Skip to content

Commit a0460ef

Browse files
committed
L11 support
1 parent bc71f62 commit a0460ef

5 files changed

Lines changed: 29 additions & 20 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ build
22
composer.lock
33
docs
44
vendor
5-
coverage
5+
coverage
6+
.phpunit.cache

.phpunit.cache/test-results

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":1,"defects":[],"times":{"SchantlDev\\GitWebhook\\Tests\\WebhookTest::try_with_signature":0.046,"SchantlDev\\GitWebhook\\Tests\\WebhookTest::route_exists":0.003,"SchantlDev\\GitWebhook\\Tests\\WebhookTest::try_with_signature_no_secret_set":0,"SchantlDev\\GitWebhook\\Tests\\WebhookTest::deploy_scripts_exists":0}}
1+
{"version":1,"defects":[],"times":{"SchantlDev\\GitWebhook\\Tests\\WebhookTest::try_with_signature":0.007,"SchantlDev\\GitWebhook\\Tests\\WebhookTest::route_exists":0.038,"SchantlDev\\GitWebhook\\Tests\\WebhookTest::try_with_signature_no_secret_set":0.003,"SchantlDev\\GitWebhook\\Tests\\WebhookTest::deploy_scripts_exists":0.002}}

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^8.1",
20-
"illuminate/support": "^10.0"
19+
"php": "^8.2",
20+
"illuminate/support": "^11.0"
2121
},
2222
"require-dev": {
23-
"orchestra/testbench": "^8.0",
24-
"phpunit/phpunit": "^10.0"
23+
"orchestra/testbench": "^9.0",
24+
"phpunit/phpunit": "^11.0"
2525
},
2626
"autoload": {
2727
"psr-4": {

phpunit.xml.dist

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true" beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd" backupGlobals="false"
4+
bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false"
5+
executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true"
6+
beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache"
7+
backupStaticProperties="false">
38
<testsuites>
4-
<testsuite name="VendorName Test Suite">
9+
<testsuite name="SchantlDev Git Webhook">
510
<directory>tests</directory>
611
</testsuite>
712
</testsuites>
813
<coverage>
9-
<include>
10-
<directory suffix=".php">./src</directory>
11-
</include>
1214
<report>
13-
<html outputDirectory="build/coverage"/>
14-
<text outputFile="build/coverage.txt"/>
15-
<clover outputFile="build/logs/clover.xml"/>
15+
<html outputDirectory="build/coverage" />
16+
<text outputFile="build/coverage.txt" />
17+
<clover outputFile="build/logs/clover.xml" />
1618
</report>
1719
</coverage>
1820
<logging>
19-
<junit outputFile="build/report.junit.xml"/>
21+
<junit outputFile="build/report.junit.xml" />
2022
</logging>
21-
</phpunit>
23+
<source>
24+
<include>
25+
<directory suffix=".php">./src</directory>
26+
</include>
27+
</source>
28+
</phpunit>

tests/WebhookTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Support\Facades\Config;
66
use Orchestra\Testbench\TestCase;
7+
use PHPUnit\Framework\Attributes\Test;
78
use SchantlDev\GitWebhook\GitWebhookServiceProvider;
89

910
class WebhookTest extends TestCase
@@ -19,20 +20,20 @@ protected function getPackageProviders($app)
1920
return [GitWebhookServiceProvider::class];
2021
}
2122

22-
/** @test */
23+
#[Test]
2324
public function deploy_scripts_exists()
2425
{
2526
$this->assertFileExists(storage_path('git-webhook/git_deploy.sh'));
2627
}
2728

28-
/** @test */
29+
#[Test]
2930
public function route_exists()
3031
{
3132
$response = $this->post(config('git-webhook.route'));
3233
$response->assertStatus(200);
3334
}
3435

35-
/** @test */
36+
#[Test]
3637
public function try_with_signature_no_secret_set()
3738
{
3839
$response = $this->withHeaders([
@@ -42,7 +43,7 @@ public function try_with_signature_no_secret_set()
4243
$response->assertStatus(403);
4344
}
4445

45-
/** @test */
46+
#[Test]
4647
public function try_with_signature()
4748
{
4849
Config::set('git-webhook.secret', '1234');

0 commit comments

Comments
 (0)