1414use OCP \App \IAppManager ;
1515use OCP \Files \NotFoundException ;
1616use OCP \IConfig ;
17- use PHPUnit \Framework \Error \Warning ;
1817use Test \TestCase ;
1918
2019class IconBuilderTest extends TestCase {
@@ -165,8 +164,7 @@ public function testGetFavicon($app, $color, $file) {
165164
166165 public function testGetFaviconNotFound () {
167166 $ this ->checkImagick ();
168- $ this ->expectWarning (Warning::class);
169- $ util = $ this ->getMockBuilder (Util::class)->disableOriginalConstructor ()->getMock ();
167+ $ util = $ this ->createMock (Util::class);
170168 $ iconBuilder = new IconBuilder ($ this ->themingDefaults , $ util , $ this ->imageManager );
171169 $ this ->imageManager ->expects ($ this ->once ())
172170 ->method ('shouldReplaceIcons ' )
@@ -179,8 +177,7 @@ public function testGetFaviconNotFound() {
179177
180178 public function testGetTouchIconNotFound () {
181179 $ this ->checkImagick ();
182- $ this ->expectWarning (Warning::class);
183- $ util = $ this ->getMockBuilder (Util::class)->disableOriginalConstructor ()->getMock ();
180+ $ util = $ this ->createMock (Util::class);
184181 $ iconBuilder = new IconBuilder ($ this ->themingDefaults , $ util , $ this ->imageManager );
185182 $ util ->expects ($ this ->once ())
186183 ->method ('getAppIcon ' )
@@ -190,8 +187,7 @@ public function testGetTouchIconNotFound() {
190187
191188 public function testColorSvgNotFound () {
192189 $ this ->checkImagick ();
193- $ this ->expectWarning (Warning::class);
194- $ util = $ this ->getMockBuilder (Util::class)->disableOriginalConstructor ()->getMock ();
190+ $ util = $ this ->createMock (Util::class);
195191 $ iconBuilder = new IconBuilder ($ this ->themingDefaults , $ util , $ this ->imageManager );
196192 $ util ->expects ($ this ->once ())
197193 ->method ('getAppImage ' )
0 commit comments