Code Duplication    Length = 18-21 lines in 2 locations

spec/DependencyInjection/GesdinetJWTRefreshTokenExtensionSpec.php 2 locations

@@ 71-88 (lines=18) @@
68
        $this->load($configs, $container);
69
    }
70
71
    public function it_should_throw_an_exception_if_specifying_a_non_existent_name_generator_service(
72
        ContainerBuilder $container
73
    ) {
74
        $container->has('some.service.name')
75
                  ->willReturn(false);
76
77
        // Ignore these calls
78
        $container->setParameter(Argument::cetera())
79
                  ->willReturn();
80
        $container->setDefinition(Argument::cetera())
81
                  ->willReturn();
82
        $container->setAlias(Argument::cetera())
83
                  ->willReturn();
84
85
        $configs = array(array('parameter_name_generator' => 'some.service.name'));
86
        $this->shouldThrow('\Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException')
87
             ->during('load', array($configs, $container));
88
    }
89
90
    public function it_should_configure_a_custom_name_generator(ContainerBuilder $container)
91
    {
@@ 90-110 (lines=21) @@
87
             ->during('load', array($configs, $container));
88
    }
89
90
    public function it_should_configure_a_custom_name_generator(ContainerBuilder $container)
91
    {
92
        // Expectations
93
        $container->setAlias('gesdinet.jwtrefreshtoken.name_generator.default', 'some.service.name')
94
                  ->shouldBeCalled();
95
96
        // Stubs
97
        $container->has('some.service.name')
98
                  ->willReturn(true);
99
100
        // Ignore these calls
101
        $container->setParameter(Argument::cetera())
102
                  ->willReturn();
103
        $container->setDefinition(Argument::cetera())
104
                  ->willReturn();
105
        $container->setAlias(Argument::cetera())
106
                  ->willReturn();
107
108
        $configs = array(array('parameter_name_generator' => 'some.service.name'));
109
        $this->load($configs, $container);
110
    }
111
}
112