Skip to content

Commit

Permalink
DEP Use PHPUnit 11
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Sep 10, 2024
1 parent cdda9bc commit d070de7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"silverstripe/framework": "^6"
},
"require-dev": {
"phpunit/phpunit": "^9.6",
"phpunit/phpunit": "^11.3",
"squizlabs/php_codesniffer": "^3",
"silverstripe/versioned": "^3",
"silverstripe/standards": "^1",
Expand Down
7 changes: 6 additions & 1 deletion tests/CookieStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
use SilverStripe\Core\TempFolder;
use SilverStripe\HybridSessions\Store\CookieStore;
use SilverStripe\HybridSessions\Tests\Store\TestCookieStore;
use SilverStripe\Dev\SapphireTest;

class CookieStoreTest extends AbstractTest
class CookieStoreTest extends SapphireTest
{
use HybridSessionsTestTrait;

protected $usesDatabase = true;

protected function getStore()
{
$store = Injector::inst()->get(CookieStore::class);
Expand Down
7 changes: 6 additions & 1 deletion tests/DatabaseStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
use SilverStripe\ORM\Connect\MySQLDatabase;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\HybridSessions\Store\DatabaseStore;
use SilverStripe\Dev\SapphireTest;

class DatabaseStoreTest extends AbstractTest
class DatabaseStoreTest extends SapphireTest
{
use HybridSessionsTestTrait;

protected $usesDatabase = true;

protected function setUp(): void
{
parent::setUp();
Expand Down
4 changes: 1 addition & 3 deletions tests/AbstractTest.php → tests/HybridSessionsTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
use SilverStripe\HybridSessions\Store\CookieStore;
use SilverStripe\HybridSessions\Tests\Store\TestCookieStore;

abstract class AbstractTest extends SapphireTest
trait HybridSessionsTestTrait
{
protected $usesDatabase = true;

protected function setUp(): void
{
parent::setUp();
Expand Down
5 changes: 2 additions & 3 deletions tests/OpenSSLCryptoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

use SilverStripe\Dev\SapphireTest;
use SilverStripe\HybridSessions\Crypto\OpenSSLCrypto;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;

/**
* @requires extension openssl
*/
#[RequiresPhpExtension('openssl')]
class OpenSSLCryptoTest extends SapphireTest
{
public function testIntegrity()
Expand Down

0 comments on commit d070de7

Please sign in to comment.