diff --git a/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/DataProfileControllerDublinCoreTest.php b/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/DataProfileControllerDublinCoreTest.php index d4e3da21f233b517b11e92a62f48ecdf966b66a8..a08f7c6ac41cdf42cf54dfb6f8998b2bff2689ce 100644 --- a/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/DataProfileControllerDublinCoreTest.php +++ b/cosmogramme/cosmozend/tests/application/modules/cosmo/controllers/DataProfileControllerDublinCoreTest.php @@ -41,6 +41,7 @@ abstract class Cosmo_DataProfileControllerDublinCoreProfileTestCase extends Cosm + class Cosmo_DataProfileControllerDublinCoreTest extends Cosmo_DataProfileControllerDublinCoreProfileTestCase { public function setUp() { parent::setUp(); @@ -48,28 +49,35 @@ class Cosmo_DataProfileControllerDublinCoreTest extends Cosmo_DataProfileControl } -/** @test */ + /** @test */ public function fileFormatShouldBeDublinCore() { $this->assertXPath('//select/option[@label="Dublin Core"][@value="9"][@selected]'); } -/** @test */ + /** @test */ public function fieldsetDocTypesShouldBePresent() { $this->assertXPathContentContains('//form//fieldset/legend', 'Type de documents'); } -/** @test */ + /** @test */ public function typeDocColumnLabelsShouldBeTypeAndFormat() { $this->assertXPathContentContains('//script', 'fields:[{"name":"1_type","label":"dc:Type"},{"name":"1_format","label":"dc:Format"}]'); } + + + /** @test */ + public function docTypeBibliondemandShouldNotBePresent() { + $this->assertNotXPathContentContains('//script', 'Bibliondemand', $this->_response->getBody()); + } } + class Cosmo_DataProfileControllerDublinCorePostTest extends Cosmo_DataProfileControllerDublinCoreProfileTestCase { public function setUp() { parent::setUp(); diff --git a/library/Class/DigitalResource.php b/library/Class/DigitalResource.php index b3951f3e932375cd7a7dcf17824d459b92d0d765..5e75e54e458e30aed1c9c42b5072dab2a08092fb 100644 --- a/library/Class/DigitalResource.php +++ b/library/Class/DigitalResource.php @@ -189,7 +189,10 @@ class Class_DigitalResource extends Class_Entity { ->injectInto([], function($types, $config) { - $types[$this->getDocType($config->getName())] = $config->getDocTypeLabel(); + if(!$label = $config->getDocTypeLabel()) + return $types; + + $types[$this->getDocType($config->getName())] = $label; return $types; } );