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/*
1313/.travis /
1414/vendor-bin /require-checker /vendor /
1515/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 3232use ReflectionMethod ;
3333use TheCodingMachine \TDBM \Dao \TestArticleDao ;
3434use TheCodingMachine \TDBM \Dao \TestCountryDao ;
35+ use TheCodingMachine \TDBM \Dao \TestPersonDao ;
3536use TheCodingMachine \TDBM \Dao \TestRoleDao ;
3637use TheCodingMachine \TDBM \Dao \TestUserDao ;
3738use TheCodingMachine \TDBM \Fixtures \Interfaces \TestUserDaoInterface ;
@@ -2178,4 +2179,13 @@ public function testFindByDateTime(): void
21782179 $ personDao ->findByModifiedAt (new \DateTimeImmutable ())->count ();
21792180 $ this ->assertTrue (true );
21802181 }
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+ }
21812191}
You can’t perform that action at this time.
0 commit comments