Skip to content
Snippets Groups Projects
Commit c853afd7 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

Revert "hotline #23767 - Fix dedup while adding author to an album"

This reverts commit 16a9b82d.
parent f2ffddb3
Branches
Tags 7.0.19
5 merge requests!896Master,!893Master,!878Hotline master,!877Stable,!869Master
......@@ -6,8 +6,6 @@
- ticket #24816 : La position des boîtes est gardée après réattribution d'un identifiant.
- ticket #23767: Corrige le dédoublonage des auteurs d'album.
12/05/2015 - v7.0.18
......
......@@ -1556,7 +1556,7 @@ class Class_Album extends Storm_Model_Abstract {
$found = false;
foreach($this->getAuthors() as $author) {
if ($name == $author->getName() && $function == $author->getResponsibility()) {
if ($name == $author['a'] && $function == $author['4']) {
$found = true;
break;
}
......
<?php
/**
* Copyright (c) 2012, 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 AlbumAuthorAddingTest extends Storm_Test_ModelTestCase {
protected $_album;
public function setUp() {
parent::setUp();
$this->_album = $this->fixture('Class_Album', ['id' => 784,
'titre' => "Charlie's Country"]);
$this->_album->addAuthor('Djigirr Peter', '005');
}
/** @test */
public function albumShouldHaveOneAuthor() {
$this->assertCount(1, $this->_album->getAuthors());
}
/** @test */
public function authorOneNameShouldBeDjigirrPeter() {
$authorOne = $this->_album->getAuthors()[0];
$this->assertEquals('Djigirr Peter', $authorOne->getName());
}
/** @test */
public function authorOneFunctionShouldBe005() {
$authorOne = $this->_album->getAuthors()[0];
$this->assertEquals('005', $authorOne->getResponsibility());
}
/** @test */
public function addingSameAuthorWithSameFunctionShouldDedupIt() {
$this->_album->addAuthor('Djigirr Peter', '005');
$this->assertCount(1, $this->_album->getAuthors());
}
}
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