diff --git a/library/Class/Album.php b/library/Class/Album.php index ea4d008fbc7371f09cffd7a9f0fc1026a5e295b9..40b505ed6e8a9b2db7367eff74d2752aa241bb19 100644 --- a/library/Class/Album.php +++ b/library/Class/Album.php @@ -109,7 +109,8 @@ class Class_Album extends Storm_Model_Abstract { 'cfg_thumbnails' => '', 'provenance' => '', 'cote' => '', - 'notes' => ''); + 'notes' => '', + 'visible' => true); /** @var Class_Upload */ protected $_uploadHandler; @@ -1048,6 +1049,14 @@ class Class_Album extends Storm_Model_Abstract { } return $values; } + + + /** + * @return boolean + */ + public function isVisible() { + return (bool)$this->getVisible(); + } } ?> \ No newline at end of file diff --git a/tests/library/Class/AlbumTest.php b/tests/library/Class/AlbumTest.php index 236e0b460ac90e3ce022c41f070e09190fb8acfe..398c2e581683f67803a9528fb8e6541f25ac5e2d 100644 --- a/tests/library/Class/AlbumTest.php +++ b/tests/library/Class/AlbumTest.php @@ -84,6 +84,25 @@ class AlbumHarlockBasicTest extends AlbumHarlockTestCase { $this->_album->getPermalink()); } + + /** @test */ + public function albumShouldBeVisible() { + $this->assertTrue($this->_album->isVisible()); + } + + + /** @test */ + public function getVisibleShouldReturnTrue() { + $this->assertTrue($this->_album->getVisible()); + } + + + /** @test */ + public function withVisibleFalseShouldNotBeVisible() { + $this->_album->setVisible(false); + $this->assertFalse($this->_album->isVisible()); + } + /** @test */ public function withIdOrigine_05DC03_PermalinkShouldBeBibNumNoticeIDO_05DC03() { @@ -132,7 +151,8 @@ class AlbumHarlockBasicTest extends AlbumHarlockTestCase { 'matiere' => '', 'provenance' => '', 'cote' => '', - 'editeur' => ''), + 'editeur' => '', + 'visible' => true), $this->_album->toArray()); }