- Timestamp:
- 2013/02/18 19:09:54 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/tests/class/SC_Date/SC_Date_getYearTest.php
r22206 r22567 25 25 require_once($HOME . "/tests/class/Common_TestCase.php"); 26 26 27 class SC_Date_getYearTest extends Common_TestCase { 27 class SC_Date_getYearTest extends Common_TestCase 28 { 28 29 29 protected function setUp() { 30 protected function setUp() 31 { 30 32 parent::setUp(); 31 33 $this->objDate = new SC_Date_Ex(); 32 34 } 33 35 34 protected function tearDown() { 36 protected function tearDown() 37 { 35 38 parent::tearDown(); 36 39 } … … 38 41 ///////////////////////////////////////// 39 42 40 public function testGetYear_要素の数が4の配列を返す() { 43 public function testGetYear_要素の数が4の配列を返す() 44 { 41 45 $this->expected = 4; 42 46 $this->actual = count($this->objDate->getYear()); … … 45 49 } 46 50 47 public function testGetYear_最小値が今年の配列を返す() { 51 public function testGetYear_最小値が今年の配列を返す() 52 { 48 53 $this->expected = DATE('Y'); 49 54 $this->actual = min($this->objDate->getYear()); … … 52 57 } 53 58 54 public function testGetYear_最低値が引数の年の配列を返す() { 59 public function testGetYear_最低値が引数の年の配列を返す() 60 { 55 61 $this->expected = '2007'; 56 62 $this->actual = min($this->objDate->getYear('2007')); … … 59 65 } 60 66 61 public function testGetYear_最低値がメンバー変数の年の配列を返す() { 67 public function testGetYear_最低値がメンバー変数の年の配列を返す() 68 { 62 69 $this->expected = '2004'; 63 70 $this->objDate->setStartYear('2004'); … … 67 74 } 68 75 69 public function testGetYear_最大値が3年後の配列を返す() { 76 public function testGetYear_最大値が3年後の配列を返す() 77 { 70 78 $this->expected = DATE('Y')+3; 71 79 $this->actual = max($this->objDate->getYear()); … … 74 82 } 75 83 76 public function testGetYear_最大値がメンバ変数の配列を返す() { 84 public function testGetYear_最大値がメンバ変数の配列を返す() 85 { 77 86 $this->expected = '2020'; 78 87 $this->objDate->setEndYear('2020'); … … 82 91 } 83 92 84 public function testGetYear_デフォルト値が含まれる配列を返す() { 93 public function testGetYear_デフォルト値が含まれる配列を返す() 94 { 85 95 $result = in_array('----', $this->objDate->getYear(DATE('Y'), TRUE)); 86 96 $this->assertTrue($result, "デフォルト値"); 87 97 } 88 98 89 public function testGetYear_デフォルト値の引数に年を指定した配列を返す() { 99 public function testGetYear_デフォルト値の引数に年を指定した配列を返す() 100 { 90 101 $year = date('Y'); 91 102 $this->expected = array( $year => $year, $year+1 => $year+1 … … 96 107 } 97 108 98 public function testGetYear_引数に指定したキーがデフォルト値となる配列を返す() { 109 public function testGetYear_引数に指定したキーがデフォルト値となる配列を返す() 110 { 99 111 $this->expected = 'default'; 100 112 $return = $this->objDate->getYear(DATE('Y'), TRUE, 'default');
Note: See TracChangeset
for help on using the changeset viewer.