From a2e103c32f0a9661ef9b9fcb101a179bf34adbe6 Mon Sep 17 00:00:00 2001 From: Dominique FOURNIER Date: Fri, 14 Apr 2023 21:15:49 +0200 Subject: [PATCH] Dblayeroo and Dblayer : {ENGINE} -> ENGINE to be PHP lintable in all the cases --- Tests/DblayerComplet.php | 36 ++++++++++++++++++------------------ Tests/DblayerooComplet.php | 14 +++++++------- Tests/autoload.php.dist | 12 ++++++------ 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Tests/DblayerComplet.php b/Tests/DblayerComplet.php index 4c2383c..d0a95ef 100644 --- a/Tests/DblayerComplet.php +++ b/Tests/DblayerComplet.php @@ -11,13 +11,13 @@ namespace Domframework\Tests; use Domframework\Dblayer; -class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase +class DblayerTestENGINE extends \PHPUnit_Framework_TestCase { // Test with column name 'group', 'object', 'where', 'with space' // Test with table name 'group', 'object', 'where', 'with space' // For the 3 DB engines - public $engine = "{ENGINE}"; + public $engine = "ENGINE"; public $confs = [ "sqlite" => [ "dsn" => "sqlite:/tmp/databaseDBLayer.db", @@ -47,7 +47,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase */ public function testDropTable() { - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $db = new Dblayer( $dbconfig["dsn"], $dbconfig["username"], @@ -75,7 +75,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase public function testCreateTable1() { // Create a table named grouped - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $db = new Dblayer( $dbconfig["dsn"], $dbconfig["username"], @@ -99,7 +99,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase */ public function testInsert1() { - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $db = new Dblayer( $dbconfig["dsn"], $dbconfig["username"], @@ -123,7 +123,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase public function testRead1() { - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $db = new Dblayer( $dbconfig["dsn"], $dbconfig["username"], @@ -148,7 +148,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase public function testUpdate1() { - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $db = new Dblayer( $dbconfig["dsn"], $dbconfig["username"], @@ -170,7 +170,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase public function testRead2() { - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $db = new Dblayer( $dbconfig["dsn"], $dbconfig["username"], @@ -195,7 +195,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase public function testUpdate2() { - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $db = new Dblayer( $dbconfig["dsn"], $dbconfig["username"], @@ -218,7 +218,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase public function testRead3() { - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $db = new Dblayer( $dbconfig["dsn"], $dbconfig["username"], @@ -243,7 +243,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase public function testUpdate3() { - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $db = new Dblayer( $dbconfig["dsn"], $dbconfig["username"], @@ -277,7 +277,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase public function testCreateTable2() { // Create a table named group - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $db = new Dblayer( $dbconfig["dsn"], $dbconfig["username"], @@ -306,7 +306,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase public function testInsert2() { - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $db = new Dblayer( $dbconfig["dsn"], $dbconfig["username"], @@ -335,7 +335,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase // Test the unique feature public function testInsert3() { - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $db = new Dblayer( $dbconfig["dsn"], $dbconfig["username"], @@ -362,7 +362,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase public function testInsert4() { - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $db = new Dblayer( $dbconfig["dsn"], $dbconfig["username"], @@ -395,7 +395,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase { // Create a table named group - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $db = new Dblayer( $dbconfig["dsn"], $dbconfig["username"], @@ -432,7 +432,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase public function testCreateTable3() { // Create a table named group - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $db = new Dblayer( $dbconfig["dsn"], $dbconfig["username"], @@ -454,7 +454,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase */ public function testReadOR1() { - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $db = new Dblayer( $dbconfig["dsn"], $dbconfig["username"], diff --git a/Tests/DblayerooComplet.php b/Tests/DblayerooComplet.php index c3cd45c..302ceab 100644 --- a/Tests/DblayerooComplet.php +++ b/Tests/DblayerooComplet.php @@ -11,13 +11,13 @@ namespace Domframework\Tests; use Domframework\Dblayeroo; -class DblayerooTest{ENGINE} extends \PHPUnit_Framework_TestCase +class DblayerooTestENGINE extends \PHPUnit_Framework_TestCase { // Test with column name 'group', 'object', 'where', 'with space' // Test with table name 'group', 'object', 'where', 'with space' // For the 3 DB engines - public $engine = "{ENGINE}"; + public $engine = "ENGINE"; public $confs = [ "sqlite" => [ "dsn" => "sqlite:/tmp/databaseDBLayeroo.db", @@ -44,7 +44,7 @@ class DblayerooTest{ENGINE} extends \PHPUnit_Framework_TestCase private function tbl1() { - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $tbl1 = new Dblayeroo( $dbconfig["dsn"], $dbconfig["username"], @@ -64,7 +64,7 @@ class DblayerooTest{ENGINE} extends \PHPUnit_Framework_TestCase private function tbl2() { - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $tbl2 = new Dblayeroo( $dbconfig["dsn"], $dbconfig["username"], @@ -86,7 +86,7 @@ class DblayerooTest{ENGINE} extends \PHPUnit_Framework_TestCase private function tbl3() { - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $tbl3 = new Dblayeroo( $dbconfig["dsn"], $dbconfig["username"], @@ -98,7 +98,7 @@ class DblayerooTest{ENGINE} extends \PHPUnit_Framework_TestCase private function tbl4() { - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $tbl4 = new Dblayeroo( $dbconfig["dsn"], $dbconfig["username"], @@ -119,7 +119,7 @@ class DblayerooTest{ENGINE} extends \PHPUnit_Framework_TestCase public function testDropTable() { - $dbconfig = $this->confs["{ENGINE}"]; + $dbconfig = $this->confs["ENGINE"]; $db = new Dblayeroo( $dbconfig["dsn"], $dbconfig["username"], diff --git a/Tests/autoload.php.dist b/Tests/autoload.php.dist index 4d1d8c3..59217de 100644 --- a/Tests/autoload.php.dist +++ b/Tests/autoload.php.dist @@ -25,7 +25,7 @@ define("PHPUNIT", "ON-GOING"); file_put_contents( "Tests/DblayerooSqliteTest.php", str_replace( - "{ENGINE}", + "ENGINE", "sqlite", file_get_contents("Tests/DblayerooComplet.php") ) @@ -33,7 +33,7 @@ file_put_contents( file_put_contents( "Tests/DblayerooMySQLTest.php", str_replace( - "{ENGINE}", + "ENGINE", "mysql", file_get_contents("Tests/DblayerooComplet.php") ) @@ -41,7 +41,7 @@ file_put_contents( file_put_contents( "Tests/DblayerooPostgreSQLTest.php", str_replace( - "{ENGINE}", + "ENGINE", "pgsql", file_get_contents("Tests/DblayerooComplet.php") ) @@ -49,7 +49,7 @@ file_put_contents( file_put_contents( "Tests/DblayerSqliteTest.php", str_replace( - "{ENGINE}", + "ENGINE", "sqlite", file_get_contents("Tests/DblayerComplet.php") ) @@ -57,7 +57,7 @@ file_put_contents( file_put_contents( "Tests/DblayerMySQLTest.php", str_replace( - "{ENGINE}", + "ENGINE", "mysql", file_get_contents("Tests/DblayerComplet.php") ) @@ -65,7 +65,7 @@ file_put_contents( file_put_contents( "Tests/DblayerPostgreSQLTest.php", str_replace( - "{ENGINE}", + "ENGINE", "pgsql", file_get_contents("Tests/DblayerComplet.php") )