diff --git a/.phpunit.result.cache b/.phpunit.result.cache deleted file mode 100644 index 471bc86..0000000 --- a/.phpunit.result.cache +++ /dev/null @@ -1 +0,0 @@ -{"version":1,"defects":[],"times":{"strftimeTest::test_sum":0.056,"strftimeTest::test_ymdhms":0.006}} \ No newline at end of file diff --git a/composer.json b/composer.json index 368637e..07cbb95 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "php81_bc/strftime", - "version": "0.0.5", + "version": "0.0.6", "description": "Locale-formatted strftime using IntlDateFormatter (PHP 8.1 compatible)", "license": "MIT", "authors": [ diff --git a/phpunit.xml b/phpunit.xml index 0fe1d02..5ce6b41 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,5 +1,5 @@ - + tests diff --git a/tests/strftimeTest.php b/tests/strftimeTest.php index 38fa6a0..ed7ae9b 100644 --- a/tests/strftimeTest.php +++ b/tests/strftimeTest.php @@ -10,10 +10,18 @@ public function setUp () : void { $this->int_date = strtotime($this->str_date); } - public function test_ymdhms () { - $result = strftime('%Y-%m-%d %H:%M:%S', $this->str_date); - $this->assertEquals('2022-03-12 01:02:03', $result); - $result = strftime('%Y-%m-%d %H:%M:%S', $this->int_date); - $this->assertEquals('2022-03-12 01:02:03', $result); + public function test_int_timestamp () { + $result = strftime('%Y-%m-%d %H:%M:%S', $this->int_date); + $this->assertEquals('2022-03-12 01:02:03', $result); + } + + public function test_string_timestamp () { + $result = strftime('%Y-%m-%d %H:%M:%S', $this->str_date); + $this->assertEquals('2022-03-12 01:02:03', $result); + } + + public function test_datetime_timestamp () { + $result = strftime('%Y-%m-%d %H:%M:%S', new DateTime($this->str_date)); + $this->assertEquals('2022-03-12 01:02:03', $result); } }