ZendTest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 46
rs 10
c 0
b 0
f 0
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 8 2
A testCreateMessage() 0 4 1
A testSend() 0 5 1
A tearDown() 0 2 1
1
<?php
2
3
namespace Aimeos\MW\Mail;
4
5
6
/**
7
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
8
 * @copyright Metaways Infosystems GmbH, 2013
9
 * @copyright Aimeos (aimeos.org), 2014-2018
10
 */
11
class ZendTest extends \PHPUnit\Framework\TestCase
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
{
13
	private $object;
14
	private $mock;
15
16
17
	/**
18
	 * Sets up the fixture, for example, opens a network connection.
19
	 * This method is called before a test is executed.
20
	 *
21
	 * @access protected
22
	 */
23
	protected function setUp()
24
	{
25
		if( !class_exists( 'Zend_Mail' ) ) {
26
			$this->markTestSkipped( 'Zend_Mail is not available' );
27
		}
28
29
		$this->mock = $this->getMockBuilder( 'Zend_Mail' )->disableOriginalConstructor()->getMock();
30
		$this->object = new \Aimeos\MW\Mail\Zend( $this->mock );
31
	}
32
33
34
	/**
35
	 * Tears down the fixture, for example, closes a network connection.
36
	 * This method is called after a test is executed.
37
	 *
38
	 * @access protected
39
	 */
40
	protected function tearDown()
41
	{
42
	}
43
44
45
	public function testCreateMessage()
46
	{
47
		$result = $this->object->createMessage( 'ISO-8859-1' );
48
		$this->assertInstanceOf( '\\Aimeos\\MW\\Mail\\Message\\Iface', $result );
49
	}
50
51
52
	public function testSend()
53
	{
54
		$this->mock->expects( $this->once() )->method( 'send' );
55
56
		$this->object->send( $this->object->createMessage() );
57
	}
58
}
59