Skip to content
Snippets Groups Projects
Commit 132e8d77 authored by Sebastien ANDRE's avatar Sebastien ANDRE
Browse files

display batch in admin content_watch

parent 84f5cae8
No related merge requests found
Pipeline #30775 passed with stage
in 20 minutes and 19 seconds
......@@ -102,7 +102,8 @@ class ZendAfi_View_Helper_Admin_ContentWatch extends ZendAfi_View_Helper_BaseHel
if ( ! $this->_user->hasRightAdminContentSupervision())
return '';
$batchs = [Class_Batch_Watching::TYPE => new Class_Batch_Definition(new Class_Batch_Watching)];
$batchs = [Class_Batch_Watching::TYPE => new Class_Batch_Definition(new Class_Batch_Watching),
Class_Batch_WatchingWidget::TYPE => new Class_Batch_Definition(new Class_Batch_WatchingWidget)];
return $this->_tag('h2', $this->_('Traitements automatisés'))
. $this->_table(new Class_TableDescription_Batches('content_watch_batch'),
$batchs);
......
......@@ -150,6 +150,10 @@ abstract class ContentWatchDashboardIndexTestCase extends ContentWatchDashboardE
['id' => 11,
'pick_day' => '1;2;3;4;5;6;0',
'type' => Class_Batch_Watching::TYPE]);
$this->fixture(Class_Batch::class,
['id' => 12,
'pick_day' => '1;2;3;4;5;6;0',
'type' => Class_Batch_WatchingWidget::TYPE]);
$this->_setGroup();
$this->dispatch('/admin/content-watch');
......@@ -491,25 +495,49 @@ class ContentWatchDashboardIndexAsSupervisorTest extends ContentWatchDashboardIn
/** @test */
public function tableBatchShouldBePresentWithTdAlerteSurLesContenus() {
$this->assertXPath('//table[@id="content_watch_batch"]/tbody/tr/td[text()="Alerte sur les contenus à vérifier sur le portail"]');
$this->assertXPath('//table[@id="content_watch_batch"]/tbody/tr[1]/td[text()="Alerte sur les contenus à vérifier sur le portail"]');
}
/** @test */
public function tableBatchShouldBePresentWithTdTousLesJours() {
$this->assertXPath('//table[@id="content_watch_batch"]/tbody/tr/td[text()="Tous les jours"]');
$this->assertXPath('//table[@id="content_watch_batch"]/tbody/tr[1]/td[text()="Tous les jours"]');
}
/** @test */
public function tableBatchShouldBePresentWithTdPlanif() {
$this->assertXPath('//table[@id="content_watch_batch"]/tbody/tr/td/div[@class="actions"]/a[contains(@href, "/admin/batch/plan/id/WATCHING")]/img[@title="Planifier la tâche"]');
$this->assertXPath('//table[@id="content_watch_batch"]/tbody/tr[1]/td/div[@class="actions"]/a[contains(@href, "/admin/batch/plan/id/WATCHING")]/img[@title="Planifier la tâche"]');
}
/** @test */
public function tableBatchShouldBePresentWithTdManualLaunch() {
$this->assertXPath('//table[@id="content_watch_batch"]/tbody/tr/td/div[@class="actions"]/a[contains(@href, "/admin/batch/run/id/WATCHING")]/img[@title="Lancer manuellement"]');
$this->assertXPath('//table[@id="content_watch_batch"]/tbody/tr[1]/td/div[@class="actions"]/a[contains(@href, "/admin/batch/run/id/WATCHING")]/img[@title="Lancer manuellement"]');
}
/** @test */
public function tableBatchWidgetShouldBePresentWithTdAnalyseBoitesVides() {
$this->assertXPath('//table[@id="content_watch_batch"]/tbody/tr[2]/td[text()="Analyse boîtes vides sur le portail"]');
}
/** @test */
public function tableBatchWidgetShouldBePresentWithTdTousLesJours() {
$this->assertXPath('//table[@id="content_watch_batch"]/tbody/tr[2]/td[text()="Tous les jours"]');
}
/** @test */
public function tableBatchWidgetShouldNotBePresentWithTdPlanif() {
$this->assertXPath('//table[@id="content_watch_batch"]/tbody/tr[2]/td/div[@class="actions"]/a[contains(@href, "/admin/batch/plan/id/WATCHING_WIDGET")]/img[@title="Planifier la tâche"]');
}
/** @test */
public function tableBatchWidgetShouldBePresentWithTdManualLaunch() {
$this->assertXPath('//table[@id="content_watch_batch"]/tbody/tr[2]/td/div[@class="actions"]/a[contains(@href, "/admin/batch/run/id/WATCHING_WIDGET")]/img[@title="Lancer manuellement"]');
}
......
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