Issues (12)

lib/custom/tests/MW/Mail/Zend2Test.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Aimeos\MW\Mail;
4
5
6
/**
7
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
8
 * @copyright Aimeos (aimeos.org), 2014-2018
9
 */
10
class Zend2Test extends \PHPUnit\Framework\TestCase
0 ignored issues
show
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...
11
{
12
	private $object;
13
	private $mock;
14
15
16
	/**
17
	 * Sets up the fixture, for example, opens a network connection.
18
	 * This method is called before a test is executed.
19
	 *
20
	 * @access protected
21
	 */
22
	protected function setUp()
23
	{
24
		if( !class_exists( 'Zend\Mail\Message' ) ) {
25
			$this->markTestSkipped( 'Zend\Mail\Message is not available' );
26
		}
27
28
		$this->mock = $this->getMockBuilder( 'Zend\Mail\Transport\File' )->getMock();
29
		$this->object = new \Aimeos\MW\Mail\Zend2( $this->mock );
30
	}
31
32
	/**
33
	 * Tears down the fixture, for example, closes a network connection.
34
	 * This method is called after a test is executed.
35
	 *
36
	 * @access protected
37
	 */
38
	protected function tearDown()
39
	{
40
	}
41
42
43
	public function testCreateMessage()
44
	{
45
		$result = $this->object->createMessage( 'ISO-8859-1' );
46
		$this->assertInstanceOf( '\\Aimeos\\MW\\Mail\\Message\\Iface', $result );
47
	}
48
49
50
	public function testSend()
51
	{
52
		$this->mock->expects( $this->once() )->method( 'send' );
53
54
		$this->object->send( $this->object->createMessage() );
55
	}
56
57
}
58