Преглед изворни кода

réparer les tests unitaires

maha bouchiba пре 1 година
родитељ
комит
d4571206dc
1 измењених фајлова са 10 додато и 2 уклоњено
  1. 10 2
      tests/Unit/Service/Security/ModuleTest.php

+ 10 - 2
tests/Unit/Service/Security/ModuleTest.php

@@ -122,14 +122,22 @@ class ModuleTest extends TestCase
         $module = $this->getMockForMethod('getModulesByConditions');
 
         $this->parameterBag->method('get')->with('opentalent.modulesbyconditions')->willReturn(
-            ['CotisationCall' => []]
+            ['CotisationCall' => [
+                'roles' => ['ROLE_COTISATION'],
+                'conditions' => [
+                    'service' => [
+                        'name' => CotisationUtils::class,
+                        'function' => 'isLastParentAndCMF',
+                    ],
+                ],
+            ]]
         );
 
         $organization = $this->getMockBuilder(Organization::class)->getMock();
         $this->reflection
             ->method('dynamicInvokeServiceWithArgsAndMethod')
             ->with(CotisationUtils::class, 'isLastParentAndCMF', [$organization])
-            ->willThrowException(new \Exception());
+            ->willThrowException(new \LogicException());
 
         $this->expectException(\LogicException::class);