1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Xmf\Test\Database; |
6
|
|
|
|
7
|
|
|
use Xmf\Database\TableLoad; |
8
|
|
|
|
9
|
|
|
use PHPUnit\Framework\TestCase; |
|
|
|
|
10
|
|
|
|
11
|
|
|
require_once dirname(__DIR__, 4) . '/init_new.php'; |
12
|
|
|
|
13
|
|
|
require_once(XOOPS_TU_ROOT_PATH . '/class/logger/xoopslogger.php'); |
14
|
|
|
require_once(XOOPS_TU_ROOT_PATH . '/class/xoopsload.php'); |
15
|
|
|
require_once(XOOPS_TU_ROOT_PATH . '/class/preload.php'); |
16
|
|
|
require_once(XOOPS_TU_ROOT_PATH . '/class/database/databasefactory.php'); |
17
|
|
|
|
18
|
|
|
require_once(XOOPS_TU_ROOT_PATH . '/include/defines.php'); |
19
|
|
|
|
20
|
|
|
class TableLoadTest extends TestCase |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* @var TableLoad |
24
|
|
|
*/ |
25
|
|
|
protected $object; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* Sets up the fixture, for example, opens a network connection. |
29
|
|
|
* This method is called before a test is executed. |
30
|
|
|
*/ |
31
|
|
|
protected function setUp(): void |
32
|
|
|
{ |
33
|
|
|
$this->object = new TableLoad(); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* Tears down the fixture, for example, closes a network connection. |
38
|
|
|
* This method is called after a test is executed. |
39
|
|
|
*/ |
40
|
|
|
protected function tearDown(): void |
41
|
|
|
{ |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
public function testLoadTableFromArray() |
45
|
|
|
{ |
46
|
|
|
// Remove the following lines when you implement this test. |
47
|
|
|
$this->markTestIncomplete( |
48
|
|
|
'This test has not been implemented yet.' |
49
|
|
|
); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
public function testLoadTableFromYamlFile() |
53
|
|
|
{ |
54
|
|
|
// Remove the following lines when you implement this test. |
55
|
|
|
$this->markTestIncomplete( |
56
|
|
|
'This test has not been implemented yet.' |
57
|
|
|
); |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
public function testTruncateTable() |
61
|
|
|
{ |
62
|
|
|
// Remove the following lines when you implement this test. |
63
|
|
|
$this->markTestIncomplete( |
64
|
|
|
'This test has not been implemented yet.' |
65
|
|
|
); |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
public function testRowCount() |
69
|
|
|
{ |
70
|
|
|
$actual = $this->object->countRows('users'); |
71
|
|
|
$this->assertIsInt($actual); |
72
|
|
|
$this->assertTrue($actual >= 1); |
73
|
|
|
} |
74
|
|
|
} |
75
|
|
|
|
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