From 76924393b8ad93f616d29993734eb01b47c85897 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sat, 16 Feb 2019 10:53:41 -0800 Subject: [PATCH] Date test terms() --- tests/unit/e_dateTest.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/unit/e_dateTest.php b/tests/unit/e_dateTest.php index fd6048dff..34576ed88 100644 --- a/tests/unit/e_dateTest.php +++ b/tests/unit/e_dateTest.php @@ -241,13 +241,21 @@ public function testTerms() { - $data = $this->dateObj->terms(); + $tests = array( + 0 => array('day-shortest', 'We'), + 1 => array('day-short', 'Wed'), + 2 => array('day', 'Wednesday'), + 3 => array('month', 'February'), + 4 => array('month-short', 'Feb'), + ); - $result = ($data[1] === 'January' && $data[12] === 'December') ? true : false; - - $this->assertTrue($result); - - // $this->fail(print_r($result,true)); + foreach($tests as $var) + { + list($input, $expected) = $var; + $data = $this->dateObj->terms($input); + $this->assertEquals($expected, $data[2]); + } + }