Skip to content

Commit b84d548

Browse files
committed
chore: dev tools and dependencies updated
1 parent fc06eda commit b84d548

23 files changed

+132
-166
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ jobs:
4444
strategy:
4545
fail-fast: true
4646
matrix:
47-
#php: [8.0, 8.1]
48-
php: [8.1, 8.2, 8.3]
47+
php: [8.3, 8.4]
4948
mapper: [mysql, pgsql]
5049

5150
name: Unit tests PHP ${{ matrix.php }} and ${{ matrix.mapper }}
@@ -91,7 +90,7 @@ jobs:
9190
strategy:
9291
fail-fast: true
9392
matrix:
94-
php: [8.1, 8.2, 8.3]
93+
php: [8.3, 8.4]
9594

9695
name: Code analysis with PHPStan PHP ${{ matrix.php }}
9796

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
"psr/simple-cache": "^3.0"
2424
},
2525
"require-dev": {
26-
"infection/infection": ">=0.26",
27-
"phpstan/phpstan": "^1.9",
28-
"phpunit/phpunit": "^10",
26+
"infection/infection": "^0.30",
27+
"phpstan/phpstan": "^2.1",
28+
"phpunit/phpunit": "^12",
2929
"linna/auth-mapper-mysql": "dev-master",
3030
"linna/db-dumps": "dev-master",
31-
"mongodb/mongodb": "^1.5",
32-
"brianium/paratest": "^7.0"
31+
"mongodb/mongodb": "^2.1",
32+
"brianium/paratest": "^7"
3333
},
3434
"autoload": {
3535
"psr-4": {

composer.mysql.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
"psr/simple-cache": "^3.0"
2424
},
2525
"require-dev": {
26-
"infection/infection": ">=0.26",
27-
"phpstan/phpstan": "^1.9",
28-
"phpunit/phpunit": "^10",
26+
"infection/infection": "^0.30",
27+
"phpstan/phpstan": "^2.1",
28+
"phpunit/phpunit": "^12",
2929
"linna/auth-mapper-mysql": "dev-master",
3030
"linna/db-dumps": "dev-master",
31-
"mongodb/mongodb": "^1.5",
32-
"brianium/paratest": "^7.0"
31+
"mongodb/mongodb": "^2.1",
32+
"brianium/paratest": "^7"
3333
},
3434
"autoload": {
3535
"psr-4": {

composer.pgsql.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
"psr/simple-cache": "^3.0"
2424
},
2525
"require-dev": {
26-
"infection/infection": ">=0.26",
27-
"phpstan/phpstan": "^1.9",
28-
"phpunit/phpunit": "^10",
26+
"infection/infection": "^0.30",
27+
"phpstan/phpstan": "^2.1",
28+
"phpunit/phpunit": "^12",
2929
"linna/auth-mapper-pgsql": "dev-master",
3030
"linna/db-dumps": "dev-master",
31-
"mongodb/mongodb": "^1.5",
32-
"brianium/paratest": "^7.0"
31+
"mongodb/mongodb": "^2.1",
32+
"brianium/paratest": "^7"
3333
},
3434
"autoload": {
3535
"psr-4": {

phpunit.dist.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<logging/>
1414
<php>
1515
<var name="pdo_mysql_dsn" value="mysql:host=0.0.0.0;dbname=linna_db;charset=utf8mb4"/>
16+
<var name="pdo_mysql_host" value="0.0.0.0"/>
1617
<var name="pdo_mysql_user" value="root"/>
1718
<var name="pdo_mysql_password" value="password"/>
1819
<var name="pdo_pgsql_dsn" value="pgsql:dbname=linna_db;host=0.0.0.0"/>

src/Linna/Mvc/View.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
namespace Linna\Mvc;
1414

1515
use Linna\Mvc\TemplateInterface;
16-
1716
use SplObserver;
1817
use SplSubject;
1918

tests/Linna/Authentication/AuthenticationTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
namespace Linna\Authentication;
1414

1515
use Linna\Session\Session;
16+
use PHPUnit\Framework\Attributes\DataProvider;
1617
use PHPUnit\Framework\TestCase;
1718

1819
/**
@@ -100,12 +101,11 @@ public static function tamperingProvider()
100101
/**
101102
* Test login.
102103
*
103-
* @dataProvider tamperingProvider
104-
*
105104
* @runInSeparateProcess
106105
*
107106
* @return void
108107
*/
108+
#[DataProvider('tamperingProvider')]
109109
public function testLoginTampering(int $case): void
110110
{
111111
self::$session->start();
@@ -290,15 +290,14 @@ public static function loginTimeProvider(): array
290290
/**
291291
* Test login refresh.
292292
*
293-
* @dataProvider loginTimeProvider
294-
*
295293
* @runInSeparateProcess
296294
*
297295
* @param int $time
298296
* @param bool $loginPass
299297
*
300298
* @return void
301299
*/
300+
#[DataProvider('loginTimeProvider')]
302301
public function testLoginRefreshTime(int $time, bool $loginPass): void
303302
{
304303
self::$session->start();

tests/Linna/Authentication/PasswordGeneratorTest.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
namespace Linna\Authentication;
1414

1515
use InvalidArgumentException;
16+
use PHPUnit\Framework\Attributes\DataProvider;
1617
use PHPUnit\Framework\TestCase;
1718
use ReflectionObject;
1819

@@ -64,12 +65,11 @@ public static function stringLengthProvider(): array
6465
/**
6566
* Test get from random.
6667
*
67-
* @dataProvider stringLengthProvider
68-
*
6968
* @param int $strLen
7069
*
7170
* @return void
7271
*/
72+
#[DataProvider('stringLengthProvider')]
7373
public function testGetFromRandom(int $strLen): void
7474
{
7575
$password = self::$passwordGenerator->getFromRandom($strLen);
@@ -86,12 +86,11 @@ public function testGetFromRandom(int $strLen): void
8686
/**
8787
* Test get from random.
8888
*
89-
* @dataProvider stringLengthProvider
90-
*
9189
* @param int $strLen
9290
*
9391
* @return void
9492
*/
93+
#[DataProvider('stringLengthProvider')]
9594
public function testCheckRandomTopology(int $strLen): void
9695
{
9796
$topology = '';
@@ -147,13 +146,12 @@ public static function topologyAndPasswordProvider(): array
147146
/**
148147
* Test get topology.
149148
*
150-
* @dataProvider topologyAndPasswordProvider
151-
*
152149
* @param string $password
153150
* @param string $topology
154151
*
155152
* @return void
156153
*/
154+
#[DataProvider('topologyAndPasswordProvider')]
157155
public function testGetTopology(string $password, string $topology): void
158156
{
159157
$this->assertEquals($topology, self::$passwordGenerator->getTopology($password));
@@ -192,12 +190,11 @@ public static function topologyProvider(): array
192190
/**
193191
* Test get topology.
194192
*
195-
* @dataProvider topologyProvider
196-
*
197193
* @param string $topology
198194
*
199195
* @return void
200196
*/
197+
#[DataProvider('topologyProvider')]
201198
public function testGetFromTopology(string $topology): void
202199
{
203200
$password = self::$passwordGenerator->getFromTopology(\strtoupper($topology));
@@ -225,12 +222,11 @@ public static function badTopologyProvider(): array
225222
/**
226223
* Test get topology.
227224
*
228-
* @dataProvider badTopologyProvider
229-
*
230225
* @param string $topology
231226
*
232227
* @return void
233228
*/
229+
#[DataProvider('badTopologyProvider')]
234230
public function testGetFromTopologyException(string $topology): void
235231
{
236232
$this->expectException(InvalidArgumentException::class);

tests/Linna/Authentication/PasswordTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
namespace Linna\Authentication;
1414

15+
use PHPUnit\Framework\Attributes\DataProvider;
1516
use PHPUnit\Framework\TestCase;
1617

1718
/**
@@ -39,7 +40,7 @@ public static function setUpBeforeClass(): void
3940
*/
4041
public static function tearDownAfterClass(): void
4142
{
42-
self::$password = null;
43+
//self::$password = null;
4344
}
4445

4546
/**
@@ -101,10 +102,9 @@ public static function optionsProvider(): array
101102
/**
102103
* Test get hash info.
103104
*
104-
* @dataProvider optionsProvider
105-
*
106105
* @return void
107106
*/
107+
#[DataProvider('optionsProvider')]
108108
public function testGetHashInfo(int $opsLimit, int $memLimit, int $memExp, int $timeExp, int $threads): void
109109
{
110110
$password = new Password($opsLimit, $memLimit);

tests/Linna/Authorization/RoleExtendedTest.php

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Linna\Authentication\Password;
1616
use Linna\Storage\ExtendedPDO;
1717
use Linna\Storage\StorageFactory;
18+
use PHPUnit\Framework\Attributes\DataProvider;
1819
use PHPUnit\Framework\TestCase;
1920
use Linna\TestHelper\Pdo\PdoOptionsFactory;
2021

@@ -128,14 +129,13 @@ public static function userRoleProvider(): array
128129
/**
129130
* Test is user in role.
130131
*
131-
* @dataProvider userRoleProvider
132-
*
133132
* @param int $roleId
134133
* @param int $userId
135134
* @param bool $result
136135
*
137136
* @return void
138137
*/
138+
#[DataProvider('userRoleProvider')]
139139
public function testIsUserInRole(int $roleId, int $userId, bool $result): void
140140
{
141141
/** @var RoleExtended Role Class. */
@@ -149,14 +149,13 @@ public function testIsUserInRole(int $roleId, int $userId, bool $result): void
149149
/**
150150
* Test is user in role by id.
151151
*
152-
* @dataProvider userRoleProvider
153-
*
154152
* @param int $roleId
155153
* @param int $userId
156154
* @param bool $result
157155
*
158156
* @return void
159157
*/
158+
#[DataProvider('userRoleProvider')]
160159
public function testIsUserInRoleById(int $roleId, int $userId, bool $result): void
161160
{
162161
/** @var RoleExtended Role Class. */
@@ -168,14 +167,13 @@ public function testIsUserInRoleById(int $roleId, int $userId, bool $result): vo
168167
/**
169168
* Test is user in role by name.
170169
*
171-
* @dataProvider userRoleProvider
172-
*
173170
* @param int $roleId
174171
* @param int $userId
175172
* @param bool $result
176173
*
177174
* @return void
178175
*/
176+
#[DataProvider('userRoleProvider')]
179177
public function testIsUserInRoleByName(int $roleId, int $userId, bool $result): void
180178
{
181179
/** @var RoleExtended Role Class. */
@@ -219,14 +217,13 @@ public static function rolePermissionProvider(): array
219217
/**
220218
* Test role can.
221219
*
222-
* @dataProvider rolePermissionProvider
223-
*
224220
* @param int $roleId
225221
* @param int $permissionId
226222
* @param bool $result
227223
*
228224
* @return void
229225
*/
226+
#[DataProvider('rolePermissionProvider')]
230227
public function testRoleCan(int $roleId, int $permissionId, bool $result): void
231228
{
232229
/** @var RoleExtended Role Class. */
@@ -240,14 +237,13 @@ public function testRoleCan(int $roleId, int $permissionId, bool $result): void
240237
/**
241238
* Test role can by id.
242239
*
243-
* @dataProvider rolePermissionProvider
244-
*
245240
* @param int $roleId
246241
* @param int $permissionId
247242
* @param bool $result
248243
*
249244
* @return void
250245
*/
246+
#[DataProvider('rolePermissionProvider')]
251247
public function testRoleCanById(int $roleId, int $permissionId, bool $result): void
252248
{
253249
/** @var RoleExtended Role Class. */
@@ -259,14 +255,13 @@ public function testRoleCanById(int $roleId, int $permissionId, bool $result): v
259255
/**
260256
* Test role can by name.
261257
*
262-
* @dataProvider rolePermissionProvider
263-
*
264258
* @param int $roleId
265259
* @param int $permissionId
266260
* @param bool $result
267261
*
268262
* @return void
269263
*/
264+
#[DataProvider('rolePermissionProvider')]
270265
public function testRoleCanByName(int $roleId, int $permissionId, bool $result): void
271266
{
272267
/** @var RoleExtended Role Class. */

0 commit comments

Comments
 (0)