File tree Expand file tree Collapse file tree 2 files changed +38
-27
lines changed Expand file tree Collapse file tree 2 files changed +38
-27
lines changed Original file line number Diff line number Diff line change 1
1
{
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
+ }
Original file line number Diff line number Diff line change 2
2
3
3
declare (strict_types=1 );
4
4
5
+ namespace Coswat \Grapes \Test ;
6
+
5
7
use PHPUnit \Framework \TestCase ;
6
8
use Coswat \Grapes \Grape ;
7
9
8
10
class GrapeTest extends TestCase
9
11
{
10
12
public function test_toYear_function (): void
11
13
{
12
- $ year = Grape::time (time () )->toYear ();
14
+ $ year = Grape::time (1687350065 )->toYear ();
13
15
$ expected = 2023 ;
14
16
$ this ->assertEquals ($ year , $ expected );
15
17
}
16
18
public function test_toMonth_function (): void
17
19
{
18
- $ month = Grape::time (time () )->toMonth ();
19
- $ expected = "March " ;
20
+ $ month = Grape::time (1687350065 )->toMonth ();
21
+ $ expected = "June " ;
20
22
$ this ->assertEquals ($ month , $ expected );
21
23
}
22
24
public function test_toDay_function (): void
23
25
{
24
- $ day = Grape::time (time () )->toDay ();
26
+ $ day = Grape::time (1687350065 )->toDay ();
25
27
$ expected = "Wednesday " ;
26
28
$ this ->assertEquals ($ day , $ expected );
27
29
}
You can’t perform that action at this time.
0 commit comments