@@ -17,7 +17,7 @@ class DatabaseTest extends TestCase
1717 private Database $ database ;
1818
1919 /**
20- * @return void
20+ * @inheritDoc
2121 */
2222 public function setUp (): void
2323 {
@@ -55,35 +55,33 @@ public function testGetName(): void
5555 }
5656
5757 /**
58- * @param string $table
59- * @param string|null $alias
60- * @param string $expectedQuery
61- * @return void
6258 * @covers Database::table
63- * @dataProvider providerTestTable
59+ * @return void
6460 */
65- public function testTable ( string $ table , ? string $ alias , string $ expectedQuery ): void
61+ public function testGetTableWithoutAlias ( ): void
6662 {
67- $ builder = $ this ->database ->table ($ table , $ alias );
68- $ this ->assertEquals ($ expectedQuery , $ builder ->toSql ());
63+ $ builder = $ this ->database ->table ('options ' );
64+ $ this ->assertEquals (
65+ sprintf ('select * from `%s` ' , $ this ->getTable ('options ' )),
66+ $ builder ->toSql ()
67+ );
6968 }
7069
7170 /**
72- * @return \Generator
71+ * @covers Database::table
72+ * @return void
7373 */
74- protected function providerTestTable (): \ Generator
74+ public function testGetTableWithAlias (): void
7575 {
76- yield 'Without alias ' => [
77- 'options ' ,
78- null ,
79- sprintf ('select * from `%s` ' , $ this ->getTable ('options ' )),
80- ];
81-
82- yield 'With alias ' => [
83- 'options ' ,
84- 'opts ' ,
85- sprintf ('select * from `%s` as `opts` ' , $ this ->getTable ('options ' )),
86- ];
76+ $ builder = $ this ->database ->table ('options ' , 'opts ' );
77+ $ this ->assertEquals (
78+ sprintf (
79+ 'select * from `%s` as `%s` ' ,
80+ $ this ->getTable ('options ' ),
81+ $ this ->getTable ('opts ' )
82+ ),
83+ $ builder ->toSql ()
84+ );
8785 }
8886
8987 /**
0 commit comments