CLogControllerTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 40
ccs 0
cts 0
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testTimestamp() 0 17 1
A testPrintLog() 0 7 1
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 10 and the first side effect is on line 3.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
namespace Mcknubb\Log;
3
include_once "CLogController.php";
4
include_once "TLog.php";
5
include_once "CLog.php";
6
/**
7
 * HTML Form elements.
8
 *
9
 */
10
class CLogControllerTest extends \PHPUnit_Framework_TestCase
11
{
12
    /**
13
     * Test that the Timestamp method saves the values correctly
14
     *
15
     * @return void
16
     *
17
     */
18
    public function testTimestamp() 
19
    {
20
        
21
        $Clog = new \Mcknubb\Log\CLogController();
22
       
23
        $class = 'testClass';
24
        $method = 'testMethod';
25
        $comment = 'testComment';
26
        $Clog->Timestamp($class, $method, $comment);
27
        $res = $Clog->getTimestampsAsArray();
28
        $resClass = $res[0]['domain'];
29
        $this->assertEquals($resClass, $class, "The registered class doesn't match the result");
30
        $resMethod = $res[0]['where'];
31
        $this->assertEquals($resMethod, $method, "The registerde method doesn't match the result");
32
        $resComment = $res[0]['comment'];
33
        $this->assertEquals($resComment, $comment, "The registered comment doesn't match the result");
34
    }
35
    /**
36
     * Test that we always get a stirng as return value
37
     *
38
     * @return void
39
     *
40
     */
41
    public function testPrintLog() 
42
    {
43
        
44
        $Clog = new \Mcknubb\Log\CLogController();
45
        $res = $Clog->printLog();
46
        $this->assertInternalType('string', $res);
47
    }
48
    
49
}