Skip to content

Commit

Permalink
Merge pull request #4 from swisnl/shift-141425
Browse files Browse the repository at this point in the history
PHPUnit 10 Shift
  • Loading branch information
JaZo authored Feb 25, 2025
2 parents 1ea6957 + 70762c0 commit d2ac8bb
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ vendor
.php-cs-fixer.php
.php-cs-fixer.cache
phpunit.xml
.phpunit.result.cache
.phpunit.cache
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"orchestra/testbench": "^8.0|^9.0|^10.0",
"phpunit/phpunit": "^9.5|^10.5|^11.5"
"phpunit/phpunit": "^10.5|^11.5"
},
"autoload": {
"psr-4": {
Expand Down
49 changes: 24 additions & 25 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
backupStaticProperties="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="swisnl Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
stopOnFailure="false"
cacheDirectory=".phpunit.cache">
<testsuites>
<testsuite name="swisnl Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>
27 changes: 8 additions & 19 deletions tests/EncryptedModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
namespace Swis\Laravel\Encrypted\Tests;

use Illuminate\Database\Connection;
use PHPUnit\Framework\Attributes\Test;
use Swis\Laravel\Encrypted\EncryptedModel;
use Swis\Laravel\Encrypted\Tests\_mocks\Builder;

class EncryptedModelTest extends TestCase
final class EncryptedModelTest extends TestCase
{
/**
* @test
*/
#[Test]
public function itDecryptsRawAttributes(): void
{
// arrange
Expand All @@ -25,9 +24,7 @@ public function itDecryptsRawAttributes(): void
$this->assertEquals($value, $model->getAttribute('secret'));
}

/**
* @test
*/
#[Test]
public function itDoesNotDecryptRawAttributesThatAreNotConfiguredAsSuch(): void
{
// arrange
Expand All @@ -41,9 +38,7 @@ public function itDoesNotDecryptRawAttributesThatAreNotConfiguredAsSuch(): void
$this->assertEquals($value, $model->getAttribute('not_secret'));
}

/**
* @test
*/
#[Test]
public function itDoesNotDecryptRawAttributesThatAreNull(): void
{
// arrange
Expand All @@ -56,9 +51,7 @@ public function itDoesNotDecryptRawAttributesThatAreNull(): void
$this->assertNull($model->getAttribute('secret'));
}

/**
* @test
*/
#[Test]
public function itDoesNotDecryptRawAttributesThatAreNotEncrypted(): void
{
// arrange
Expand All @@ -72,9 +65,7 @@ public function itDoesNotDecryptRawAttributesThatAreNotEncrypted(): void
$this->assertEquals($value, $model->getAttribute('secret'));
}

/**
* @test
*/
#[Test]
public function itEncryptsDataOnInsert(): void
{
// arrange
Expand Down Expand Up @@ -102,9 +93,7 @@ public function itEncryptsDataOnInsert(): void
// expectations
}

/**
* @test
*/
#[Test]
public function itEncryptsDataOnUpdate(): void
{
// arrange
Expand Down
7 changes: 3 additions & 4 deletions tests/FilesystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
namespace Swis\Laravel\Encrypted\Tests;

use Illuminate\Support\Facades\Storage;
use PHPUnit\Framework\Attributes\Test;

class FilesystemTest extends TestCase
final class FilesystemTest extends TestCase
{
/**
* @test
*/
#[Test]
public function itRegistersTheFilesystemDriver(): void
{
$contents = Storage::get('read.txt');
Expand Down

0 comments on commit d2ac8bb

Please sign in to comment.