1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Xmf\Test\Module\Helper; |
6
|
|
|
|
7
|
|
|
use PHPUnit\Framework\TestCase; |
|
|
|
|
8
|
|
|
use Xmf\Module\Helper\AbstractHelper; |
9
|
|
|
|
10
|
|
|
require_once dirname(__DIR__, 5) . '/init_new.php'; |
11
|
|
|
|
12
|
|
|
class AbstractHelperTest extends TestCase |
13
|
|
|
{ |
14
|
|
|
/** |
15
|
|
|
* @var AbstractHelper |
16
|
|
|
*/ |
17
|
|
|
protected $object; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* Sets up the fixture, for example, opens a network connection. |
21
|
|
|
* This method is called before a test is executed. |
22
|
|
|
*/ |
23
|
|
|
protected function setUp(): void |
24
|
|
|
{ |
25
|
|
|
//$this->object = new \Xmf\Module\Helper\AbstractHelper; |
26
|
|
|
$this->object = $this->getMockForAbstractClass(AbstractHelper::class); |
27
|
|
|
//$this->object->expects($this->any()) |
28
|
|
|
// ->method('getDefaultParams') |
29
|
|
|
// ->will($this->returnValue(array())); |
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
|
|
|
protected function tearDown(): void |
37
|
|
|
{ |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
public function testSetDebug() |
41
|
|
|
{ |
42
|
|
|
//TODO change $debug in AbstractHelper from protected to public, otherwise assertEquals() won't work |
43
|
|
|
|
44
|
|
|
$this->assertTrue(method_exists($this->object, 'setDebug')); |
45
|
|
|
$this->object->setDebug(true); |
46
|
|
|
// $this->assertAttributeEquals(true, 'debug', $this->object); |
47
|
|
|
$this->assertEquals(true, $this->object->debug); |
48
|
|
|
$this->object->setDebug(false); |
49
|
|
|
// $this->assertAttributeEquals(false, 'debug', $this->object); |
50
|
|
|
$this->assertEquals(false, $this->object->debug); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
public function testAddLog() |
54
|
|
|
{ |
55
|
|
|
$this->assertTrue(method_exists($this->object, 'addLog')); |
56
|
|
|
$this->object->addLog('message to send to bitbucket'); |
57
|
|
|
} |
58
|
|
|
} |
59
|
|
|
|
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