Dev#39487 2640 story 1 bibliotheque rechercher une bibliotheque avec filtres
Merged
requested to merge dev#39487_2640_story_1_bibliotheque__rechercher_une_bibliotheque_avec_filtres into WIP
Merge request reports
Activity
Filter activity
17 * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE 18 * along with BOKEH; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 */ 21 22 23 class ZendAfi_View_Helper_RenderLibraryOpening extends ZendAfi_View_Helper_BaseHelper { 24 use Trait_TimeSource; 25 26 27 public function renderLibraryOpening($library) { 28 if (!$library->hasOuvertures()) 29 return ''; 30 31 32 return 37 } 38 39 40 public function renderOuverturesForLibrary($library) { 41 if (!$ouverture = $this->getLibraryOuverture($library)) { 42 return 43 $this->renderClosed( 44 $this->_('Fermé.') 45 . $this->renderNextOuvertureForLibrary($library)); 46 } 47 48 49 $hour = (int)date('H:i', $this->getCurrentTime()); 50 51 52 $next_open_hour = ($hour >= $ouverture->getFinMatin()) 45 . $this->renderNextOuvertureForLibrary($library)); 46 } 47 48 49 $hour = (int)date('H:i', $this->getCurrentTime()); 50 51 52 $next_open_hour = ($hour >= $ouverture->getFinMatin()) 53 ? $ouverture->getDebutApresMidi() 54 : $ouverture->getDebutMatin(); 55 56 if ($next_open_hour > $hour) 57 return $this->renderClosed($this->_('Ouvrira à %s', $next_open_hour)); 58 59 60 $next_close_hour = ($ouverture->isJourneeContinue() || $hour >= $ouverture->getDebutApresMidi()) 50 51 52 $next_open_hour = ($hour >= $ouverture->getFinMatin()) 53 ? $ouverture->getDebutApresMidi() 54 : $ouverture->getDebutMatin(); 55 56 if ($next_open_hour > $hour) 57 return $this->renderClosed($this->_('Ouvrira à %s', $next_open_hour)); 58 59 60 $next_close_hour = ($ouverture->isJourneeContinue() || $hour >= $ouverture->getDebutApresMidi()) 61 ? max($ouverture->getFinMatin(), $ouverture->getFinApresMidi()) 62 : $ouverture->getFinMatin(); 63 64 65 if ($next_close_hour > $hour) 54 : $ouverture->getDebutMatin(); 55 56 if ($next_open_hour > $hour) 57 return $this->renderClosed($this->_('Ouvrira à %s', $next_open_hour)); 58 59 60 $next_close_hour = ($ouverture->isJourneeContinue() || $hour >= $ouverture->getDebutApresMidi()) 61 ? max($ouverture->getFinMatin(), $ouverture->getFinApresMidi()) 62 : $ouverture->getFinMatin(); 63 64 65 if ($next_close_hour > $hour) 66 return $this->renderOpened($this->_('Ouvert jusqu\'à %s', $next_close_hour)); 67 68 69 return 810 811 /** @test */ 812 public function suivantLinkShouldNotBePresent() { 813 $this->assertXPathContentContains('//div[@class="paginationControl"]//span[@class="disabled"]', 'Suivant'); 814 } 815 816 817 /** @test */ 818 public function paginationControlShouldBeTopAndBottom() { 819 $this->assertXPathCount('//div[@class="paginationControl"]', 2); 820 } 821 } 822 823 824 825 844 845 846 /** @test */ 847 public function bibMeythetShouldBeSecondElement() { 848 $this->assertXPathContentContains('//div[@class="contenu"]//section[2]//h2', 'Meythet'); 849 } 850 851 852 /** @test */ 853 public function bibAnnecyShouldBeThirdElement() { 854 $this->assertXPathContentContains('//div[@class="contenu"]//section[3]//h2', 'Annecy'); 855 } 856 } 857 858 859 879 880 881 /** @test */ 882 public function bibCranShouldBeSecondElement() { 883 $this->assertXPathContentContains('//div[@class="contenu"]//section[2]//h2', 'Cran'); 884 } 885 886 887 /** @test */ 888 public function bibMeythetShouldBeThirdElement() { 889 $this->assertXPathContentContains('//div[@class="contenu"]//section[3]//h2', 'Meythet'); 890 } 891 } 892 893 894
Please register or sign in to reply