Skip to content

Commit 9adba86

Browse files
committed
test: updates mock properties with types
1 parent 7b1e4eb commit 9adba86

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

tests/_support/Helper/MockModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use StellarWP\Models\Model;
66

77
class MockModel extends Model {
8-
protected static $properties = [
8+
protected static array $properties = [
99
'id' => 'int',
1010
'firstName' => [ 'string', 'Michael' ],
1111
'lastName' => 'string',

tests/_support/Helper/MockModelWithAfterConstruct.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use StellarWP\Models\Model;
66

77
class MockModelWithAfterConstruct extends Model {
8-
protected static $properties = [
8+
protected static array $properties = [
99
'id' => 'int',
1010
'name' => 'string',
1111
];

tests/_support/Helper/MockModelWithRelationship.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
namespace StellarWP\Models\Tests;
44

5-
use StellarWP\DB\DB;
65
use StellarWP\Models\Model;
76
use StellarWP\Models\ModelQueryBuilder;
87
use StellarWP\Models\ValueObjects\Relationship;
98

109
class MockModelWithRelationship extends Model {
11-
protected static $properties = [
10+
protected static array $properties = [
1211
'id' => 'int',
1312
];
1413

15-
protected static $relationships = [
14+
protected static array $relationships = [
1615
'relatedButNotCallable' => Relationship::HAS_ONE,
1716
'relatedAndCallableHasOne' => Relationship::HAS_ONE,
1817
'relatedAndCallableHasMany' => Relationship::HAS_MANY,

tests/wpunit/ModelFactoryTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ class MockModel extends Model
318318
{
319319
protected static $autoIncrementId = 1;
320320

321-
protected static $properties = [
321+
protected static array $properties = [
322322
'id' => 'int',
323323
];
324324

@@ -340,7 +340,7 @@ public static function resetAutoIncrementId() {
340340
*/
341341
class MockModelWithDependency extends MockModel
342342
{
343-
protected static $properties = [
343+
protected static array $properties = [
344344
'id' => 'int',
345345
'nestedId' => 'int',
346346
];
@@ -363,7 +363,7 @@ public function __invoke() {
363363
*/
364364
class MockModelWithInvokableProperty extends MockModel
365365
{
366-
protected static $properties = [
366+
protected static array $properties = [
367367
'invokable' => MockInvokableClass::class,
368368
];
369369
}

0 commit comments

Comments
 (0)