Passed
Push — main ( 12a629...578b7d )
by Siad
06:13
created

DisguiseLoggerTest::maskOutput()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Phing\Test\Listener;
4
5
use Phing\Listener\BuildEvent;
6
use Phing\Listener\DisguiseLogger;
7
use Phing\Project;
8
use PHPUnit\Framework\TestCase;
9
10
/**
11
 * @internal
12
 */
13
class DisguiseLoggerTest extends TestCase
14
{
15
    private DisguiseLogger $logger;
16
17
    public function setUp(): void
18
    {
19
        $this->logger = new DisguiseLogger();
20
    }
21
22
    /**
23
     * @test
24
     */
25
    public function maskOutput()
26
    {
27
        $event = new BuildEvent(new Project());
28
        $event->setMessage('https://foo:[email protected]', $event->getPriority());
29
        $this->assertNull($this->logger->messageLogged($event));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->logger->messageLogged($event) targeting Phing\Listener\DisguiseLogger::messageLogged() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
30
    }
31
32
    /**
33
     * @test
34
     */
35
    public function buildStarted()
36
    {
37
        $event = new BuildEvent(new Project());
38
        $event->setMessage('https://foo:[email protected]', $event->getPriority());
39
        $this->assertNull($this->logger->buildStarted($event));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->logger->buildStarted($event) targeting Phing\Listener\DisguiseLogger::buildStarted() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
40
    }
41
42
    /**
43
     * @test
44
     */
45
    public function buildFinished()
46
    {
47
        $event = new BuildEvent(new Project());
48
        $event->setMessage('https://foo:[email protected]', $event->getPriority());
49
        $this->assertNull($this->logger->buildFinished($event));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->logger->buildFinished($event) targeting Phing\Listener\DisguiseLogger::buildFinished() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
50
    }
51
52
    /**
53
     * @test
54
     */
55
    public function targetStarted()
56
    {
57
        $event = new BuildEvent(new Project());
58
        $event->setMessage('https://foo:[email protected]', $event->getPriority());
59
        $this->assertNull($this->logger->targetStarted($event));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->logger->targetStarted($event) targeting Phing\Listener\DisguiseLogger::targetStarted() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
60
    }
61
62
    /**
63
     * @test
64
     */
65
    public function targetFinished()
66
    {
67
        $event = new BuildEvent(new Project());
68
        $event->setMessage('https://foo:[email protected]', $event->getPriority());
69
        $this->assertNull($this->logger->targetFinished($event));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->logger->targetFinished($event) targeting Phing\Listener\DisguiseLogger::targetFinished() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
70
    }
71
72
    /**
73
     * @test
74
     */
75
    public function taskStarted()
76
    {
77
        $event = new BuildEvent(new Project());
78
        $event->setMessage('https://foo:[email protected]', $event->getPriority());
79
        $this->assertNull($this->logger->taskStarted($event));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->logger->taskStarted($event) targeting Phing\Listener\DisguiseLogger::taskStarted() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
80
    }
81
82
    /**
83
     * @test
84
     */
85
    public function taskFinished()
86
    {
87
        $event = new BuildEvent(new Project());
88
        $event->setMessage('https://foo:[email protected]', $event->getPriority());
89
        $this->assertNull($this->logger->taskFinished($event));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->logger->taskFinished($event) targeting Phing\Listener\DisguiseLogger::taskFinished() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
90
    }
91
}
92