Passed
Push — master ( 58ce14...c13df0 )
by Francis
01:19
created

BlogTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 20
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testLoadBlog() 0 20 1
1
<?php
2
use PHPUnit\Framework\TestCase;
1 ignored issue
show
Bug introduced by
The type PHPUnit\Framework\TestCase 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...
3
4
final class BlogTest extends TestCase {
5
6
  public function testLoadBlog(): void {
7
    $ci =& get_instance();
1 ignored issue
show
Bug introduced by
The function get_instance was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

7
    $ci =& /** @scrutinizer ignore-call */ get_instance();
Loading history...
8
    $ci->load->splint("francis94c/blog", "+Blogger", null, "blogger");
9
    $ci->load->database();
10
    $ci->load->dbforge();
11
    $this->assertTrue($ci->dbforge->create_database('blog_db'));
12
    $db['hostname'] = 'localhost';
0 ignored issues
show
Comprehensibility Best Practice introduced by
$db was never initialized. Although not strictly required by PHP, it is generally a good practice to add $db = array(); before regardless.
Loading history...
13
    $db['username'] = 'root';
14
    $db['password'] = '';
15
    $db['database'] = 'blog_db';
16
    $db['dbdriver'] = 'mysqli';
17
    $db['dbprefix'] = '';
18
    $db['pconnect'] = FALSE;
19
    $db['db_debug'] = TRUE;
20
    $db['cache_on'] = FALSE;
21
    $db['cachedir'] = '';
22
    $db['char_set'] = 'utf8';
23
    $db['dbcollat'] = 'utf8_general_ci';
24
    $ci->load->database($db);
25
    $this->assertTrue($ci->blogger->install("test_blog"));
26
  }
27
}
28
?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
29