| 720 | |
| 721 | /** |
| 722 | * @dataProvider datetime_provider |
| 723 | * @ticket 36054 |
| 724 | */ |
| 725 | function test_mysql_to_rfc3339($expected, $actual) { |
| 726 | $date_return = mysql_to_rfc3339($actual); |
| 727 | |
| 728 | $this->assertTrue(is_string($date_return), "The date return must be a string"); |
| 729 | $this->assertNotEmpty($date_return, "The date return could not be an empty string"); |
| 730 | $this->assertEquals($expected, $date_return, "The date doesn't match"); |
| 731 | $this->assertEquals(new DateTime($expected), new DateTime($date_return), "The date isn't the same after the call method"); |
| 732 | } |
| 733 | |
| 734 | function datetime_provider() |
| 735 | { |
| 736 | return array( |
| 737 | array('2016-03-15T18:54:46', '15-03-2016 18:54:46'), |
| 738 | array('2016-03-02T19:13:25', '2016-03-02 19:13:25'), |
| 739 | array('2016-03-02T19:13:00', '2016-03-02 19:13'), |
| 740 | array('2016-03-02T19:13:00', '16-03-02 19:13'), |
| 741 | array('2016-03-02T19:13:00', '16-03-02 19:13') |
| 742 | ); |
| 743 | } |