1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
|
4
|
|
|
namespace Aimeos\Aimeos\Tests\Unit\Controller; |
5
|
|
|
|
6
|
|
|
|
7
|
|
|
class LocaleControllerTest |
8
|
|
|
extends \TYPO3\CMS\Core\Tests\UnitTestCase |
|
|
|
|
9
|
|
|
{ |
10
|
|
|
private $object; |
11
|
|
|
|
12
|
|
|
|
13
|
|
|
public function setUp() |
14
|
|
|
{ |
15
|
|
|
\Aimeos\Aimeos\Base::aimeos(); // initialize autoloader |
16
|
|
|
|
17
|
|
|
$this->object = $this->getAccessibleMock('Aimeos\\Aimeos\\Controller\\LocaleController', array('dummy')); |
18
|
|
|
|
19
|
|
|
$objManager = new \TYPO3\CMS\Extbase\Object\ObjectManager(); |
|
|
|
|
20
|
|
|
|
21
|
|
|
$uriBuilder = $objManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder'); |
22
|
|
|
$response = $objManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response'); |
23
|
|
|
$request = $objManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request'); |
24
|
|
|
|
25
|
|
|
$uriBuilder->setRequest($request); |
26
|
|
|
|
27
|
|
|
if (method_exists($response, 'setRequest')) { |
28
|
|
|
$response->setRequest($request); |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
$this->object->_set('uriBuilder', $uriBuilder); |
32
|
|
|
$this->object->_set('response', $response); |
33
|
|
|
$this->object->_set('request', $request); |
34
|
|
|
|
35
|
|
|
$this->object->_call('initializeAction'); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
|
39
|
|
|
public function tearDown() |
40
|
|
|
{ |
41
|
|
|
unset($this->object); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @test |
47
|
|
|
*/ |
48
|
|
|
public function selectAction() |
49
|
|
|
{ |
50
|
|
|
$name = '\\Aimeos\\Client\\Html\\Locale\\Select\\Standard'; |
51
|
|
|
$client = $this->getMock($name, array('getBody', 'getHeader', 'process'), [], '', false); |
52
|
|
|
|
53
|
|
|
$client->expects($this->once())->method('getBody')->will($this->returnValue('body')); |
54
|
|
|
$client->expects($this->once())->method('getHeader')->will($this->returnValue('header')); |
55
|
|
|
|
56
|
|
|
\Aimeos\Client\Html\Locale\Select\Factory::injectClient($name, $client); |
|
|
|
|
57
|
|
|
$output = $this->object->selectAction(); |
58
|
|
|
\Aimeos\Client\Html\Locale\Select\Factory::injectClient($name, null); |
59
|
|
|
|
60
|
|
|
$this->assertEquals('body', $output); |
61
|
|
|
} |
62
|
|
|
} |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths