Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Dec 8, 2023
1 parent 51303b8 commit 9e3052e
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ jobs:
with:
ref: ${{ github.head_ref }}

- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php_cs.dist.php --allow-risky=yes
- name: Fix styling issues
uses: aglipanci/[email protected]

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fix styling
35 changes: 0 additions & 35 deletions .php_cs.dist.php

This file was deleted.

5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
"mockery/mockery": "^1.4",
"nunomaduro/larastan": "^2.0",
"orchestra/testbench": "^7.0|^8.0",
"pestphp/pest": "^1.21",
"pestphp/pest": "^2.0",
"phpstan/extension-installer": "^1.1",
"spatie/laravel-ray": "^1.28",
"spatie/pdf-to-image": "^2.1",
"spatie/phpunit-snapshot-assertions": "^4.2"
"spatie/pest-plugin-snapshots": "^2.1"
},
"conflict": {
"php-ffmpeg/php-ffmpeg": "<0.6.1"
Expand Down Expand Up @@ -91,7 +91,6 @@
"scripts": {
"analyse": "vendor/bin/phpstan analyse",
"baseline": "vendor/bin/phpstan analyse --generate-baseline",
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
"test": "vendor/bin/pest"
}
}
17 changes: 9 additions & 8 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<coverage/>
<testsuites>
<testsuite name="Spatie Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<php>
<php>
<env name="MAIL_MAILER" value="log"/>
</php>
</php>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>
1 change: 0 additions & 1 deletion src/Conversions/ConversionCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ protected function addConversionsFromRelatedModel(Media $media): void
protected function addManipulationsFromDb(Media $media): void
{
collect($media->manipulations)->each(function ($manipulation, $conversionName) {
ray($manipulation, $conversionName)->red();
$manipulations = new Manipulations($manipulation);

$this->addManipulationToConversion($manipulations, $conversionName);
Expand Down
5 changes: 5 additions & 0 deletions tests/ArchTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

it('will not use debugging functions')
->expect(['dd', 'dump', 'ray'])
->not->toBeUsed();
2 changes: 1 addition & 1 deletion tests/Conversions/ImageGenerators/SvgTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
$imageFile = $imageGenerator->convert($media->getPath());

expect(mime_content_type($imageFile))->toEqual('image/jpeg');
});
})->skipWhenRunningLocally();
10 changes: 10 additions & 0 deletions tests/Pest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,13 @@ function unserializeAndSerializeModel($model)
{
return unserialize(serialize($model));
}

function skipWhenRunningOnGitHub(): bool
{
return getenv('GITHUB_ACTIONS') !== false;
}

function skipWhenRunningLocally(): bool
{
return getenv('GITHUB_ACTIONS') === false;
}

0 comments on commit 9e3052e

Please sign in to comment.