diff --git a/VERSIONS_WIP/73311 b/VERSIONS_WIP/73311 new file mode 100644 index 0000000000000000000000000000000000000000..c6d40a11bb329ee9f07541a3dc24c51b05f686ad --- /dev/null +++ b/VERSIONS_WIP/73311 @@ -0,0 +1 @@ + - ticket #73311 : Ajout d'indicateurs dans le rapport système \ No newline at end of file diff --git a/library/Class/Systeme/Report.php b/library/Class/Systeme/Report.php index 376f190e6996d2177d6906b5f09c4969be62d33e..b9e0002245d245ccccb88d83fc1a6f286faeb297 100644 --- a/library/Class/Systeme/Report.php +++ b/library/Class/Systeme/Report.php @@ -79,6 +79,8 @@ 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('php', $this->_('PHP'), PHP_VERSION); } } @@ -222,7 +224,8 @@ class Class_Systeme_Report_Libraries extends Class_Systeme_Report_Abstract { 'address' => $this->_('Adresse'), 'postal_code' => $this->_('CP'), 'city' => $this->_('Ville'), - 'coordinates' => $this->_('Coordonnées')]); + 'coordinates' => $this->_('Coordonnées'), + 'redmine_login' => $this->_('Compte forge')]); foreach(Class_Bib::findAll() as $library) $this->_reportLibrary($library, $visitor); @@ -236,7 +239,8 @@ class Class_Systeme_Report_Libraries extends Class_Systeme_Report_Abstract { 'postal_code' => $library->getCp(), 'city' => $library->getVille(), 'coordinates' => ['latitude' => $library->getLatitude(), - 'longitude' => $library->getLongitude()]]); + 'longitude' => $library->getLongitude()], + 'redmine_login' => $library->getRedmineLogin()]); } } diff --git a/tests/library/ZendAfi/View/Helper/Status/HtmlTest.php b/tests/library/ZendAfi/View/Helper/Status/HtmlTest.php index 7f7e792f8f67929dd67e0d6e3ef8139c976b9b4e..77dd3482f75854f200596410f296399af7fe8609 100644 --- a/tests/library/ZendAfi/View/Helper/Status/HtmlTest.php +++ b/tests/library/ZendAfi/View/Helper/Status/HtmlTest.php @@ -28,7 +28,7 @@ class ZendAfi_View_Helper_Status_HtmlTest extends ZendAfi_View_Helper_Status_Tes public function setUp() { parent::setUp(); - $disk = Storm_Test_ObjectWrapper::mock() + $disk = $this->mock() ->whenCalled('diskSpaceInfo') ->answers((new Class_Entity) ->setFree('0 o') @@ -66,6 +66,14 @@ class ZendAfi_View_Helper_Status_HtmlTest extends ZendAfi_View_Helper_Status_Tes } + /** @test */ + public function phpVersionShouldBePresent() { + $this->assertXPathContentContains($this->_html, + '//dl/dd[preceding-sibling::dt[text()="PHP"]]', + PHP_VERSION); + } + + /** @test */ public function uniqueIdentifierShouldBe2345abc() { $this->assertXPathContentContains($this->_html, @@ -196,6 +204,12 @@ class ZendAfi_View_Helper_Status_HtmlTest extends ZendAfi_View_Helper_Status_Tes } + /** @test */ + public function libraryAstaingRedmineLoginShouldBePresent() { + $this->assertXPathContentContains($this->_html, '//td', '@account@sigb-opac'); + } + + /** @test */ public function variableOnOffBibnumShouldBeDisplayed() { $this->assertXPathContentContains($this->_html, diff --git a/tests/library/ZendAfi/View/Helper/Status/JsonTest.php b/tests/library/ZendAfi/View/Helper/Status/JsonTest.php index 31b40663fa242d4725d2ab4df66be98e371d832d..f1ac191cb07aa0d993f8bd6d5a6dfa29348df0d1 100644 --- a/tests/library/ZendAfi/View/Helper/Status/JsonTest.php +++ b/tests/library/ZendAfi/View/Helper/Status/JsonTest.php @@ -57,6 +57,12 @@ class ZendAfi_View_Helper_Status_JsonTest extends ZendAfi_View_Helper_Status_Tes } + /** @test */ + public function phpVersionShouldBePresent() { + $this->assertEquals(PHP_VERSION, $this->_report['headers']['php']); + } + + /** @test */ public function headersBUIDShouldBeGenerated() { $this->assertNotEmpty($this->_report['headers']['buid']); @@ -369,16 +375,15 @@ class ZendAfi_View_Helper_Status_JsonTest extends ZendAfi_View_Helper_Status_Tes /** @test */ public function librayAnstaingShouldDisplayAdressAndCoordinates() { $this->assertContains(['label' => 'Anstaing / Bibliothèque municipale', - 'address' => "Place Jules Guesde", - 'postal_code' => "59152", - "city" => "Anstaing", - "coordinates" => [ - "latitude"=> "11111", - "longitude" => "22222"] + 'address' => 'Place Jules Guesde', + 'postal_code' => '59152', + 'city' => 'Anstaing', + 'coordinates' => [ + 'latitude'=> '11111', + 'longitude' => '22222'], + 'redmine_login' => '@account@sigb-opac', ], $this->_report['libraries']); - - } diff --git a/tests/library/ZendAfi/View/Helper/Status/TestCase.php b/tests/library/ZendAfi/View/Helper/Status/TestCase.php index 1db5574cd8fe959c2df04013b7036ea110305298..00e8ad51d2910ffd04d85f56a738ff089cfb73e5 100644 --- a/tests/library/ZendAfi/View/Helper/Status/TestCase.php +++ b/tests/library/ZendAfi/View/Helper/Status/TestCase.php @@ -142,7 +142,8 @@ abstract class ZendAfi_View_Helper_Status_TestCase extends ViewHelperTestCase { 'adresse' => 'Place Jules Guesde', 'cp' => '59152', 'ville' => 'Anstaing', 'lieu' => $anstaing, - 'visibilite' => 2]); + 'visibilite' => 2, + 'redmine_login' => '@account@sigb-opac']); Class_AdminVar::newInstanceWithId('KOHA_MULTI_SITES', ['valeur' => '' ]); return $this;