Code Duplication    Length = 18-21 lines in 2 locations

spec/DependencyInjection/GesdinetJWTRefreshTokenExtensionSpec.php 2 locations

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