Skip to content

Commit

Permalink
Laravel 11 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-werner committed Aug 5, 2024
1 parent 1b4bd5b commit 6a7cbfd
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 26 deletions.
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

0 comments on commit 6a7cbfd

Please sign in to comment.