Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 11 compatibility #67

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.0', '8.1']
php-versions: ['8.0', '8.1', '8.2', '8.3']
steps:
- uses: actions/checkout@v2
- name: Setup PHP
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"license": "MIT",
"require": {
"php" : "^8.0",
"illuminate/support": "^9.0 || ^10.0",
"illuminate/support": "^9.0 || ^10.0 || ^11.0",
"twig/twig": "^2.7 || ^3.4",
"doctrine/dbal": "^3.0",
"barryvdh/laravel-dompdf": "^1.0 || ^2.0",
"spatie/browsershot": "^3.40.3"
"spatie/browsershot": "^3.40.3 || ^4.0"
},
"repositories": [
{
Expand All @@ -20,11 +20,11 @@
],
"require-dev": {
"liip/rmt": "dev-master",
"phpunit/phpunit": "^9.4",
"orchestra/testbench": "^7.0 || ^8.0",
"orchestra/testbench-browser-kit": "^7.0 || ^8.0",
"phpunit/phpunit": "^9.4 || ^10.0 || ^11.0",
"orchestra/testbench": "^7.0 || ^8.0 || ^9.0",
"orchestra/testbench-browser-kit": "^7.0 || ^8.0 || ^9.0",
"squizlabs/php_codesniffer": "^3.5",
"phpstan/phpstan": "^0.12.0",
"phpstan/phpstan": "^0.12.0 || ^1.10",
"phpmd/phpmd": "^2.7",
"mockery/mockery": "^1.2"
},
Expand Down
12 changes: 6 additions & 6 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<?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">
<testsuites>
<testsuite name="42coders Test Suite">
<directory>tests</directory>
Expand All @@ -13,4 +8,9 @@
<php>
<env name="DB_CONNECTION" value="testing"/>
</php>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>
16 changes: 16 additions & 0 deletions phpunit.xml.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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>
<testsuites>
<testsuite name="42coders Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<php>
<env name="DB_CONNECTION" value="testing"/>
</php>
</phpunit>
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ class DocumentTemplatesControllerFeatureTest extends FeatureTestCase

protected $request;

protected $baseUrl = '';
protected $baseUrl = 'documents';

protected function setUp(): void
{
parent::setUp();

if($this->baseUrl){
if ($this->baseUrl){
config(['document_templates.base_url' => $this->baseUrl]);
DocumentTemplates::routes(DemoDocumentTemplatesController::class);
}
Expand Down Expand Up @@ -194,13 +194,13 @@ public function testPlaceholders(){
$this->assertResponseOk();
}

public function run(TestResult $result = null): TestResult
{
$this->baseUrl = 'documents';
$result = parent::run($result);
$this->baseUrl = 'newsletters';
$result = parent::run($result);

return $result;
}
// public function run(TestResult $result = null): TestResult
// {
// $this->baseUrl = 'documents';
// $result = parent::run($result);
// $this->baseUrl = 'newsletters';
// $result = parent::run($result);
//
// return $result;
// }
}
2 changes: 1 addition & 1 deletion tests/Layouts/TwigLayoutRenderSingleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function testRenderSingleWithScalarDataSource($expected, $nonIterable)
$this->assertEquals($expected, $rendered);
}

public function provideScalarData()
public static function provideScalarData()
{
yield ["This is string", "string"];
yield ["This is 1", 1];
Expand Down
4 changes: 2 additions & 2 deletions tests/Layouts/TwigLayoutSandboxSecurityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function testSandboxNotAllowed($content, $expectedException)
$layout->renderSingle($editableTemplate, $dataSources);
}

public function sandboxNotAllowedDataProvider()
public static function sandboxNotAllowedDataProvider()
{
return [
'not-allowed-include' => [
Expand Down Expand Up @@ -133,7 +133,7 @@ public function testSandboxWildCardPropertiesAllowed()
$this->assertEquals('Any property is enabled: 1', $rendered);
}

public function sandboxAllowedDataProvider()
public static function sandboxAllowedDataProvider()
{
return [
'allowed-tag' => [
Expand Down
Loading