Added files

This commit is contained in:
absurdo 2023-10-27 14:41:39 +02:00
commit bdab68afd3
5 changed files with 230 additions and 0 deletions

43
tests/WPDOTest.php Normal file
View file

@ -0,0 +1,43 @@
<?php
use PhangoApp\WPDO;
use PhangoApp\PhaUtils\Utils;
use PHPUnit\Framework\TestCase;
include("vendor/autoload.php");
Utils::load_config('config', 'settings');
$sql_table="CREATE TABLE table_test (
`name` VARCHAR(255) NOT NULL default '',
`last_name` VARCHAR(255) NOT NULL default '',
`type` INT NOT NULL
);";
$pdo=new WPDO('table_test', ['name', 'last_name', 'type']);
$pdo->connect();
final class WPDOTest extends TestCase {
public function testCreateTable()
{
global $pdo;
$this->assertTrue($pdo->query($sql_table));
}
/**
* @depends testCreateTable
*/
public function testDropTable()
{
global $pdo;
$this->assertTrue($pdo->query('drop table table_test'));
}
}