Loading src/Driver/Postgresql/SequenceManager.php +3 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,9 @@ class SequenceManager extends AbstractManager implements SequenceManagerInterfac $name = Util::fullObjectName($data['schema'] ?? null, $data['name']); $sql = "CREATE SEQUENCE $name INCREMENT BY 1 MINVALUE 1"; $minValue = isset($data['minvalue']) ? (int)$data['minvalue'] : 1; $sql = "CREATE SEQUENCE $name INCREMENT BY 1 MINVALUE $minValue"; $this->addQuery($sql, 'Ajout de la séquence ' . $name); } Loading src/Driver/Postgresql/TableManager.php +269 −113 File changed.Preview size limit exceeded, changes collapsed. Show changes tests/AbstractBddProtocoleTestCase.php +8 −2 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ abstract class AbstractBddProtocoleTestCase extends AbstractBddTestCase } if (isset($action['expected'])) { if (is_array($action['expected'])) { $this->assertArrayEquals($action['expected'], $result, true); $this->assertArrayEquals($result, $action['expected']); } else { $this->assertEquals($action['expected'], $result); } Loading @@ -43,7 +43,13 @@ abstract class AbstractBddProtocoleTestCase extends AbstractBddTestCase $this->assertTrue(true); } } catch (\Exception $e) { echo "\n" . $this->bddName . ' ' . $action['manager'] . '->' . $action['method'] . ' : ' . $e->getMessage(); echo "\n" . $this->bddName . ' ' . $action['manager'] . '->' . $action['method'] . ' : ' . $e->getMessage()."\n"; echo $e->getFile().' line '.$e->getLine()."\n"; foreach( $e->getTrace() as $t){ if (str_contains($t['file'], '/bddadmin/')){ echo $t['file'] . ' line ' . $t['line'] . "\n"; } } $this->assertTrue(false); } } Loading tests/CustomTest.php +2 −3 Original line number Diff line number Diff line Loading @@ -8,11 +8,10 @@ final class CustomTest extends AbstractBddTestCase { protected string $bddName = 'Postgresql'; public function testSeq() { $l = $this->bdd->table()->getList(); var_dump($l); $this->assertTrue(true); } Loading tests/PostgresqlTest.php +9 −0 Original line number Diff line number Diff line Loading @@ -3,4 +3,13 @@ final class PostgresqlTest extends AbstractBddProtocoleTestCase { protected string $bddName = 'Postgresql'; protected function setUp(): void { parent::setUp(); $sql = "DROP SCHEMA IF EXISTS bddadmintests CASCADE"; $this->bdd->exec($sql); } } Loading
src/Driver/Postgresql/SequenceManager.php +3 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,9 @@ class SequenceManager extends AbstractManager implements SequenceManagerInterfac $name = Util::fullObjectName($data['schema'] ?? null, $data['name']); $sql = "CREATE SEQUENCE $name INCREMENT BY 1 MINVALUE 1"; $minValue = isset($data['minvalue']) ? (int)$data['minvalue'] : 1; $sql = "CREATE SEQUENCE $name INCREMENT BY 1 MINVALUE $minValue"; $this->addQuery($sql, 'Ajout de la séquence ' . $name); } Loading
src/Driver/Postgresql/TableManager.php +269 −113 File changed.Preview size limit exceeded, changes collapsed. Show changes
tests/AbstractBddProtocoleTestCase.php +8 −2 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ abstract class AbstractBddProtocoleTestCase extends AbstractBddTestCase } if (isset($action['expected'])) { if (is_array($action['expected'])) { $this->assertArrayEquals($action['expected'], $result, true); $this->assertArrayEquals($result, $action['expected']); } else { $this->assertEquals($action['expected'], $result); } Loading @@ -43,7 +43,13 @@ abstract class AbstractBddProtocoleTestCase extends AbstractBddTestCase $this->assertTrue(true); } } catch (\Exception $e) { echo "\n" . $this->bddName . ' ' . $action['manager'] . '->' . $action['method'] . ' : ' . $e->getMessage(); echo "\n" . $this->bddName . ' ' . $action['manager'] . '->' . $action['method'] . ' : ' . $e->getMessage()."\n"; echo $e->getFile().' line '.$e->getLine()."\n"; foreach( $e->getTrace() as $t){ if (str_contains($t['file'], '/bddadmin/')){ echo $t['file'] . ' line ' . $t['line'] . "\n"; } } $this->assertTrue(false); } } Loading
tests/CustomTest.php +2 −3 Original line number Diff line number Diff line Loading @@ -8,11 +8,10 @@ final class CustomTest extends AbstractBddTestCase { protected string $bddName = 'Postgresql'; public function testSeq() { $l = $this->bdd->table()->getList(); var_dump($l); $this->assertTrue(true); } Loading
tests/PostgresqlTest.php +9 −0 Original line number Diff line number Diff line Loading @@ -3,4 +3,13 @@ final class PostgresqlTest extends AbstractBddProtocoleTestCase { protected string $bddName = 'Postgresql'; protected function setUp(): void { parent::setUp(); $sql = "DROP SCHEMA IF EXISTS bddadmintests CASCADE"; $this->bdd->exec($sql); } }