@@ -40,10 +40,8 @@ public function testFindStarByReflogWithCustomSeparator(): void
40
40
$ repo = $ this ->createRepositoryMock ();
41
41
$ info = $ this ->createGitInfoOperator ();
42
42
$ log = $ this ->createGitLogOperator ();
43
+ $ diff = $ this ->createGitDiffOperator (['file1.php ' , 'file2.php ' , 'README.md ' ]);
43
44
44
- $ log ->expects ($ this ->once ())
45
- ->method ('getChangedFilesSince ' )
46
- ->willReturn (['file1.php ' , 'file2.php ' , 'README.md ' ]);
47
45
$ log ->expects ($ this ->once ())
48
46
->method ('getBranchRevFromRefLog ' )
49
47
->willReturn ('main ' );
@@ -52,6 +50,7 @@ public function testFindStarByReflogWithCustomSeparator(): void
52
50
->willReturn ('foo ' );
53
51
54
52
$ repo ->expects ($ this ->atLeastOnce ())->method ('getLogOperator ' )->willReturn ($ log );
53
+ $ repo ->expects ($ this ->atLeastOnce ())->method ('getDiffOperator ' )->willReturn ($ diff );
55
54
$ repo ->expects ($ this ->atLeastOnce ())->method ('getInfoOperator ' )->willReturn ($ info );
56
55
57
56
$ placeholder = new BranchFiles ($ io , $ config , $ repo );
@@ -96,16 +95,13 @@ public function testCompareToOfType(): void
96
95
$ config = $ this ->createConfigMock ();
97
96
$ repo = $ this ->createRepositoryMock ();
98
97
$ info = $ this ->createGitInfoOperator ();
99
- $ log = $ this ->createGitLogOperator ( );
98
+ $ diff = $ this ->createGitDiffOperator ([ ' file1.php ' , ' file2.php ' , ' README.md ' , ' foo.txt ' ] );
100
99
101
- $ log ->expects ($ this ->once ())
102
- ->method ('getChangedFilesSince ' )
103
- ->willReturn (['file1.php ' , 'file2.php ' , 'README.md ' , 'foo.txt ' ]);
104
100
$ info ->expects ($ this ->once ())
105
101
->method ('getCurrentBranch ' )
106
102
->willReturn ('foo ' );
107
103
108
- $ repo ->expects ($ this ->atLeastOnce ())->method ('getLogOperator ' )->willReturn ($ log );
104
+ $ repo ->expects ($ this ->atLeastOnce ())->method ('getDiffOperator ' )->willReturn ($ diff );
109
105
$ repo ->expects ($ this ->atLeastOnce ())->method ('getInfoOperator ' )->willReturn ($ info );
110
106
111
107
$ placeholder = new BranchFiles ($ io , $ config , $ repo );
@@ -123,16 +119,13 @@ public function testFilterByDirectory(): void
123
119
$ config = $ this ->createConfigMock ();
124
120
$ repo = $ this ->createRepositoryMock ();
125
121
$ info = $ this ->createGitInfoOperator ();
126
- $ log = $ this ->createGitLogOperator ( );
122
+ $ diff = $ this ->createGitDiffOperator ([ ' foo/file1.php ' , ' foo/file2.php ' , ' README.md ' , ' foo.txt ' ] );
127
123
128
- $ log ->expects ($ this ->once ())
129
- ->method ('getChangedFilesSince ' )
130
- ->willReturn (['foo/file1.php ' , 'foo/file2.php ' , 'README.md ' ]);
131
124
$ info ->expects ($ this ->once ())
132
125
->method ('getCurrentBranch ' )
133
126
->willReturn ('foo ' );
134
127
135
- $ repo ->expects ($ this ->atLeastOnce ())->method ('getLogOperator ' )->willReturn ($ log );
128
+ $ repo ->expects ($ this ->atLeastOnce ())->method ('getDiffOperator ' )->willReturn ($ diff );
136
129
$ repo ->expects ($ this ->atLeastOnce ())->method ('getInfoOperator ' )->willReturn ($ info );
137
130
138
131
$ placeholder = new BranchFiles ($ io , $ config , $ repo );
@@ -150,16 +143,13 @@ public function testReplaceWith(): void
150
143
$ config = $ this ->createConfigMock ();
151
144
$ repo = $ this ->createRepositoryMock ();
152
145
$ info = $ this ->createGitInfoOperator ();
153
- $ log = $ this ->createGitLogOperator ( );
146
+ $ diff = $ this ->createGitDiffOperator ([ ' foo/file1.php ' , ' foo/file2.php ' , ' README.md ' ] );
154
147
155
- $ log ->expects ($ this ->once ())
156
- ->method ('getChangedFilesSince ' )
157
- ->willReturn (['foo/file1.php ' , 'foo/file2.php ' , 'README.md ' ]);
158
148
$ info ->expects ($ this ->once ())
159
149
->method ('getCurrentBranch ' )
160
150
->willReturn ('foo ' );
161
151
162
- $ repo ->expects ($ this ->atLeastOnce ())->method ('getLogOperator ' )->willReturn ($ log );
152
+ $ repo ->expects ($ this ->atLeastOnce ())->method ('getDiffOperator ' )->willReturn ($ diff );
163
153
$ repo ->expects ($ this ->atLeastOnce ())->method ('getInfoOperator ' )->willReturn ($ info );
164
154
165
155
$ placeholder = new BranchFiles ($ io , $ config , $ repo );
0 commit comments