Skip to content

Commit

Permalink
Update version to 0.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
alphp committed Apr 1, 2022
1 parent f22f57e commit 2b4642b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
1 change: 0 additions & 1 deletion .phpunit.result.cache

This file was deleted.

2 changes: 1 addition & 1 deletion 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": [
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php" colors="true">
<phpunit bootstrap="vendor/autoload.php" colors="true" cacheResultFile="tmp/phpunit.cache">
<testsuite name="Test directory">
<directory>tests</directory>
</testsuite>
Expand Down
18 changes: 13 additions & 5 deletions tests/strftimeTest.php
Expand Up @@ -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);
}
}

0 comments on commit 2b4642b

Please sign in to comment.