File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 1717 * You can obtain one at https://mozilla.org/MPL/2.0/.
1818 * @license MPL-2.0 https://mozilla.org/MPL/2.0/
1919 * @source https://github.com/wdes/simple-php-model-system
20- * @version 1.2.0
20+ * @version 1.2.1
2121 */
2222
2323/**
@@ -154,6 +154,14 @@ public function getConnection(): PDO
154154 return $ this ->connection ;
155155 }
156156
157+ /**
158+ * @since 1.2.1
159+ */
160+ public function getDbName (): string
161+ {
162+ return $ this ->dbConfig ['name ' ];
163+ }
164+
157165 /**
158166 * Access the database instance
159167 *
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types = 1 );
4+
5+ namespace SimplePhpModelSystem \Test \Models ;
6+
7+ use SimplePhpModelSystem \Database ;
8+ use SimplePhpModelSystem \Tests \DatabaseAbstractTestCase ;
9+
10+ class DatabaseTest extends DatabaseAbstractTestCase
11+ {
12+
13+ public function testGetDbName (): void
14+ {
15+ $ this ->assertNotEmpty (Database::getInstance ()->getDbName ());
16+ }
17+
18+ }
You can’t perform that action at this time.
0 commit comments