File tree Expand file tree Collapse file tree 6 files changed +19
-36
lines changed Expand file tree Collapse file tree 6 files changed +19
-36
lines changed Original file line number Diff line number Diff line change @@ -37,10 +37,13 @@ class DatabaseTestCase extends CIDatabaseTestCase
37
37
public function setUp (): void
38
38
{
39
39
parent ::setUp ();
40
-
40
+
41
+ cache ()->clean ();
42
+
41
43
// Configure and inject the Schemas service
42
44
$ config = new \Tatter \Schemas \Config \Schemas ();
43
45
$ config ->silent = false ;
46
+ $ config ->ignoredNamespaces = [];
44
47
45
48
$ schemas = new \Tatter \Schemas \Schemas ($ config );
46
49
Services::injectMock ('schemas ' , $ schemas );
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ public function setUp(): void
17
17
// Configure and inject the Schemas service
18
18
$ config = new \Tatter \Schemas \Config \Schemas ();
19
19
$ config ->silent = false ;
20
+ $ config ->ignoredNamespaces = [];
20
21
21
22
$ schemas = new \Tatter \Schemas \Schemas ($ config );
22
23
Services::injectMock ('schemas ' , $ schemas );
Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ class MagicTest extends DatabaseTestCase
11
11
public function setUp (): void
12
12
{
13
13
parent ::setUp ();
14
-
15
- $ this ->factories = new ArrayModel ();
16
- $ this ->factory = new Factory ($ this ->factories -> find ( 1 ) );
14
+
15
+ $ this ->row = $ this -> db -> table ( ' factories ' )-> where ( ' id ' , 1 )-> get ()-> getRowArray ();
16
+ $ this ->factory = new Factory ($ this ->row );
17
17
18
18
$ this ->machines = new MachineModel ();
19
19
$ this ->machine = new Machine ((array ) $ this ->machines ->with (false )->find (7 ));
@@ -26,12 +26,10 @@ public function testGetIgnoresUnmatched()
26
26
27
27
public function testRequiresProperties ()
28
28
{
29
- $ row = $ this ->factories ->find (1 );
30
-
31
29
$ this ->expectException (RelationsException::class);
32
30
$ this ->expectExceptionMessage ('Class Tests\Support\Entities\Propertyless must have the table property to use relations ' );
33
31
34
- $ factory = (new Propertyless ($ row ))->_getRelationship ('foobar ' );
32
+ $ factory = (new Propertyless ($ this -> row ))->_getRelationship ('foobar ' );
35
33
}
36
34
37
35
public function testGetSuccess ()
Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ class ManyMethodsTest extends DatabaseTestCase
9
9
public function setUp (): void
10
10
{
11
11
parent ::setUp ();
12
-
13
- $ this ->factories = new ArrayModel ();
14
- $ this ->factory = new Factory ($ this ->factories -> find ( 1 ) );
12
+
13
+ $ this ->row = $ this -> db -> table ( ' factories ' )-> where ( ' id ' , 1 )-> get ()-> getRowArray ();
14
+ $ this ->factory = new Factory ($ this ->row );
15
15
}
16
16
17
17
public function testHasAnySuccess ()
@@ -23,8 +23,9 @@ public function testHasAnySuccess()
23
23
24
24
public function testHasAnyFail ()
25
25
{
26
- $ factory = new Factory ($ this ->factories ->find (4 ));
27
- $ method = $ this ->getPrivateMethodInvoker ($ factory , '_has ' );
26
+ $ row = $ this ->db ->table ('factories ' )->where ('id ' , 4 )->get ()->getRowArray ();
27
+ $ factory = new Factory ($ row );
28
+ $ method = $ this ->getPrivateMethodInvoker ($ factory , '_has ' );
28
29
29
30
$ this ->assertFalse ($ method ('workers ' ));
30
31
}
Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ class RelationsTest extends DatabaseTestCase
11
11
public function setUp (): void
12
12
{
13
13
parent ::setUp ();
14
-
15
- $ this ->factories = new ArrayModel ();
16
- $ this ->factory = new Factory ($ this ->factories -> find ( 1 ) );
14
+
15
+ $ this ->row = $ this -> db -> table ( ' factories ' )-> where ( ' id ' , 1 )-> get ()-> getRowArray ();
16
+ $ this ->factory = new Factory ($ this ->row );
17
17
}
18
18
19
19
public function testUnknownTableFails ()
@@ -80,7 +80,7 @@ public function testArrayHasMany()
80
80
$ servicers = new ServicerModel ();
81
81
$ object = $ servicers ->with (false )->find (2 );
82
82
$ servicer = new Servicer ((array ) $ object );
83
-
83
+
84
84
$ lawyers = $ servicer ->relations ('lawyers ' );
85
85
86
86
$ this ->assertCount (3 , $ lawyers );
You can’t perform that action at this time.
0 commit comments