Commit a126fb83 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Correction bug introduit dans TheseControllerAssertion avec setContext().

parent d0d04c92
Loading
Loading
Loading
Loading
Loading
+6 −2
Changes for module/Application/src/Application/Assertion/ControllerAssertion.php: 6 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -21,7 +21,11 @@ abstract class ControllerAssertion implements ControllerAssertionInterface
     */
    public function setContext(array $context)
    {
        $this->controller = isset($context['controller']) ? $context['controller'] : null;
        $this->action     = isset($context['action']) ? $context['action'] : null;
        if (array_key_exists('controller', $context)) {
            $this->controller = $context['controller'];
        }
        if (array_key_exists('action', $context)) {
            $this->action = $context['action'];
        }
    }
}
 No newline at end of file
+6 −3
Changes for module/Application/src/Application/Assertion/These/TheseControllerAssertion.php: 6 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -32,8 +32,12 @@ class TheseControllerAssertion extends ControllerAssertion
    {
        parent::setContext($context);

        $this->these     = isset($context['these']) ?     $context['these'] :     null;
        $this->doctorant = isset($context['doctorant']) ? $context['doctorant'] : null;
        if (array_key_exists('these', $context)) {
            $this->these = $context['these'];
        }
        if (array_key_exists('doctorant', $context)) {
            $this->doctorant = $context['doctorant'];
        }
    }

    /**
@@ -71,7 +75,6 @@ class TheseControllerAssertion extends ControllerAssertion
        }

        return $this->these && $this->these->getDoctorant()->getId() === $this->getIdentityDoctorant()->getId();
//        return $this->doctorant->getId() === $this->getIdentityDoctorant()->getId();
    }

    /**