Dblayeroo and Dblayer : {ENGINE} -> ENGINE to be PHP lintable in all the cases
This commit is contained in:
@@ -11,13 +11,13 @@ namespace Domframework\Tests;
|
|||||||
|
|
||||||
use Domframework\Dblayer;
|
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 column name 'group', 'object', 'where', 'with space'
|
||||||
// Test with table name 'group', 'object', 'where', 'with space'
|
// Test with table name 'group', 'object', 'where', 'with space'
|
||||||
// For the 3 DB engines
|
// For the 3 DB engines
|
||||||
|
|
||||||
public $engine = "{ENGINE}";
|
public $engine = "ENGINE";
|
||||||
public $confs = [
|
public $confs = [
|
||||||
"sqlite" => [
|
"sqlite" => [
|
||||||
"dsn" => "sqlite:/tmp/databaseDBLayer.db",
|
"dsn" => "sqlite:/tmp/databaseDBLayer.db",
|
||||||
@@ -47,7 +47,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testDropTable()
|
public function testDropTable()
|
||||||
{
|
{
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$db = new Dblayer(
|
$db = new Dblayer(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -75,7 +75,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
public function testCreateTable1()
|
public function testCreateTable1()
|
||||||
{
|
{
|
||||||
// Create a table named grouped
|
// Create a table named grouped
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$db = new Dblayer(
|
$db = new Dblayer(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -99,7 +99,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testInsert1()
|
public function testInsert1()
|
||||||
{
|
{
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$db = new Dblayer(
|
$db = new Dblayer(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -123,7 +123,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testRead1()
|
public function testRead1()
|
||||||
{
|
{
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$db = new Dblayer(
|
$db = new Dblayer(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -148,7 +148,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testUpdate1()
|
public function testUpdate1()
|
||||||
{
|
{
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$db = new Dblayer(
|
$db = new Dblayer(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -170,7 +170,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testRead2()
|
public function testRead2()
|
||||||
{
|
{
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$db = new Dblayer(
|
$db = new Dblayer(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -195,7 +195,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testUpdate2()
|
public function testUpdate2()
|
||||||
{
|
{
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$db = new Dblayer(
|
$db = new Dblayer(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -218,7 +218,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testRead3()
|
public function testRead3()
|
||||||
{
|
{
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$db = new Dblayer(
|
$db = new Dblayer(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -243,7 +243,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testUpdate3()
|
public function testUpdate3()
|
||||||
{
|
{
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$db = new Dblayer(
|
$db = new Dblayer(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -277,7 +277,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
public function testCreateTable2()
|
public function testCreateTable2()
|
||||||
{
|
{
|
||||||
// Create a table named group
|
// Create a table named group
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$db = new Dblayer(
|
$db = new Dblayer(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -306,7 +306,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testInsert2()
|
public function testInsert2()
|
||||||
{
|
{
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$db = new Dblayer(
|
$db = new Dblayer(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -335,7 +335,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
// Test the unique feature
|
// Test the unique feature
|
||||||
public function testInsert3()
|
public function testInsert3()
|
||||||
{
|
{
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$db = new Dblayer(
|
$db = new Dblayer(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -362,7 +362,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testInsert4()
|
public function testInsert4()
|
||||||
{
|
{
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$db = new Dblayer(
|
$db = new Dblayer(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -395,7 +395,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Create a table named group
|
// Create a table named group
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$db = new Dblayer(
|
$db = new Dblayer(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -432,7 +432,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
public function testCreateTable3()
|
public function testCreateTable3()
|
||||||
{
|
{
|
||||||
// Create a table named group
|
// Create a table named group
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$db = new Dblayer(
|
$db = new Dblayer(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -454,7 +454,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testReadOR1()
|
public function testReadOR1()
|
||||||
{
|
{
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$db = new Dblayer(
|
$db = new Dblayer(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
|
|||||||
@@ -11,13 +11,13 @@ namespace Domframework\Tests;
|
|||||||
|
|
||||||
use Domframework\Dblayeroo;
|
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 column name 'group', 'object', 'where', 'with space'
|
||||||
// Test with table name 'group', 'object', 'where', 'with space'
|
// Test with table name 'group', 'object', 'where', 'with space'
|
||||||
// For the 3 DB engines
|
// For the 3 DB engines
|
||||||
|
|
||||||
public $engine = "{ENGINE}";
|
public $engine = "ENGINE";
|
||||||
public $confs = [
|
public $confs = [
|
||||||
"sqlite" => [
|
"sqlite" => [
|
||||||
"dsn" => "sqlite:/tmp/databaseDBLayeroo.db",
|
"dsn" => "sqlite:/tmp/databaseDBLayeroo.db",
|
||||||
@@ -44,7 +44,7 @@ class DblayerooTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
private function tbl1()
|
private function tbl1()
|
||||||
{
|
{
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$tbl1 = new Dblayeroo(
|
$tbl1 = new Dblayeroo(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -64,7 +64,7 @@ class DblayerooTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
private function tbl2()
|
private function tbl2()
|
||||||
{
|
{
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$tbl2 = new Dblayeroo(
|
$tbl2 = new Dblayeroo(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -86,7 +86,7 @@ class DblayerooTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
private function tbl3()
|
private function tbl3()
|
||||||
{
|
{
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$tbl3 = new Dblayeroo(
|
$tbl3 = new Dblayeroo(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -98,7 +98,7 @@ class DblayerooTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
private function tbl4()
|
private function tbl4()
|
||||||
{
|
{
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$tbl4 = new Dblayeroo(
|
$tbl4 = new Dblayeroo(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
@@ -119,7 +119,7 @@ class DblayerooTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testDropTable()
|
public function testDropTable()
|
||||||
{
|
{
|
||||||
$dbconfig = $this->confs["{ENGINE}"];
|
$dbconfig = $this->confs["ENGINE"];
|
||||||
$db = new Dblayeroo(
|
$db = new Dblayeroo(
|
||||||
$dbconfig["dsn"],
|
$dbconfig["dsn"],
|
||||||
$dbconfig["username"],
|
$dbconfig["username"],
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ define("PHPUNIT", "ON-GOING");
|
|||||||
file_put_contents(
|
file_put_contents(
|
||||||
"Tests/DblayerooSqliteTest.php",
|
"Tests/DblayerooSqliteTest.php",
|
||||||
str_replace(
|
str_replace(
|
||||||
"{ENGINE}",
|
"ENGINE",
|
||||||
"sqlite",
|
"sqlite",
|
||||||
file_get_contents("Tests/DblayerooComplet.php")
|
file_get_contents("Tests/DblayerooComplet.php")
|
||||||
)
|
)
|
||||||
@@ -33,7 +33,7 @@ file_put_contents(
|
|||||||
file_put_contents(
|
file_put_contents(
|
||||||
"Tests/DblayerooMySQLTest.php",
|
"Tests/DblayerooMySQLTest.php",
|
||||||
str_replace(
|
str_replace(
|
||||||
"{ENGINE}",
|
"ENGINE",
|
||||||
"mysql",
|
"mysql",
|
||||||
file_get_contents("Tests/DblayerooComplet.php")
|
file_get_contents("Tests/DblayerooComplet.php")
|
||||||
)
|
)
|
||||||
@@ -41,7 +41,7 @@ file_put_contents(
|
|||||||
file_put_contents(
|
file_put_contents(
|
||||||
"Tests/DblayerooPostgreSQLTest.php",
|
"Tests/DblayerooPostgreSQLTest.php",
|
||||||
str_replace(
|
str_replace(
|
||||||
"{ENGINE}",
|
"ENGINE",
|
||||||
"pgsql",
|
"pgsql",
|
||||||
file_get_contents("Tests/DblayerooComplet.php")
|
file_get_contents("Tests/DblayerooComplet.php")
|
||||||
)
|
)
|
||||||
@@ -49,7 +49,7 @@ file_put_contents(
|
|||||||
file_put_contents(
|
file_put_contents(
|
||||||
"Tests/DblayerSqliteTest.php",
|
"Tests/DblayerSqliteTest.php",
|
||||||
str_replace(
|
str_replace(
|
||||||
"{ENGINE}",
|
"ENGINE",
|
||||||
"sqlite",
|
"sqlite",
|
||||||
file_get_contents("Tests/DblayerComplet.php")
|
file_get_contents("Tests/DblayerComplet.php")
|
||||||
)
|
)
|
||||||
@@ -57,7 +57,7 @@ file_put_contents(
|
|||||||
file_put_contents(
|
file_put_contents(
|
||||||
"Tests/DblayerMySQLTest.php",
|
"Tests/DblayerMySQLTest.php",
|
||||||
str_replace(
|
str_replace(
|
||||||
"{ENGINE}",
|
"ENGINE",
|
||||||
"mysql",
|
"mysql",
|
||||||
file_get_contents("Tests/DblayerComplet.php")
|
file_get_contents("Tests/DblayerComplet.php")
|
||||||
)
|
)
|
||||||
@@ -65,7 +65,7 @@ file_put_contents(
|
|||||||
file_put_contents(
|
file_put_contents(
|
||||||
"Tests/DblayerPostgreSQLTest.php",
|
"Tests/DblayerPostgreSQLTest.php",
|
||||||
str_replace(
|
str_replace(
|
||||||
"{ENGINE}",
|
"ENGINE",
|
||||||
"pgsql",
|
"pgsql",
|
||||||
file_get_contents("Tests/DblayerComplet.php")
|
file_get_contents("Tests/DblayerComplet.php")
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user