We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d43d2d4 commit 743cbbdCopy full SHA for 743cbbd
1 file changed
tests/HelpersTest.php
@@ -174,4 +174,19 @@ public function testMaskCnpj()
174
$this->assertEquals(Helpers::maskCnpj($right), '11.222.333/4444-55');
175
$this->assertNull(Helpers::maskCnpj($wrong));
176
}
177
+
178
+ public function testPtDate2IsoDate()
179
+ {
180
+ $date = '01/02/2003';
181
+ $other_date = '01/02/03';
182
+ $incomplete_date = '01/02';
183
+ $another_incomplete_date = '01/2002';
184
+ $wrong_input = 'string';
185
186
+ $this->assertEquals(Helpers::ptDate2IsoDate($date), '2003-02-01');
187
+ $this->assertEquals(Helpers::ptDate2IsoDate($other_date), '2003-02-01');
188
+ $this->assertNull(Helpers::ptDate2IsoDate($incomplete_date));
189
+ $this->assertNull(Helpers::ptDate2IsoDate($another_incomplete_date));
190
+ $this->assertNull(Helpers::ptDate2IsoDate($wrong_input));
191
+ }
192
0 commit comments