FakeNewsletterMailer
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 4
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
wmc 0
lcom 0
cbo 0
1
<?php
2
require_once 'Intraface/modules/newsletter/Observer/OptinMail.php';
3
require_once 'NewsletterStubs.php';
4
5
class FakeNewsletterMailer
6
{
7
8
}
9
10
class NewsletterObserverTest extends PHPUnit_Framework_TestCase
11
{
12
    function createObserver()
13
    {
14
        $list = new FakeNewsletterList();
15
        $list->kernel = new Stub_Kernel;
16
        return new Intraface_Module_Newsletter_Observer_OptinMail($list, new FakeNewsletterMailer);
0 ignored issues
show
Unused Code introduced by
The call to Intraface_Module_Newslet...ptinMail::__construct() has too many arguments starting with new \FakeNewsletterMailer().

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
17
    }
18
19
    ////////////////////////////////////////////////////////////////////
20
21
    function testCreateObserver()
22
    {
23
        $observer = $this->createObserver();
24
        $this->assertTrue(is_object($observer));
25
    }
26
}
27