File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ public function fetchFile($path, $revision = null)
56
56
return $ this ->fetch ($ url );
57
57
}
58
58
59
- public function fetchDirectory ($ path , $ revision = null )
59
+ public function fetchDirectory ($ path , $ revision = null , $ showAttic = false )
60
60
{
61
61
if (substr ($ path , -1 ) !== '/ ' ) {
62
62
return $ this ->reject (new InvalidArgumentException ('Directory path MUST end with trailing slash ' ));
@@ -68,6 +68,11 @@ public function fetchDirectory($path, $revision = null)
68
68
$ url .= '?pathrev= ' . $ revision ;
69
69
}
70
70
71
+ if ($ showAttic ) {
72
+ $ url .= (strpos ($ url , '? ' ) === false ) ? '? ' : '& ' ;
73
+ $ url .= 'hideattic=0 ' ;
74
+ }
75
+
71
76
// TODO: path MUST end with trailing slash
72
77
// TODO: accessing files will redirect to file with relative location URL (not supported by clue/buzz-react)
73
78
Original file line number Diff line number Diff line change @@ -67,6 +67,24 @@ public function testFetchDirectoryRevision()
67
67
$ this ->expectPromiseReject ($ promise );
68
68
}
69
69
70
+ public function testFetchDirectoryAttic ()
71
+ {
72
+ $ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/directory/?hideattic=0 ' ))->will ($ this ->returnValue ($ this ->createPromiseRejected ()));
73
+
74
+ $ promise = $ this ->client ->fetchDirectory ('/directory/ ' , null , true );
75
+
76
+ $ this ->expectPromiseReject ($ promise );
77
+ }
78
+
79
+ public function testFetchDirectoryRevisionAttic ()
80
+ {
81
+ $ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/directory/?pathrev=1.1&hideattic=0 ' ))->will ($ this ->returnValue ($ this ->createPromiseRejected ()));
82
+
83
+ $ promise = $ this ->client ->fetchDirectory ('/directory/ ' , '1.1 ' , true );
84
+
85
+ $ this ->expectPromiseReject ($ promise );
86
+ }
87
+
70
88
public function testFetchPatch ()
71
89
{
72
90
$ this ->browser ->expects ($ this ->once ())->method ('get ' )->with ($ this ->equalTo ('http://viewvc.example.org/README.md?view=patch&r1=1.0&r2=1.1 ' ))->will ($ this ->returnValue ($ this ->createPromiseRejected ()));
You can’t perform that action at this time.
0 commit comments