Skip to content

Commit

Permalink
L11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
andjsch committed Mar 18, 2024
1 parent bc71f62 commit a0460ef
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ build
composer.lock
docs
vendor
coverage
coverage
.phpunit.cache
2 changes: 1 addition & 1 deletion .phpunit.cache/test-results
Original file line number Diff line number Diff line change
@@ -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}}
{"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}}
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
}
],
"require": {
"php": "^8.1",
"illuminate/support": "^10.0"
"php": "^8.2",
"illuminate/support": "^11.0"
},
"require-dev": {
"orchestra/testbench": "^8.0",
"phpunit/phpunit": "^10.0"
"orchestra/testbench": "^9.0",
"phpunit/phpunit": "^11.0"
},
"autoload": {
"psr-4": {
Expand Down
27 changes: 17 additions & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.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">
<testsuites>
<testsuite name="VendorName Test Suite">
<testsuite name="SchantlDev Git Webhook">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage" />
<text outputFile="build/coverage.txt" />
<clover outputFile="build/logs/clover.xml" />
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
<junit outputFile="build/report.junit.xml" />
</logging>
</phpunit>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
9 changes: 5 additions & 4 deletions tests/WebhookTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Support\Facades\Config;
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;
use SchantlDev\GitWebhook\GitWebhookServiceProvider;

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

/** @test */
#[Test]
public function deploy_scripts_exists()
{
$this->assertFileExists(storage_path('git-webhook/git_deploy.sh'));
}

/** @test */
#[Test]
public function route_exists()
{
$response = $this->post(config('git-webhook.route'));
$response->assertStatus(200);
}

/** @test */
#[Test]
public function try_with_signature_no_secret_set()
{
$response = $this->withHeaders([
Expand All @@ -42,7 +43,7 @@ public function try_with_signature_no_secret_set()
$response->assertStatus(403);
}

/** @test */
#[Test]
public function try_with_signature()
{
Config::set('git-webhook.secret', '1234');
Expand Down

0 comments on commit a0460ef

Please sign in to comment.