Code Duplication    Length = 22-22 lines in 2 locations

src/LAG/AdminBundle/Tests/AdminBundle/Action/Factory/ActionFactoryTest.php 2 locations

@@ 69-90 (lines=22) @@
66
    /**
67
     * If the Controller is not an ActionInterface, nothing should be done.
68
     */
69
    public function testInjectConfigurationWithoutActionInterface()
70
    {
71
        $configurationFactory = $this->getMockWithoutConstructor(ConfigurationFactory::class);
72
        $actionRegistry = $this->getMockWithoutConstructor(Registry::class);
73
        
74
        // no event should be dispatched
75
        $eventDispatcher = $this->getMockWithoutConstructor(EventDispatcher::class);
76
        $eventDispatcher
77
            ->expects($this->never())
78
            ->method('dispatch')
79
        ;
80
        
81
        $actionFactory = new ActionFactory(
82
            $configurationFactory,
83
            $eventDispatcher,
84
            $actionRegistry
85
        );
86
        $controller = $this->getMockWithoutConstructor(Controller::class);
87
        $request = new Request();
88
        
89
        $actionFactory->injectConfiguration($controller, $request);
90
    }
91
    
92
    /**
93
     * If the Controller has no Admin, nothing should be done.
@@ 95-116 (lines=22) @@
92
    /**
93
     * If the Controller has no Admin, nothing should be done.
94
     */
95
    public function testInjectConfigurationWithoutAdmin()
96
    {
97
        $configurationFactory = $this->getMockWithoutConstructor(ConfigurationFactory::class);
98
        $actionRegistry = $this->getMockWithoutConstructor(Registry::class);
99
        
100
        // no event should be dispatched
101
        $eventDispatcher = $this->getMockWithoutConstructor(EventDispatcher::class);
102
        $eventDispatcher
103
            ->expects($this->never())
104
            ->method('dispatch')
105
        ;
106
        
107
        $actionFactory = new ActionFactory(
108
            $configurationFactory,
109
            $eventDispatcher,
110
            $actionRegistry
111
        );
112
        $controller = $this->getMockWithoutConstructor(ActionInterface::class);
113
        $request = new Request();
114
        
115
        $actionFactory->injectConfiguration($controller, $request);
116
    }
117
    
118
    public function testInjectConfiguration()
119
    {