@@ -301,7 +301,8 @@ public function testBeforeFalse()
301301 $ entity = new Article ();
302302
303303 $ policy = $ this ->getMockBuilder (BeforePolicyInterface::class)
304- ->setMethods (['before ' , 'canAdd ' ])
304+ ->onlyMethods (['before ' ])
305+ ->addMethods (['canAdd ' ])
305306 ->getMock ();
306307
307308 $ policy ->expects ($ this ->once ())
@@ -331,7 +332,8 @@ public function testBeforeTrue()
331332 $ entity = new Article ();
332333
333334 $ policy = $ this ->getMockBuilder (BeforePolicyInterface::class)
334- ->setMethods (['before ' , 'canAdd ' ])
335+ ->onlyMethods (['before ' ])
336+ ->addMethods (['canAdd ' ])
335337 ->getMock ();
336338
337339 $ policy ->expects ($ this ->once ())
@@ -361,7 +363,8 @@ public function testBeforeNull()
361363 $ entity = new Article ();
362364
363365 $ policy = $ this ->getMockBuilder (BeforePolicyInterface::class)
364- ->setMethods (['before ' , 'canAdd ' ])
366+ ->onlyMethods (['before ' ])
367+ ->addMethods (['canAdd ' ])
365368 ->getMock ();
366369
367370 $ policy ->expects ($ this ->once ())
@@ -393,7 +396,8 @@ public function testBeforeResultTrue()
393396 $ entity = new Article ();
394397
395398 $ policy = $ this ->getMockBuilder (BeforePolicyInterface::class)
396- ->setMethods (['before ' , 'canAdd ' ])
399+ ->onlyMethods (['before ' ])
400+ ->addMethods (['canAdd ' ])
397401 ->getMock ();
398402
399403 $ policy ->expects ($ this ->once ())
@@ -423,7 +427,8 @@ public function testBeforeResultFalse()
423427 $ entity = new Article ();
424428
425429 $ policy = $ this ->getMockBuilder (BeforePolicyInterface::class)
426- ->setMethods (['before ' , 'canAdd ' ])
430+ ->onlyMethods (['before ' ])
431+ ->addMethods (['canAdd ' ])
427432 ->getMock ();
428433
429434 $ policy ->expects ($ this ->once ())
0 commit comments