1 | <?php |
||||
2 | declare(strict_types=1); |
||||
3 | defined('BASEPATH') OR exit('No direct script access allowed'); |
||||
4 | |||||
5 | use PHPUnit\Framework\TestCase; |
||||
0 ignored issues
–
show
|
|||||
6 | |||||
7 | class APIKeyAuthAuthTest extends TestCase { |
||||
8 | /** |
||||
9 | * Code Igniter Instance. |
||||
10 | * @var object |
||||
11 | */ |
||||
12 | private static $ci; |
||||
13 | /** |
||||
14 | * Package name for simplicity |
||||
15 | * @var string |
||||
16 | */ |
||||
17 | private const PACKAGE = "francis94c/ci-rest"; |
||||
18 | |||||
19 | /** |
||||
20 | * Prerquisites for the Unit Tests. |
||||
21 | * |
||||
22 | * @covers JWT::__construct |
||||
23 | */ |
||||
24 | public static function setUpBeforeClass(): void { |
||||
25 | self::$ci =& get_instance(); |
||||
0 ignored issues
–
show
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
Loading history...
|
|||||
26 | self::$ci->load->database('mysqli://root@localhost/test_db'); |
||||
27 | self::$ci->load->helper("url"); |
||||
28 | $queries = explode("#@@@", file_get_contents(FCPATH . 'application/splints/' . self::PACKAGE . '/phpunit/database.sql')); |
||||
0 ignored issues
–
show
|
|||||
29 | self::assertTrue(count($queries) > 0); |
||||
30 | self::$ci->load->database(); |
||||
31 | foreach ($queries as $query) { |
||||
32 | self::$ci->db->query($query); |
||||
33 | } |
||||
34 | } |
||||
35 | /** |
||||
36 | * [testAPIKeyAuth description] |
||||
37 | */ |
||||
38 | public function testAPIKeyAuth():void { |
||||
39 | $_SERVER['HTTP_X_API_KEY'] = "ABCDE"; |
||||
40 | $this->assertTrue(true); |
||||
41 | } |
||||
42 | /** |
||||
43 | * [tearDownAfterClass description] |
||||
44 | */ |
||||
45 | public static function tearDownAfterClass(): void { |
||||
46 | self::$ci->db->empty_table("api_keys"); |
||||
47 | self::$ci->db->empty_table("users"); |
||||
48 | self::$ci->db->empty_table("rest_api_rate_limit"); |
||||
49 | self::$ci->load->dbforge(); |
||||
50 | self::$ci->dbforge->drop_table("api_keys"); |
||||
51 | self::$ci->dbforge->drop_table("users"); |
||||
52 | self::$ci->dbforge->drop_table("rest_api_rate_limit"); |
||||
53 | self::$ci->db->close(); |
||||
54 | } |
||||
55 | } |
||||
56 |
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