File tree Expand file tree Collapse file tree 4 files changed +24
-9
lines changed Expand file tree Collapse file tree 4 files changed +24
-9
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,7 @@ public function testGetDbException()
26
26
{
27
27
$ this ->expectException (\UnexpectedValueException::class);
28
28
29
- /** @var DatabaseModelTrait|MockObject $object */
30
- $ object = $ this ->getObjectForTrait (DatabaseModelTrait::class);
29
+ $ object = new TestModelObject ();
31
30
$ object ->getDb ();
32
31
}
33
32
@@ -38,8 +37,7 @@ public function testGetDbException()
38
37
*/
39
38
public function testSetAndGetDb ()
40
39
{
41
- /** @var DatabaseModelTrait|MockObject $object */
42
- $ object = $ this ->getObjectForTrait (DatabaseModelTrait::class);
40
+ $ object = new TestModelObject ();
43
41
44
42
/** @var DatabaseInterface|MockObject $db */
45
43
$ db = $ this ->createMock (DatabaseInterface::class);
Original file line number Diff line number Diff line change @@ -26,8 +26,7 @@ public function testGetStateException()
26
26
{
27
27
$ this ->expectException (\UnexpectedValueException::class);
28
28
29
- /** @var StatefulModelTrait|MockObject $object */
30
- $ object = $ this ->getObjectForTrait (StatefulModelTrait::class);
29
+ $ object = new TestModelObject ();
31
30
$ object ->getState ();
32
31
}
33
32
@@ -38,8 +37,7 @@ public function testGetStateException()
38
37
*/
39
38
public function testSetAndgetState ()
40
39
{
41
- /** @var StatefulModelTrait|MockObject $object */
42
- $ object = $ this ->getObjectForTrait (StatefulModelTrait::class);
40
+ $ object = new TestModelObject ();
43
41
44
42
/** @var Registry|MockObject $state */
45
43
$ state = $ this ->createMock (Registry::class);
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /**
4
+ * @copyright Copyright (C) 2005 - 2021 Open Source Matters, Inc. All rights reserved.
5
+ * @license GNU General Public License version 2 or later; see LICENSE
6
+ */
7
+
8
+ namespace Joomla \Model \Tests ;
9
+
10
+ use Joomla \Model \DatabaseModelInterface ;
11
+ use Joomla \Model \DatabaseModelTrait ;
12
+ use Joomla \Model \StatefulModelInterface ;
13
+ use Joomla \Model \StatefulModelTrait ;
14
+
15
+ class TestModelObject implements DatabaseModelInterface, StatefulModelInterface
16
+ {
17
+ use DatabaseModelTrait,
18
+ StatefulModelTrait;
19
+ }
Original file line number Diff line number Diff line change 11
11
"require-dev" : {
12
12
"joomla/database" : " dev-4.x-dev" ,
13
13
"joomla/registry" : " dev-4.x-dev" ,
14
- "phpunit/phpunit" : " ^9.5.28 " ,
14
+ "phpunit/phpunit" : " ^12.2.7 " ,
15
15
"squizlabs/php_codesniffer" : " ^3.7.2" ,
16
16
"phpstan/phpstan" : " ^2.1.17" ,
17
17
"phpstan/phpstan-deprecation-rules" : " ^2.0.3"
You can’t perform that action at this time.
0 commit comments