testCreationOfMailMessageViaFactory()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 9.2
c 0
b 0
f 0
cc 1
eloc 17
nc 1
nop 0
1
<?php
2
3
namespace Org_Heigl\ContactTest\Service;
4
5
use Zend\Mail\Message;
6
use PHPUnit\Framework\TestCase;
7
8
/**
9
 * test case.
10
 */
11
class MailMessageFactoryTest extends TestCase
12
{
13
    
14
    /**
15
     * Prepares the environment before running a test.
16
     */
17
    protected function setUp()
18
    {
19
        parent::setUp();
20
        
21
        // TODO Auto-generated ContactControllerFactoryTest::setUp()
22
    }
23
    
24
    /**
25
     * Cleans up the environment after running a test.
26
     */
27
    protected function tearDown()
28
    {
29
        // TODO Auto-generated ContactControllerFactoryTest::tearDown()
30
        parent::tearDown();
31
    }
32
33
    public function testCreationOfMailMessageViaFactory()
34
    {
35
        $this->markTestSkipped('Some More testing has to be done here');
36
        $mailconfig = array(
37
            'OrgHeiglContact' => array(
38
                'message' => array(
39
                    'from' => '[email protected]',
40
                )
41
            )
42
        );
43
        $serviceLocator = new ServiceLocator();
44
        $serviceLocator->set('config', array());
45
        $factory = new  MailMessageFactory();
46
        $message = $factory->createService($serviceLocator);
47
        $this->assertInstanceOf('\Zend\Mail\message', $message);        
48
        $this->assertEquals($mailconfig['from'], $message->getFrom());  
49
        $this->assertAttributeEquals($transport, 'transport', $controller);      
0 ignored issues
show
Bug introduced by
The variable $transport does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
Bug introduced by
The variable $controller does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
50
        $this->assertAttributeInstanceOf('\Zend\Mail\Message', 'message', $controller);  
51
        $this->assertAttributeEquals($message, 'message', $controller);      
52
        $this->assertAttributeInstanceOf('\OrgHeiglContact\Form\ContactForm', 'form', $controller);        
53
        $this->assertAttributeEquals($contactForm, 'form', $controller);      
0 ignored issues
show
Bug introduced by
The variable $contactForm does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
54
    }
55
}
56
57