FlowTest::testGetDefault()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2014-2018
6
 */
7
8
9
namespace Aimeos\MW\Session;
10
11
12
/**
13
 * Test class for \Aimeos\MW\Session\Flow.
14
 */
15
class FlowTest 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...
16
{
17
	private $object;
18
19
20
	/**
21
	 * Sets up the fixture, for example, opens a network connection.
22
	 * This method is called before a test is executed.
23
	 *
24
	 * @access protected
25
	 */
26
	protected function setUp()
27
	{
28
		if( class_exists( '\\Neos\\Flow\\Session\\Session' ) === false ) {
29
			$this->markTestSkipped( 'Class \\Neos\\Flow\\Session\\Session not found' );
30
		}
31
32
		$session = new \Neos\Flow\Session\TransientSession();
33
		$session->start();
34
35
		$this->object = new \Aimeos\MW\Session\Flow( $session );
36
	}
37
38
39
	/**
40
	 * Tears down the fixture, for example, closes a network connection.
41
	 * This method is called after a test is executed.
42
	 *
43
	 * @access protected
44
	 */
45
	protected function tearDown()
46
	{
47
		unset( $this->object );
48
	}
49
50
51
	public function testGetDefault()
52
	{
53
		$this->assertEquals( null, $this->object->get( 'notexist' ) );
54
	}
55
56
57
	public function testGetSet()
58
	{
59
		$this->assertInstanceof( '\Aimeos\MW\Session\Iface', $this->object->set( 'key', 'value' ) );
60
		$this->assertEquals( 'value', $this->object->get( 'key' ) );
61
	}
62
63
64
	public function testGetSetArray()
65
	{
66
		$this->assertInstanceof( '\Aimeos\MW\Session\Iface', $this->object->set( 'key', array( 'value' ) ) );
67
		$this->assertEquals( array( 'value' ), $this->object->get( 'key' ) );
68
	}
69
}
70