|
1
|
|
|
<?php |
|
2
|
|
|
use PHPUnit\Framework\TestCase; |
|
|
|
|
|
|
3
|
|
|
|
|
4
|
|
|
final class BlogTest extends TestCase { |
|
5
|
|
|
|
|
6
|
|
|
private $ci; |
|
7
|
|
|
|
|
8
|
|
|
public function setUp(): void { |
|
9
|
|
|
$this->ci =& get_instance(); |
|
|
|
|
|
|
10
|
|
|
$this->ci->load->database(); |
|
11
|
|
|
$this->ci->db->query("USE test_db;"); |
|
12
|
|
|
$queries = [ |
|
13
|
|
|
"CREATE TABLE IF NOT EXISTS admins (id INT(7) AUTO_INCREMENT PRIMARY KEY, name VARCHAR(20) NOT NULL, password TEXT NOT NULL) Engine=InnoDB;", |
|
14
|
|
|
"INSERT INTO admins (id, name, password) VALUES (1, \"Dev\", \"does_not_matter_for_this_test\");" |
|
15
|
|
|
]; |
|
16
|
|
|
foreach ($queries as $query) { |
|
17
|
|
|
$this->assertTrue($this->ci->db->query($query), "$query, Ran sucessfully."); |
|
18
|
|
|
} |
|
19
|
|
|
} |
|
20
|
|
|
|
|
21
|
|
|
public function testLoadBlog() { |
|
22
|
|
|
$this->ci->load->splint("francis94c/blog", "+Blogger", null, "blogger"); |
|
23
|
|
|
$this->assertTrue($this->ci->blogger->install("test_blog"), "Blog Installed Successfuly without admin ID constraint."); |
|
24
|
|
|
$this->assertTrue($this->ci->blogger->install("test_blog"), "Verify CREATE IF NOT EXISTS clause"); |
|
25
|
|
|
$this->assertTrue($this->ci->blogger->install("admin_test_blog", "admins", "id", 7), "Create Blog with existent admin constarint"); |
|
26
|
|
|
$this->assertTrue($this->ci->blogger->loadEditor("callback"), "Load Editor"); |
|
27
|
|
|
$this->ci->blogger->setBlog("test_blog"); |
|
28
|
|
|
$this->assertTrue($this->ci->blogger->renderPostItems(null, null, null, 1, 0), "Test load empty posts set"); |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
public function tearDown(): void { |
|
32
|
|
|
$this->ci->db->empty_table("admins"); |
|
33
|
|
|
} |
|
34
|
|
|
} |
|
35
|
|
|
|
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