Commit a10b3550 authored by Patrick Barroca's avatar Patrick Barroca 🐧

Merge branch 'hotline#88956_problemes_affichage_realisateur_arte_vod' into 'hotline'

hotline #88956 : system report add expected and actuel patch level

See merge request afi/opacce!3129
parents f638ecf7 0c21ed8d
- ticket #88956 : Rapport système : Ajout du niveau de base de données attendu et courant pour un meilleur diagnostique des mises à jours
\ No newline at end of file
......@@ -81,6 +81,12 @@ class Class_Systeme_Report_Headers extends Class_Systeme_Report_Abstract {
$this->_('Base de données'),
array_at('dbname',
Zend_Db_Table::getDefaultAdapter()->getConfig()));
$visitor->visitData('patch_level',
$this->_('Niveau de patch'),
['expected' => (string)(new Class_Migration_Patchs)->getLastPatchNumber(),
'actual' => Class_CosmoVar::get('patch_level')]);
$visitor->visitData('php', $this->_('PHP'), PHP_VERSION);
}
}
......
......@@ -754,14 +754,39 @@ class IndexControllerStatusTest extends AbstractControllerTestCase {
public function setUp() {
parent::setUp();
Class_AdminVar::set('ALLOWED_DISK_SPACE', 1);
Class_CosmoVar::set('patch_level', '369');
$filesystem = $this->mock()
->whenCalled('glob')
->answers(['cosmogramme/sql/patch/patch_372.php']);
Class_Migration_Patchs::setFileSystem($filesystem);
$this->dispatch('/opac/index/status', true);
$this->_json = json_decode($this->_response->getBody(), true);
}
public function tearDown() {
Class_Migration_Patchs::setFileSystem(null);
parent::tearDown();
}
/** @test */
public function dateCreationShouldBeSet() {
$this->assertNotNull($this->_json['headers']['creation_datetime'], $this->_json);
$this->assertNotNull($this->_json['headers']['creation_datetime']);
}
/** @test */
public function actualPatchLevelShouldBe369() {
$this->assertEquals('369', $this->_json['headers']['patch_level']['actual']);
}
/** @test */
public function expectedPatchLevelShouldBeLastPatchNumber() {
$this->assertEquals('372', $this->_json['headers']['patch_level']['expected']);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment