Passed
Branch master (b37043)
by Timo
11:18
created

SolrConfigStatusTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 60 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 9
loc 15
rs 10
c 1
b 0
f 0
wmc 1
lcom 0
cbo 3

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
namespace ApacheSolrForTypo3\Solr\Tests\Integration\Report;
3
4
/***************************************************************
5
 *  Copyright notice
6
 *
7
 *  (c) 2010-2015 Timo Schmidt <[email protected]>
8
 *  All rights reserved
9
 *
10
 *  This script is part of the TYPO3 project. The TYPO3 project is
11
 *  free software; you can redistribute it and/or modify
12
 *  it under the terms of the GNU General Public License as published by
13
 *  the Free Software Foundation; either version 2 of the License, or
14
 *  (at your option) any later version.
15
 *
16
 *  The GNU General Public License can be found at
17
 *  http://www.gnu.org/copyleft/gpl.html.
18
 *
19
 *  This script is distributed in the hope that it will be useful,
20
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
 *  GNU General Public License for more details.
23
 *
24
 *  This copyright notice MUST APPEAR in all copies of the script!
25
 ***************************************************************/
26
use ApacheSolrForTypo3\Solr\Report\SchemaStatus;
27
use ApacheSolrForTypo3\Solr\Report\SolrConfigStatus;
28
use ApacheSolrForTypo3\Solr\Tests\Integration\IntegrationTest;
29
use TYPO3\CMS\Core\Utility\GeneralUtility;
30
use TYPO3\CMS\Reports\Status;
31
32
/**
33
 * Integration test for the config status report
34
 *
35
 * @author Timo Hund
36
 * @package TYPO3
37
 * @subpackage solr
38
 */
39
class SolrConfigStatusTest extends IntegrationTest
40
{
41
    /**
42
     * @test
43
     */
44
    public function canGetAGreenSolrConfigStatusAgainstTestServer()
45
    {
46
        $this->importDataSetFromFixture('can_check_status.xml');
47
48
        /** @var $schemaStatus  SolrConfigStatus */
49
        $schemaStatus = GeneralUtility::makeInstance(SolrConfigStatus::class);
50
        $violations = $schemaStatus->getStatus();
51
        $this->assertEmpty($violations, 'We expect to get no violations against the test solr server');
52
    }
53
}
54