Code Duplication    Length = 14-14 lines in 2 locations

tests/features/bootstrap/ServiceProviderContext.php 2 locations

@@ 112-125 (lines=14) @@
109
        $this->registerIdp($entityId, false);
110
    }
111
112
    private function registerSp($entityId, $sfoEnabled)
113
    {
114
        $publicKeyLoader = new KeyLoader();
115
        // todo: use from services_test.yml
116
        $publicKeyLoader->loadCertificateFile('/var/www/ci/certificates/sp.crt');
117
        $keys = $publicKeyLoader->getKeys();
118
        /** @var Key $cert */
119
        $cert = $keys->first();
120
121
        $spEntity = $this->fixtureService->registerSP($entityId, $cert['X509Certificate'], $sfoEnabled);
122
123
        $spEntity['configuration'] = json_decode($spEntity['configuration'], true);
124
        $this->currentSp = $spEntity;
125
    }
126
127
    private function registerIdP($entityId)
128
    {
@@ 127-140 (lines=14) @@
124
        $this->currentSp = $spEntity;
125
    }
126
127
    private function registerIdP($entityId)
128
    {
129
        $publicKeyLoader = new KeyLoader();
130
        // todo: use from services_test.yml
131
        $publicKeyLoader->loadCertificateFile('/var/www/ci/certificates/idp.crt');
132
        $keys = $publicKeyLoader->getKeys();
133
        /** @var Key $cert */
134
        $cert = $keys->first();
135
136
        $idpEntity = $this->fixtureService->registerIdP($entityId, $cert['X509Certificate']);
137
138
        $idpEntity['configuration'] = json_decode($idpEntity['configuration'], true);
139
        $this->currentIdP = $idpEntity;
140
    }
141
142
    /**
143
     * @When /^([^\']*) starts a SFO authentication$/