diff --git a/tests/db/UpgradeDBTest.php b/tests/db/UpgradeDBTest.php index f3d9dfbb58f2c0cdb860c83f0093d00e78bed473..0e5b7063fc8c687289208afc1f339263f6d686e1 100644 --- a/tests/db/UpgradeDBTest.php +++ b/tests/db/UpgradeDBTest.php @@ -4397,10 +4397,65 @@ class UpgradeDB_428_Test extends UpgradeDBTestCase { class UpgradeDB_429_Test extends UpgradeDBTestCase { - public function prepare() {} + + public function prepare() { + $this + ->silentQuery('INSERT INTO bib_admin_var (clef, valeur) VALUES ("NUMILOG_OAI_IDBIB", "890")') + ->silentQuery('INSERT INTO album (type_doc_id, titre) VALUES ("106", "update Me")') + ->silentQuery('INSERT INTO codif_type_doc (type_doc_id) VALUES ("106")') + ->silentQuery('DELETE FROM codif_type_doc where type_doc_id="Numilog"'); + } + + + /** @test */ + public function albumUpdateMeDocTypeIdShouldBeNumilog() { + $row = $this->query('select type_doc_id from album where titre="update Me"') + ->fetch(); + + $this->assertEquals('Numilog', $row['type_doc_id'] ?? ''); + } + /** @test */ - public function placeholderForNumilogMigrationPatch() {} + public function adminVarNumilogOaiIdBibShouldHaveBeenRemove() { + $row = $this->query('select valeur from bib_admin_var where clef="NUMILOG_OAI_IDBIB"') + ->fetch(); + $this->assertEquals('', $row['valeur'] ?? ''); + } + + + /** @test */ + public function adminVarNumilogKeyShouldHaveBeenCreatedWith890() { + $row = $this->query('select valeur from bib_admin_var where clef="Numilog_KEY"') + ->fetch(); + $this->assertEquals('890', $row['valeur'] ?? ''); + } + + + /** @test */ + public function codifTypeDoc106ShouldHaveBeenDelete() { + $row = $this->query('select type_doc_id from codif_type_doc where type_doc_id="106"') + ->fetch(); + $this->assertEquals('', $row['type_doc_id'] ?? ''); + } + + + /** @test */ + public function codifTypeDocNumilogShouldHaveBeenCreated() { + $row = $this->query('select type_doc_id from codif_type_doc where type_doc_id="Numilog"') + ->fetch(); + $this->assertEquals('Numilog', $row['type_doc_id'] ?? ''); + } + + + public function tearDown() { + $this + ->silentQuery('delete from codif_type_doc where type_doc_id="Numilog"') + ->silentQuery('delete from album where titre="update Me"') + ->silentQuery('delete from bib_admin_var where clef="NUMILOG_OAI_IDBIB"') + ->silentQuery('delete from bib_admin_var where clef="Numilog_Key"'); + parent::tearDown(); + } }