Failed Conditions
Pull Request — master (#89)
by
unknown
03:07
created

onNotSuccessfulTest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/**
3
 * This file is part of the phpunit-mink library.
4
 * For the full copyright and license information, please view
5
 * the LICENSE file that was distributed with this source code.
6
 *
7
 * @copyright Alexander Obuhovich <[email protected]>
8
 * @link      https://github.com/aik099/phpunit-mink
9
 */
10
11
namespace aik099\PHPUnit;
0 ignored issues
show
introduced by
Expected 2 blank line(-s) after namespace declaration; 1 found
Loading history...
12
13
if (version_compare(\PHPUnit_Runner_Version::id(), '5.0.0', '>=')) {
0 ignored issues
show
introduced by
Expected 1 spaces after "if" opening bracket; 0 found
Loading history...
introduced by
Expected 1 spaces before "if" closing bracket; 0 found
Loading history...
14
    /**
15
     * Implementation for PHPUnit 5+
16
     *
17
     * This code should be moved back to aik099\PHPUnit\BrowserTestCase when dropping support for
18
     * PHP 5.5 and older, as PHPUnit 4 won't be needed anymore.
19
     *
20
     * @internal
21
     */
22
    abstract class PHPUnitCompatibilityTestCase extends \PHPUnit_Framework_TestCase
0 ignored issues
show
introduced by
Abstract class name "PHPUnitCompatibilityTestCase" is not prefixed with "Abstract"
Loading history...
23
    {
24
        /**
25
         * This method is called when a test method did not execute successfully.
26
         *
27
         * @param \Exception $e Exception.
28
         *
29
         * @return void
30
         */
31
        protected function onNotSuccessfulTest($e)
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before function; 0 found
Loading history...
32
        {
33
            $this->onNotSuccessfulTestCompatibilized($e);
34
35
            parent::onNotSuccessfulTest($e);
36
        }
37
38
        abstract protected function onNotSuccessfulTestCompatibilized($e);
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
Expected 1 blank line after function; 0 found
Loading history...
39
    }
2 ignored issues
show
introduced by
Expected 0 spaces before closing brace; 4 found
Loading history...
introduced by
Closing brace of a class must be followed by a single blank line; found 0
Loading history...
40
} else {
0 ignored issues
show
introduced by
Expected "}\nelse \n"; found " else {\n"
Loading history...
introduced by
Beginning of the "else" control structure must be first content on the line
Loading history...
41
    /**
42
     * Implementation for PHPUnit 4
43
     *
44
     * @internal
45
     */
46
    abstract class PHPUnitCompatibilityTestCase extends \PHPUnit_Framework_TestCase
1 ignored issue
show
Comprehensibility Best Practice introduced by
The type aik099\PHPUnit\PHPUnitCompatibilityTestCase has been defined more than once; this definition is ignored, only the first definition in this file (L22-39) is considered.

This check looks for classes that have been defined more than once in the same file.

If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.

This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.

Loading history...
Coding Style introduced by
Only one class is allowed in a file
Loading history...
introduced by
Abstract class name "PHPUnitCompatibilityTestCase" is not prefixed with "Abstract"
Loading history...
47
    {
48
        /**
49
         * This method is called when a test method did not execute successfully.
50
         *
51
         * @param \Exception $e Exception.
52
         *
53
         * @return void
54
         */
55
        protected function onNotSuccessfulTest(\Exception $e)
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before function; 0 found
Loading history...
56
        {
57
            $this->onNotSuccessfulTestCompatibilized($e);
58
59
            parent::onNotSuccessfulTest($e);
60
        }
61
62
        abstract protected function onNotSuccessfulTestCompatibilized($e);
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
Expected 1 blank line after function; 0 found
Loading history...
63
    }
2 ignored issues
show
introduced by
Expected 0 spaces before closing brace; 4 found
Loading history...
introduced by
Closing brace of a class must be followed by a single blank line; found 0
Loading history...
64
}