Issues (43)

Tests/Unit/Controller/AccountControllerTest.php (1 issue)

Labels
Severity
1
<?php
2
3
4
namespace Aimeos\Shop\Tests\Unit\Controller;
5
6
7
class AccountControllerTest extends \Neos\Flow\Tests\UnitTestCase
0 ignored issues
show
The type Neos\Flow\Tests\UnitTestCase 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...
8
{
9
	private $object;
10
	private $response;
11
	private $view;
12
13
14
	public function setUp()
15
	{
16
		$this->object = $this->getMockBuilder( '\Aimeos\Shop\Controller\AccountController' )
17
			->setMethods( array( 'getOutput', 'get' ) )
18
			->disableOriginalConstructor()
19
			->getMock();
20
21
		$this->view = $this->getMockBuilder( '\Neos\Flow\Mvc\View\JsonView' )
22
			->disableOriginalConstructor()
23
			->getMock();
24
25
		$this->response = $this->getMockBuilder( '\Neos\Flow\Http\Response' )
26
			->disableOriginalConstructor()
27
			->getMock();
28
29
		$this->inject( $this->object, 'view', $this->view );
30
		$this->inject( $this->object, 'response', $this->response );
31
	}
32
33
34
	/**
35
	 * @test
36
	 */
37
	public function indexAction()
38
	{
39
		$expected = array( 'aibody' => 'body', 'aiheader' => 'header' );
40
41
		$this->object->expects( $this->once() )->method( 'get' )
42
			->will( $this->returnValue( $expected ) );
43
44
		$this->view->expects( $this->once() )->method( 'assignMultiple' )
45
			->with( $this->equalTo( $expected ) );
46
47
		$this->object->indexAction();
48
	}
49
50
51
	/**
52
	 * @test
53
	 */
54
	public function favoriteComponentAction()
55
	{
56
		$this->object->expects( $this->once() )->method( 'getOutput' )
57
			->will( $this->returnValue( 'body' ) );
58
59
		$this->view->expects( $this->once() )->method( 'assign' )
60
			->with( $this->equalTo( 'output' ), $this->equalTo( 'body' ) );
61
62
		$this->object->favoriteComponentAction();
63
	}
64
65
66
	/**
67
	 * @test
68
	 */
69
	public function historyComponentAction()
70
	{
71
		$this->object->expects( $this->once() )->method( 'getOutput' )
72
			->will( $this->returnValue( 'body' ) );
73
74
		$this->view->expects( $this->once() )->method( 'assign' )
75
			->with( $this->equalTo( 'output' ), $this->equalTo( 'body' ) );
76
77
		$this->object->historyComponentAction();
78
	}
79
80
81
	/**
82
	 * @test
83
	 */
84
	public function profileComponentAction()
85
	{
86
		$this->object->expects( $this->once() )->method( 'getOutput' )
87
			->will( $this->returnValue( 'body' ) );
88
89
		$this->view->expects( $this->once() )->method( 'assign' )
90
			->with( $this->equalTo( 'output' ), $this->equalTo( 'body' ) );
91
92
		$this->object->profileComponentAction();
93
	}
94
95
96
	/**
97
	 * @test
98
	 */
99
	public function watchComponentAction()
100
	{
101
		$this->object->expects( $this->once() )->method( 'getOutput' )
102
			->will( $this->returnValue( 'body' ) );
103
104
		$this->view->expects( $this->once() )->method( 'assign' )
105
			->with( $this->equalTo( 'output' ), $this->equalTo( 'body' ) );
106
107
		$this->object->watchComponentAction();
108
	}
109
}