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