Skip to content

Commit 4e9c250

Browse files
author
coderswat
committed
updated composer.json and updated tests
1 parent 8c64b4e commit 4e9c250

File tree

2 files changed

+38
-27
lines changed

2 files changed

+38
-27
lines changed

composer.json

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
11
{
2-
"name": "coswat/grapes",
3-
"description": "php grapes is a powerful and light weight package to play with time and date , easy to use",
4-
"type": "library",
5-
"keywords": [
6-
"date",
7-
"time",
8-
"DateTime"
9-
],
10-
"license": "MIT",
11-
"autoload": {
12-
"psr-4": {
13-
"Coswat\\Grapes\\": "src/"
14-
}
15-
},
16-
"authors": [
17-
{
18-
"name": "coswat"
19-
}
20-
],
21-
"require-dev": {
22-
"phpunit/phpunit": "^10.0"
23-
}
24-
}
2+
"name":"coswat/grapes",
3+
"description":"Simple PHP package to manage Date and Time",
4+
"type":"library",
5+
"license":"MIT",
6+
"support":{
7+
"issues":"https://github.com/coswat/grapes/issues",
8+
"source":"https://github.com/coswat/grapes"
9+
},
10+
"authors":[
11+
{
12+
"name":"Abhishek B",
13+
"email":"abhishek.b4696@gmail.com"
14+
}
15+
],
16+
"require":{
17+
"php":"^8.1"
18+
},
19+
"require-dev":{
20+
"phpunit/phpunit": "^10.2"
21+
},
22+
"autoload":{
23+
"psr-4":{
24+
"Coswat\\Grapes\\":"src/"
25+
}
26+
},
27+
"autoload-dev":{
28+
"psr-4":{
29+
"Coswat\\Grapes\\Test\\":"tests/"
30+
}
31+
},
32+
"minimum-stability":"stable"
33+
}

tests/GrapeTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,28 @@
22

33
declare(strict_types=1);
44

5+
namespace Coswat\Grapes\Test;
6+
57
use PHPUnit\Framework\TestCase;
68
use Coswat\Grapes\Grape;
79

810
class GrapeTest extends TestCase
911
{
1012
public function test_toYear_function(): void
1113
{
12-
$year = Grape::time(time())->toYear();
14+
$year = Grape::time(1687350065)->toYear();
1315
$expected = 2023;
1416
$this->assertEquals($year, $expected);
1517
}
1618
public function test_toMonth_function(): void
1719
{
18-
$month = Grape::time(time())->toMonth();
19-
$expected = "March";
20+
$month = Grape::time(1687350065)->toMonth();
21+
$expected = "June";
2022
$this->assertEquals($month, $expected);
2123
}
2224
public function test_toDay_function(): void
2325
{
24-
$day = Grape::time(time())->toDay();
26+
$day = Grape::time(1687350065)->toDay();
2527
$expected = "Wednesday";
2628
$this->assertEquals($day, $expected);
2729
}

0 commit comments

Comments
 (0)