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

Merge branch 'hotline#51096_moissonnage_jamendo_anormalement_long' into 'stable'

hotline #51096 remove Jamendo full harvest

See merge request !1935
parents 960f1ff4 67e289a1
Branches
Tags
3 merge requests!2080Sandbox detach zf from storm,!1943Hotline master,!1942Stable
- ticket #51096 : désactivation du moissonnage total de Jamendo (trop de notices). L'import manuel d'album reste activé.
\ No newline at end of file
......@@ -26,5 +26,10 @@ class Class_Batch_Jamendo extends Class_Batch_RessourceNumerique{
protected function _getService() {
return new Class_WebService_BibNumerique_Jamendo();
}
public function isEnabled() {
return false;
}
}
?>
......@@ -16,7 +16,7 @@
*
* 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
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
......@@ -29,7 +29,10 @@ abstract class Class_Batch_RessourceNumerique extends Class_Batch_Abstract {
}
public function run() {
return $this->_getService()->harvest();
if ($this->isEnabled())
$this->_getService()->harvest();
return $this;
}
public function isEnabled() {
......
......@@ -121,27 +121,6 @@ class BatchLoaderWithoutRessourcesNumeriquesTest extends Storm_Test_ModelTestCas
class BatchLoaderWithRessourcesNumeriquesTest extends Storm_Test_ModelTestCase {
protected $_types;
public function setUp() {
parent::setUp();
Class_Batch::beVolatile();
Class_AdminVar::beVolatile();
RessourcesNumeriquesFixtures::activate();
$this->_types = Class_Batch::getAvailableType();
}
/** @test */
public function ressourcesNumeriquesShouldBeAvailable() {
foreach(array_keys(Class_Batch::getRessourcesNumeriqueTypes()) as $type)
$this->assertTrue(in_array($type, array_keys($this->_types)), $type);
}
}
class BatchIndexRessourcesNumeriquesTest extends Storm_Test_ModelTestCase {
public function setUp() {
$album = $this->fixture('Class_Album', ['id' => 1,
......
......@@ -62,6 +62,24 @@ abstract class JamendoTestCase extends ModelTestCase {
class JamendoBatchTest extends JamendoTestCase {
/**
* @see http://forge.afi-sa.fr/issues/51096
* @test
*/
public function jamendoBatchShouldBeDisabled() {
$this->assertFalse((new Class_Batch_Jamendo())->isEnabled());
}
/** @test */
public function runBatchShouldNotHarvestJamendo() {
(new Class_Batch_Jamendo())->run();
$this->assertCount(0, Class_Album::findAll());
}
}
class JamendoImportTracksFromUrlTest extends JamendoTestCase {
public function setUp() {
......
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