From 203a9153203946502fdaaf767e6c2ef0ff4f968c Mon Sep 17 00:00:00 2001 From: Julian Maurice <julian.maurice@biblibre.com> Date: Wed, 21 May 2014 15:38:35 +0200 Subject: [PATCH] Dev #13579 Fix tests in CmsControllerTest --- library/Class/ArticleCategorie.php | 4 ++-- library/ZendAfi/View/Helper/DatePicker.php | 4 +--- .../admin/controllers/CmsControllerTest.php | 14 ++++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/library/Class/ArticleCategorie.php b/library/Class/ArticleCategorie.php index f7e7fa041ad..f688c463282 100644 --- a/library/Class/ArticleCategorie.php +++ b/library/Class/ArticleCategorie.php @@ -133,7 +133,7 @@ class Class_ArticleCategorie extends Storm_Model_Abstract { $data[] = $bib->getArticleCategoriesToJson(); } - return json_encode($data); + return '['.implode(',', $data).']'; } } -?> \ No newline at end of file +?> diff --git a/library/ZendAfi/View/Helper/DatePicker.php b/library/ZendAfi/View/Helper/DatePicker.php index bc93ea50e71..5ed0527861c 100644 --- a/library/ZendAfi/View/Helper/DatePicker.php +++ b/library/ZendAfi/View/Helper/DatePicker.php @@ -39,8 +39,6 @@ class ZendAfi_View_Helper_DatePicker extends ZendAfi_View_Helper_BaseHelper { $optionswithhours['dateFormat'] = 'DD/MM/YYYY hh:mm'; $optionswithhours['dateOnly'] = false; - $optionswithhours['minTime'] = '08:00'; - $optionswithhours['maxTime'] = '23:00'; $optionswithhours['minuteInterval'] = 15; $options = ($dateOnly) ? $optionsdateonly : $optionswithhours; @@ -92,4 +90,4 @@ $("#' . $allDaySwitch . '").click(function() { return Class_Date::humanDate($datestr, $format); } -} \ No newline at end of file +} diff --git a/tests/application/modules/admin/controllers/CmsControllerTest.php b/tests/application/modules/admin/controllers/CmsControllerTest.php index 2fe5e67c32d..dff4f2a93ad 100644 --- a/tests/application/modules/admin/controllers/CmsControllerTest.php +++ b/tests/application/modules/admin/controllers/CmsControllerTest.php @@ -714,8 +714,10 @@ class CmsControllerArticleConcertEditRenderPopupActionTest extends CmsController /** @test */ - public function fullDayValueShouldBeFalse() { - $this->assertXPath('//input[@value="false"][@name="all_day"]'); + public function fullDayValueShouldNotBeChecked() { + $xpath = new Storm_Test_XPath(); + $xpath->assertXPath($this->_json->content, + '//input[@type="checkbox"][@name="all_day"][not(@checked)]', $this->_json->content); } @@ -2152,10 +2154,10 @@ class CmsControllerCategoriesActionTest extends AbstractControllerTestCase { protected $json = [['id' => 1, 'label' => 'Annecy', - 'categories' => ['id' => 1, + 'categories' => [['id' => 1, 'label'=> 'Annecy News', 'categories' => [], - 'items' => []], + 'items' => []]], 'items'=> []], ['id' => 2, 'label' => 'Valleiry', @@ -2192,8 +2194,8 @@ class CmsControllerCategoriesActionTest extends AbstractControllerTestCase { /** @test */ public function expectedJsonShouldBeEqual() { - $this->assertEquals(json_encode($this->json), $this->_response->getBody()); + $this->assertJSONStringEqualsJSONString(json_encode($this->json), $this->_response->getBody()); } } -?> \ No newline at end of file +?> -- GitLab