[Svn-src-all:3286] [version-2_12-dev 22187] #2000 SC_Dateツづ個テツスツトツコツーツドツづーツ催ャツ青ャ

poego admin @ mail.ec-cube.net
2012年 12月 30日 (日) 18:12:25 JST


Subversion committed to /home/svn/open 22187
http://svn.ec-cube.net/open_trac/changeset/22187
┌────────────────────────────┐
│更新者 :  poego                                        │
│更新日時:  2012-12-30 18:12:24 +0900 (日, 30 12月 2012)│
└────────────────────────────┘

Log:
--------------------------------------------------------
#2000 SC_DateeXgR[h¬

Changed:                      [U:修正,A:追加,D:削除]
--------------------------------------------------------
A   branches/version-2_12-dev/tests/class/SC_Date/
A   branches/version-2_12-dev/tests/class/SC_Date/SC_Date_AccessorTest.php
A   branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getDayTest.php
A   branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getHourTest.php
A   branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getMinutesIntervalTest.php
A   branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getMinutesTest.php
A   branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getMonthTest.php
A   branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getYearTest.php
A   branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getZeroMonthTest.php
A   branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getZeroYearTest.php

追加: branches/version-2_12-dev/tests/class/SC_Date/SC_Date_AccessorTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/SC_Date/SC_Date_AccessorTest.php	                        (rev 0)
+++ branches/version-2_12-dev/tests/class/SC_Date/SC_Date_AccessorTest.php	2012-12-30 09:12:24 UTC (rev 22187)
@@ -0,0 +1,70 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+$HOME = realpath(dirname(__FILE__)) . "/../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+
+class SC_Date_AccessorTest extends Common_TestCase {
+
+    protected function setUp() {
+        parent::setUp();
+        $this->objDate = new SC_Date_Ex('2010','2014');
+    }
+
+    protected function tearDown() {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+
+    public function testGetStartYear_startYearの値を取得する() {
+        $this->expected = '2010';
+        $this->actual = $this->objDate->getStartYear();
+
+        $this->verify("StartYear");
+    }
+
+    public function testGetEndYear_endYearの値を取得する() {
+        $this->expected = '2014';
+        $this->actual = $this->objDate->getEndYear();
+
+        $this->verify("EndYear");
+    }
+
+    public function testsetMonth_monthの値を設定する() {
+        $this->expected = '9';
+        $this->objDate->setMonth('9');
+        $this->actual = $this->objDate->month;
+
+        $this->verify("Month");
+    }
+    
+    public function testsetDay_dayの値を設定する() {
+        $this->expected = '28';
+        $this->objDate->setDay('28');
+        $this->actual = $this->objDate->day;
+
+        $this->verify("Day");
+    }
+}
+

追加: branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getDayTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getDayTest.php	                        (rev 0)
+++ branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getDayTest.php	2012-12-30 09:12:24 UTC (rev 22187)
@@ -0,0 +1,75 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+$HOME = realpath(dirname(__FILE__)) . "/../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+
+class SC_Date_getDayTest extends Common_TestCase {
+
+    protected function setUp() {
+        parent::setUp();
+        $this->objDate = new SC_Date_Ex();
+    }
+
+    protected function tearDown() {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+
+    public function testGetDay_要素の数が31の配列を返す() {
+        $this->expected = 31;
+        $this->actual = count($this->objDate->getDay());
+
+        $this->verify("配列の長さ");
+    }
+
+    public function testGetDay_要素の最低値が1の配列を返す() {
+        $this->expected = 1;
+        $this->actual = min($this->objDate->getDay());
+
+        $this->verify("配列の最低値");
+    }
+
+    public function testGetDay_要素の最大値が31の配列を返す() {
+        $this->expected = 31;
+        $this->actual = max($this->objDate->getDay());
+
+        $this->verify("配列の最大値");
+    }
+
+    public function testGetDay_TRUEを与えた場合要素の数が32の配列を返す() {
+        $this->expected = 32;
+        $this->actual = count($this->objDate->getDay(true));
+
+        $this->verify("デフォルトを設定した配列の長さ");
+    }
+
+    public function testGetDay_TRUEを与えた場合ーー含まれるの配列を返す() {
+        $result = in_array('--', $this->objDate->getDay(true));
+
+        $this->assertTrue($result, "デフォルトの値");
+    }
+ 
+}
+

追加: branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getHourTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getHourTest.php	                        (rev 0)
+++ branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getHourTest.php	2012-12-30 09:12:24 UTC (rev 22187)
@@ -0,0 +1,62 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+$HOME = realpath(dirname(__FILE__)) . "/../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+
+class SC_Date_getHourTest extends Common_TestCase {
+
+    protected function setUp() {
+        parent::setUp();
+        $this->objDate = new SC_Date_Ex();
+    }
+
+    protected function tearDown() {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+
+    public function testGetHour_24の配列を返す() {
+        $this->expected = 24;
+        $this->actual = count($this->objDate->getHour());
+
+        $this->verify("配列の長さ");
+    }
+
+    public function testGetHour_要素の最低値が0の配列を返す() {
+        $this->expected = 0;
+        $this->actual = min($this->objDate->getHour());
+
+        $this->verify("配列の最低値");
+    }
+
+    public function testGetHour_要素の最大値が23の配列を返す() {
+        $this->expected = 23;
+        $this->actual = max($this->objDate->getHour());
+
+        $this->verify("配列の最大値");
+    }
+
+}
+

追加: branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getMinutesIntervalTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getMinutesIntervalTest.php	                        (rev 0)
+++ branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getMinutesIntervalTest.php	2012-12-30 09:12:24 UTC (rev 22187)
@@ -0,0 +1,47 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+$HOME = realpath(dirname(__FILE__)) . "/../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+
+class SC_Date_getMinutesIntervalTest extends Common_TestCase {
+
+    protected function setUp() {
+        parent::setUp();
+        $this->objDate = new SC_Date_Ex();
+    }
+
+    protected function tearDown() {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+
+    public function testGetMinutesInterval_要素が00と30の配列を返す() {
+        $this->expected = array('00'=>'00', '30'=>'30');
+        $this->actual = $this->objDate->getMinutesInterval();
+
+        $this->verify("0分と30分");
+    }
+  
+}

追加: branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getMinutesTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getMinutesTest.php	                        (rev 0)
+++ branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getMinutesTest.php	2012-12-30 09:12:24 UTC (rev 22187)
@@ -0,0 +1,62 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+$HOME = realpath(dirname(__FILE__)) . "/../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+
+class SC_Date_getMinutesTest extends Common_TestCase {
+
+    protected function setUp() {
+        parent::setUp();
+        $this->objDate = new SC_Date_Ex();
+    }
+
+    protected function tearDown() {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+
+    public function testGetMinutes_要素の数が60の配列を返す() {
+        $this->expected = 60;
+        $this->actual = count($this->objDate->getMinutes());
+
+        $this->verify("配列の長さ");
+    }
+
+    public function testGetMinutes_要素の最低値が0の配列を返す() {
+        $this->expected = 0;
+        $this->actual = min($this->objDate->getMinutes());
+
+        $this->verify("配列の最低値");
+    }
+
+    public function testGetMinutes_要素の最大値が59の配列を返す() {
+        $this->expected = 59;
+        $this->actual = max($this->objDate->getMinutes());
+
+        $this->verify("配列の最大値");
+    }
+
+}
+

追加: branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getMonthTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getMonthTest.php	                        (rev 0)
+++ branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getMonthTest.php	2012-12-30 09:12:24 UTC (rev 22187)
@@ -0,0 +1,75 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+$HOME = realpath(dirname(__FILE__)) . "/../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+
+class SC_Date_getMonthTest extends Common_TestCase {
+
+    protected function setUp() {
+        parent::setUp();
+        $this->objDate = new SC_Date_Ex();
+    }
+
+    protected function tearDown() {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+
+    public function testGetMonth_要素の数が12の配列を返す() {
+        $this->expected = 12;
+        $this->actual = count($this->objDate->getMonth());
+
+        $this->verify("配列の長さ");
+    }
+
+    public function testGetMonth_要素の最低値が1の配列を返す() {
+        $this->expected = 1;
+        $this->actual = min($this->objDate->getMonth());
+
+        $this->verify("配列の最低値");
+    }
+
+    public function testGetMonth_要素の最大値が12の配列を返す() {
+        $this->expected = 12;
+        $this->actual = max($this->objDate->getMonth());
+
+        $this->verify("配列の最大値");
+    }
+
+    public function testGetMonth_TRUEを与えた場合要素の数が13の配列を返す() {
+        $this->expected = 13;
+        $this->actual = count($this->objDate->getMonth(true));
+
+        $this->verify("デフォルトを設定した配列の長さ");
+    }
+
+    public function testGetMonth_TRUEを与えた場合ーー含まれるの配列を返す() {
+        $result = in_array('--', $this->objDate->getMonth(true));
+
+        $this->assertTrue($result, "デフォルトの値");
+    }
+ 
+}
+

追加: branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getYearTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getYearTest.php	                        (rev 0)
+++ branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getYearTest.php	2012-12-30 09:12:24 UTC (rev 22187)
@@ -0,0 +1,106 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+$HOME = realpath(dirname(__FILE__)) . "/../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+
+class SC_Date_getYearTest extends Common_TestCase {
+
+    protected function setUp() {
+        parent::setUp();
+        $this->objDate = new SC_Date_Ex();
+    }
+
+    protected function tearDown() {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+  
+    public function testGetYear_要素の数が4の配列を返す() {
+        $this->expected = 4;
+        $this->actual = count($this->objDate->getYear());
+
+        $this->verify("配列の長さ");
+    }
+    
+    public function testGetYear_最小値が今年の配列を返す() {
+        $this->expected = DATE('Y');
+        $this->actual = min($this->objDate->getYear());
+
+        $this->verify("最小値;今年");
+    }
+    
+    public function testGetYear_最低値が引数の年の配列を返す() {
+        $this->expected = '2007';
+        $this->actual = min($this->objDate->getYear('2007'));
+
+        $this->verify("引数が最低値");
+    }
+    
+    public function testGetYear_最低値がメンバー変数の年の配列を返す() {
+        $this->expected = '2004';
+        $this->objDate->setStartYear('2004');
+        $this->actual = min($this->objDate->getYear());
+
+        $this->verify("メンバー変数が最低値");
+    }
+    
+    public function testGetYear_最大値が3年後の配列を返す() {
+        $this->expected = DATE('Y')+3;
+        $this->actual = max($this->objDate->getYear());
+
+        $this->verify("最大値;3年後");
+    }
+    
+    public function testGetYear_最大値がメンバ変数の配列を返す() {
+        $this->expected = '2020';
+        $this->objDate->setEndYear('2020');
+        $this->actual = max($this->objDate->getYear());
+
+        $this->verify("メンバー変数が最大値");
+    }
+    
+    public function testGetYear_デフォルト値が含まれる配列を返す() {
+        $result = in_array('----', $this->objDate->getYear(DATE('Y'), TRUE));
+        $this->assertTrue($result, "デフォルト値");
+    }
+    
+    public function testGetYear_デフォルト値の引数に年を指定した配列を返す() {
+        $year = date('Y');
+        $this->expected = array( $year => $year, $year+1 => $year+1
+                               , '----' => '----'
+                               , $year+2 => $year+2, $year+3 => $year+3);
+        $this->actual = $this->objDate->getYear(DATE('Y'), $year+1);
+        $this->assertSame($this->expected, $this->actual, "デフォルト値");
+    }
+
+    public function testGetYear_引数に指定したキーがデフォルト値となる配列を返す() {
+        $this->expected = 'default';
+        $return = $this->objDate->getYear(DATE('Y'), TRUE, 'default');
+        $this->actual = array_search('----', $return);
+        $this->verify("デフォルトキー");
+    }
+
+}
+

追加: branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getZeroMonthTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getZeroMonthTest.php	                        (rev 0)
+++ branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getZeroMonthTest.php	2012-12-30 09:12:24 UTC (rev 22187)
@@ -0,0 +1,58 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+$HOME = realpath(dirname(__FILE__)) . "/../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+
+class SC_Date_getZeroMonthTest extends Common_TestCase {
+
+    protected function setUp() {
+        parent::setUp();
+        $this->objDate = new SC_Date_Ex();
+    }
+
+    protected function tearDown() {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+
+    public function testGetZeroMonth_要素の数が12の配列を返す() {
+        $this->expected = 12;
+        $this->actual = count($this->objDate->getZeroMonth());
+
+        $this->verify("配列の長さ");
+    }
+
+    public function testGetZeroMonth_0をつけた月の配列を返す() {
+        $this->expected = array('01'=>'01','02'=>'02','03'=>'03'
+                                ,'04'=>'04','05'=>'05','06'=>'06'
+                                ,'07'=>'07','08'=>'08','09'=>'09'
+                                ,'10'=>'10','11'=>'11','12'=>'12'
+                                );
+        $this->actual = $this->objDate->getZeroMonth();
+
+        $this->verify("配列の最低値");
+    }
+
+}

追加: branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getZeroYearTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getZeroYearTest.php	                        (rev 0)
+++ branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getZeroYearTest.php	2012-12-30 09:12:24 UTC (rev 22187)
@@ -0,0 +1,82 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+$HOME = realpath(dirname(__FILE__)) . "/../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+
+class SC_Date_getZeroYearTest extends Common_TestCase {
+
+    protected function setUp() {
+        parent::setUp();
+        $this->objDate = new SC_Date_Ex();
+    }
+
+    protected function tearDown() {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+  
+    public function testGetZeroYear_要素の数が4の配列を返す() {
+        $this->expected = 4;
+        $this->actual = count($this->objDate->getZeroYear());
+        $this->verify("配列の長さ");
+    }
+    
+    public function testGetZeroYear_最小値が2桁表記の今年の配列を返す() {
+        $this->expected = DATE('y');
+        $this->actual = min($this->objDate->getZeroYear());
+        $this->verify("最小値;今年");
+    }
+    
+    public function testGetZeroYear_最低値が引数の年の2桁表記の配列を返す() {
+        $this->expected = '07';
+        $this->actual = min($this->objDate->getZeroYear('2007'));
+
+        $this->verify("引数が最低値");
+    }
+    
+    public function testGetZeroYear_最低値がメンバー変数の年の2桁表記の配列を返す() {
+        $this->expected = '04';
+        $this->objDate->setStartYear('2004');
+        $this->actual = min($this->objDate->getZeroYear());
+
+        $this->verify("メンバー変数が最低値");
+    }
+    
+    public function testGetZeroYear_最大値が3年後の2桁表記の配列を返す() {
+        $this->expected = DATE('y')+3;
+        $this->actual = max($this->objDate->getZeroYear());
+
+        $this->verify("最大値;3年後");
+    }
+    
+    public function testGetZeroYear_最大値がメンバ変数の2桁表記の配列を返す() {
+        $this->expected = '20';
+        $this->objDate->setEndYear('2020');
+        $this->actual = max($this->objDate->getZeroYear());
+
+        $this->verify("メンバー変数が最大値");
+    }
+}
+




Svn-src-all メーリングリストの案内