Skip to content
Snippets Groups Projects
Commit 731fc03e authored by Laurent's avatar Laurent
Browse files

rel #52281 add database name and BUID in status report

parent 11519582
Branches
Tags
4 merge requests!2080Sandbox detach zf from storm,!2061Master,!1987Dev#52281 1055 seaside meilleur reporting poker 2 envoi du rapport chez afi,!1976Dev#52281 1055 seaside meilleur reporting poker 2 envoi du rapport chez afi
Pipeline #116 passed with stage
in 8 minutes and 34 seconds
- ticket #52281 : 10/55 Seaside : meilleur reporting poker 2 : envoi du rapport chez AFI
\ No newline at end of file
......@@ -167,7 +167,8 @@ class Class_AdminVarLoader extends Storm_Model_Loader {
'TEXT_REPLACEMENTS' => Class_AdminVar_Meta::newRawText($this->_('Remplacement de textes à la volée. <br/>Ex:<br/>Panier;Sélection<br/>Vous avez %%d paniers;Vous avez %%d sélections')),
'URL_COSMOGRAMME' => Class_AdminVar_Meta::newDefault('')->bePrivate(),
'PACK_MOBILE' => Class_AdminVar_Meta::newOnOff($this->_('Activation des fonctions avancées du téléphone'))->bePrivate(),
'CNIL_CONSENT_ENABLE' => Class_AdminVar_Meta::newOnOff('Affiche la demande de consentement avant l\'insertion de cookies ou autres traceurs')],
'CNIL_CONSENT_ENABLE' => Class_AdminVar_Meta::newOnOff('Affiche la demande de consentement avant l\'insertion de cookies ou autres traceurs'),
'BUID' => Class_AdminVar_Meta::newRawText($this->_('Identifiant unique (attention: la modification de cette variable impactera les outils de suivi de cette installation)'))->bePrivate()],
'cosmogramme' => [
'DATE_LAST_FULL_INTEGRATION_USERS' => Class_AdminVar_Meta::newDefault($this->_('Date du dernier import total des abonnés (modifié par cosmogramme)')),
......
<?php
/**
* Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_AdminVar_BUID {
public function getValue() {
if ($buid = Class_AdminVar::get('BUID'))
return $buid;
$buid = hash('crc32b',
uniqid(array_at('dbname',
Zend_Db_Table::getDefaultAdapter()->getConfig())));
Class_AdminVar::set('BUID', $buid);
return $buid;
}
}
\ No newline at end of file
......@@ -67,6 +67,15 @@ class Class_Systeme_Report_Headers extends Class_Systeme_Report_Abstract {
public function acceptVisitor($visitor) {
$visitor->visitDatetime('creation_datetime', $this->_('Généré le'), $this->getCurrentTime());
$visitor->visitData('version', $this->_('Version'), BOKEH_RELEASE_NUMBER);
$visitor->visitData('buid',
$this->_('Identifiant unique'),
(new Class_AdminVar_BUID())->getValue());
$visitor->visitData('database',
$this->_('Base de données'),
array_at('dbname',
Zend_Db_Table::getDefaultAdapter()->getConfig()));
}
}
......
......@@ -27,6 +27,7 @@ class ZendAfi_View_Helper_Status_HtmlTest extends ZendAfi_View_Helper_Status_Tes
public function setUp() {
parent::setUp();
Class_AdminVar::set('BUID', '2345abc');
$this->_html = utf8_decode($this->_helper->status_Html());
}
......@@ -53,6 +54,14 @@ class ZendAfi_View_Helper_Status_HtmlTest extends ZendAfi_View_Helper_Status_Tes
}
/** @test */
public function uniqueIdentifierShouldBe2345abc() {
$this->assertXPathContentContains($this->_html,
'//section/dl/dd[preceding-sibling::dt[text()="Identifiant unique"]]',
'2345abc');
}
/** @test */
public function portalUrlShouldBeLibraryAnnecyDotFr() {
$this->assertXPathContentContains($this->_html,
......
......@@ -50,6 +50,21 @@ class ZendAfi_View_Helper_Status_JsonTest extends ZendAfi_View_Helper_Status_Tes
}
/** @test */
public function headersBUIDShouldBeGenerated() {
$this->assertNotEmpty($this->_report['headers']['buid']);
$this->assertEquals(Class_AdminVar::get('BUID'),
$this->_report['headers']['buid']);
}
/** @test */
public function headersShouldContainsDatabaseName() {
$this->assertEquals(Zend_Db_Table::getDefaultAdapter()->getConfig()['dbname'],
$this->_report['headers']['database']);
}
/** @test */
public function portalLabelShouldBeC2APortal() {
$this->assertEquals('C2A portal', $this->_report['portal']['label']);
......
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