File tree Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -13,4 +13,5 @@ vendor/*
13
13
/.travis /
14
14
/vendor-bin /require-checker /vendor /
15
15
/vendor-bin /couscous /vendor /
16
- .phpunit.result.cache
16
+ .phpunit.result.cache
17
+ tdbm.lock.yml
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /*
3
+ * This file has been automatically generated by TDBM.
4
+ * You can edit this file as it will not be overwritten.
5
+ */
6
+
7
+ declare (strict_types=1 );
8
+
9
+ namespace TheCodingMachine \TDBM \Dao ;
10
+
11
+ use TheCodingMachine \TDBM \ResultIterator ;
12
+ use TheCodingMachine \TDBM \Test \Dao \Generated \PersonBaseDao ;
13
+
14
+ /**
15
+ * The ContactDao class will maintain the persistence of ContactBean class into the contact table.
16
+ */
17
+ class TestPersonDao extends PersonBaseDao
18
+ {
19
+ public function testFindFromRawSQLONInherited (): ResultIterator
20
+ {
21
+ $ sql = '
22
+ SELECT DISTINCT person.*, contact.*, users.*
23
+ FROM person JOIN contact ON person.id = contact.id
24
+ JOIN users ON contact.id = users.id
25
+ WHERE TRUE
26
+ ' ;
27
+
28
+ return $ this ->findFromRawSql ($ sql , []);
29
+ }
30
+ }
Original file line number Diff line number Diff line change 32
32
use ReflectionMethod ;
33
33
use TheCodingMachine \TDBM \Dao \TestArticleDao ;
34
34
use TheCodingMachine \TDBM \Dao \TestCountryDao ;
35
+ use TheCodingMachine \TDBM \Dao \TestPersonDao ;
35
36
use TheCodingMachine \TDBM \Dao \TestRoleDao ;
36
37
use TheCodingMachine \TDBM \Dao \TestUserDao ;
37
38
use TheCodingMachine \TDBM \Fixtures \Interfaces \TestUserDaoInterface ;
@@ -2178,4 +2179,13 @@ public function testFindByDateTime(): void
2178
2179
$ personDao ->findByModifiedAt (new \DateTimeImmutable ())->count ();
2179
2180
$ this ->assertTrue (true );
2180
2181
}
2182
+
2183
+ public function testFindFromRawSQLOnInheritance (): void
2184
+ {
2185
+ $ dao = new TestPersonDao ($ this ->tdbmService );
2186
+ $ objects = $ dao ->testFindFromRawSQLONInherited ();
2187
+
2188
+ $ this ->assertNotNull ($ objects ->first ());
2189
+ $ this ->assertNotEquals (0 , $ objects ->count ());
2190
+ }
2181
2191
}
You can’t perform that action at this time.
0 commit comments