@@ -17,14 +17,14 @@ public function testToString(): void {
17
17
$ path = '/a/b/c ' ;
18
18
$ object = new PathTest_Path ($ path );
19
19
20
- self ::assertEquals ($ path , (string ) $ object );
20
+ self ::assertSame ($ path , (string ) $ object );
21
21
}
22
22
23
23
public function testGetName (): void {
24
24
$ path = '/a/b/c ' ;
25
25
$ object = new PathTest_Path ($ path );
26
26
27
- self ::assertEquals (basename ($ path ), $ object ->getName ());
27
+ self ::assertSame (basename ($ path ), $ object ->getName ());
28
28
}
29
29
30
30
public function testGetPathToAbsolute (): void {
@@ -33,38 +33,38 @@ public function testGetPathToAbsolute(): void {
33
33
$ absolute = (new PathTest_Path ('/absolute/path ' ))->getPath ($ to );
34
34
35
35
self ::assertNotSame ($ to , $ relative );
36
- self ::assertEquals ('/to/absolute/path ' , (string ) $ relative );
36
+ self ::assertSame ('/to/absolute/path ' , (string ) $ relative );
37
37
38
38
self ::assertNotSame ($ to , $ absolute );
39
- self ::assertEquals ('/to/absolute/path ' , (string ) $ absolute );
39
+ self ::assertSame ('/to/absolute/path ' , (string ) $ absolute );
40
40
}
41
41
42
42
public function testGetPathToRelative (): void {
43
43
$ fromRelative = new PathTest_Path ('relative/path ' );
44
44
$ fromAbsolute = new PathTest_Path ('/absolute/path ' );
45
45
$ to = new PathTest_Path ('to/../relative/./path ' );
46
46
47
- self ::assertEquals ('/absolute/path/relative/path ' , (string ) $ fromAbsolute ->getPath ($ to ));
48
- self ::assertEquals ('relative/path/relative/path ' , (string ) $ fromRelative ->getPath ($ to ));
47
+ self ::assertSame ('/absolute/path/relative/path ' , (string ) $ fromAbsolute ->getPath ($ to ));
48
+ self ::assertSame ('relative/path/relative/path ' , (string ) $ fromRelative ->getPath ($ to ));
49
49
}
50
50
51
51
public function testGetNormalizedPath (): void {
52
- self ::assertEquals ('/any/path ' , (string ) (new PathTest_Path ('/any/path ' ))->getNormalizedPath ());
53
- self ::assertEquals ('any/path ' , (string ) (new PathTest_Path ('any/path ' ))->getNormalizedPath ());
54
- self ::assertEquals ('any/path ' , (string ) (new PathTest_Path ('./any/path ' ))->getNormalizedPath ());
55
- self ::assertEquals ('any/path ' , (string ) (new PathTest_Path ('././any/path ' ))->getNormalizedPath ());
56
- self ::assertEquals ('../any/path ' , (string ) (new PathTest_Path ('./../any/path ' ))->getNormalizedPath ());
57
- self ::assertEquals ('path ' , (string ) (new PathTest_Path ('./any/../path ' ))->getNormalizedPath ());
58
- self ::assertEquals ('' , (string ) (new PathTest_Path ('./ ' ))->getNormalizedPath ());
59
- self ::assertEquals ('' , (string ) (new PathTest_Path ('. ' ))->getNormalizedPath ());
60
- self ::assertEquals ('.. ' , (string ) (new PathTest_Path ('../ ' ))->getNormalizedPath ());
61
- self ::assertEquals ('.. ' , (string ) (new PathTest_Path ('.. ' ))->getNormalizedPath ());
62
- self ::assertEquals ('path ' , (string ) (new PathTest_Path ('./any/../path/. ' ))->getNormalizedPath ());
63
- self ::assertEquals ('/ ' , (string ) (new PathTest_Path ('/.. ' ))->getNormalizedPath ());
64
- self ::assertEquals ('../any/path ' , (string ) (new PathTest_Path ('. \\.. \\any \\path ' ))->getNormalizedPath ());
65
- self ::assertEquals ('any/path ' , (string ) (new PathTest_Path ('any \\path ' ))->getNormalizedPath ());
66
- self ::assertEquals ('/any/path ' , (string ) (new PathTest_Path ('/any/path/ ' ))->getNormalizedPath ());
67
- self ::assertEquals ('any/path ' , (string ) (new PathTest_Path ('any/path/ ' ))->getNormalizedPath ());
52
+ self ::assertSame ('/any/path ' , (string ) (new PathTest_Path ('/any/path ' ))->getNormalizedPath ());
53
+ self ::assertSame ('any/path ' , (string ) (new PathTest_Path ('any/path ' ))->getNormalizedPath ());
54
+ self ::assertSame ('any/path ' , (string ) (new PathTest_Path ('./any/path ' ))->getNormalizedPath ());
55
+ self ::assertSame ('any/path ' , (string ) (new PathTest_Path ('././any/path ' ))->getNormalizedPath ());
56
+ self ::assertSame ('../any/path ' , (string ) (new PathTest_Path ('./../any/path ' ))->getNormalizedPath ());
57
+ self ::assertSame ('path ' , (string ) (new PathTest_Path ('./any/../path ' ))->getNormalizedPath ());
58
+ self ::assertSame ('' , (string ) (new PathTest_Path ('./ ' ))->getNormalizedPath ());
59
+ self ::assertSame ('' , (string ) (new PathTest_Path ('. ' ))->getNormalizedPath ());
60
+ self ::assertSame ('.. ' , (string ) (new PathTest_Path ('../ ' ))->getNormalizedPath ());
61
+ self ::assertSame ('.. ' , (string ) (new PathTest_Path ('.. ' ))->getNormalizedPath ());
62
+ self ::assertSame ('path ' , (string ) (new PathTest_Path ('./any/../path/. ' ))->getNormalizedPath ());
63
+ self ::assertSame ('/ ' , (string ) (new PathTest_Path ('/.. ' ))->getNormalizedPath ());
64
+ self ::assertSame ('../any/path ' , (string ) (new PathTest_Path ('. \\.. \\any \\path ' ))->getNormalizedPath ());
65
+ self ::assertSame ('any/path ' , (string ) (new PathTest_Path ('any \\path ' ))->getNormalizedPath ());
66
+ self ::assertSame ('/any/path ' , (string ) (new PathTest_Path ('/any/path/ ' ))->getNormalizedPath ());
67
+ self ::assertSame ('any/path ' , (string ) (new PathTest_Path ('any/path/ ' ))->getNormalizedPath ());
68
68
}
69
69
70
70
public function testIsNormalized (): void {
@@ -76,19 +76,19 @@ public function testIsNormalized(): void {
76
76
}
77
77
78
78
public function testGetRelativePath (): void {
79
- self ::assertEquals (
79
+ self ::assertSame (
80
80
'../to/file ' ,
81
81
(string ) (new PathTest_Path ('/any/path ' ))->getRelativePath (new PathTest_Path ('/any/path/../to/file ' )),
82
82
);
83
- self ::assertEquals (
83
+ self ::assertSame (
84
84
'' ,
85
85
(string ) (new PathTest_Path ('/any/path ' ))->getRelativePath (new PathTest_Path ('/any/path ' )),
86
86
);
87
- self ::assertEquals (
87
+ self ::assertSame (
88
88
'to/file ' ,
89
89
(string ) (new PathTest_Path ('/absolute/path ' ))->getRelativePath (new PathTest_Path ('to/./file ' )),
90
90
);
91
- self ::assertEquals (
91
+ self ::assertSame (
92
92
basename (__FILE__ ),
93
93
(string ) (new PathTest_Path (__DIR__ ))->getRelativePath (new PathTest_Path (__FILE__ )),
94
94
);
@@ -114,20 +114,20 @@ public function testGetFilePath(): void {
114
114
$ relative = (new PathTest_Path ('relative/path/to ' ))->getFilePath ('file ' );
115
115
$ absolute = (new PathTest_Path ('/path/to ' ))->getFilePath ('/file ' );
116
116
117
- self ::assertEquals ('relative/path/to/file ' , (string ) $ relative );
117
+ self ::assertSame ('relative/path/to/file ' , (string ) $ relative );
118
118
119
- self ::assertEquals ('/file ' , (string ) $ absolute );
119
+ self ::assertSame ('/file ' , (string ) $ absolute );
120
120
}
121
121
122
122
public function testGetDirectoryPath (): void {
123
123
$ relative = (new PathTest_Path ('relative/path/to ' ))->getDirectoryPath ('directory ' );
124
124
$ absolute = (new PathTest_Path ('/path/to ' ))->getDirectoryPath ('/directory ' );
125
125
$ null = (new PathTest_Path ('/path/to ' ))->getDirectoryPath ();
126
126
127
- self ::assertEquals ('relative/path/to/directory ' , (string ) $ relative );
127
+ self ::assertSame ('relative/path/to/directory ' , (string ) $ relative );
128
128
129
- self ::assertEquals ('/directory ' , (string ) $ absolute );
130
- self ::assertEquals ('/path ' , (string ) $ null );
129
+ self ::assertSame ('/directory ' , (string ) $ absolute );
130
+ self ::assertSame ('/path ' , (string ) $ null );
131
131
}
132
132
133
133
public function testIsEqual (): void {
0 commit comments