1 | <?php |
||||
2 | |||||
3 | namespace Alive2212\LaravelSmartRestfulTest\Unit; |
||||
4 | |||||
5 | use Alive2212\LaravelSmartMeta\Cache; |
||||
0 ignored issues
–
show
|
|||||
6 | use Alive2212\LaravelSmartMeta\SmartMeta; |
||||
0 ignored issues
–
show
The type
Alive2212\LaravelSmartMeta\SmartMeta 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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||
7 | use Alive2212\LaravelSmartMeta\SmartMetaClass; |
||||
0 ignored issues
–
show
The type
Alive2212\LaravelSmartMeta\SmartMetaClass 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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||
8 | use Alive2212\LaravelSmartResponse\ResponseModel; |
||||
9 | use Illuminate\Container\Container; |
||||
10 | use Illuminate\Database\Eloquent\Model; |
||||
11 | use Illuminate\Support\Facades\Facade; |
||||
12 | use PHPUnit\Framework\TestCase; |
||||
13 | |||||
14 | class DemoTest extends TestCase |
||||
15 | { |
||||
16 | /** |
||||
17 | * @var string |
||||
18 | */ |
||||
19 | private $PACKAGE_NAME = "LaravelSmartRestful"; |
||||
20 | |||||
21 | /** |
||||
22 | * @var array |
||||
23 | */ |
||||
24 | private $PACKAGE_CLASSES = [ |
||||
25 | // "BaseAuthModel", |
||||
26 | "BaseController", |
||||
27 | // "BaseModel", |
||||
28 | ]; |
||||
29 | |||||
30 | /** |
||||
31 | * @var string |
||||
32 | */ |
||||
33 | private $VENDOR = 'Alive2212'; |
||||
34 | |||||
35 | protected $app; |
||||
36 | |||||
37 | public function __construct() |
||||
38 | { |
||||
39 | parent::__construct(); |
||||
40 | $this->createApplication(); |
||||
41 | } |
||||
42 | |||||
43 | public function createApplication() |
||||
44 | { |
||||
45 | $app = new Container(); |
||||
46 | $app->bind('app', 'Illuminate\Container\Container'); |
||||
47 | |||||
48 | foreach ($this->PACKAGE_CLASSES as $PACKAGE_CLASS) { |
||||
49 | $app->bind($PACKAGE_CLASS, $this->VENDOR.'\\'.$this->PACKAGE_NAME.'\\'.$PACKAGE_CLASS); |
||||
50 | } |
||||
51 | |||||
52 | $app->bind('Cache', 'Illuminate\Support\Facades\Cache'); |
||||
53 | |||||
54 | $this->app = $app; |
||||
55 | Facade::setFacadeApplication($app); |
||||
0 ignored issues
–
show
$app of type Illuminate\Container\Container is incompatible with the type Illuminate\Contracts\Foundation\Application expected by parameter $app of Illuminate\Support\Facad...:setFacadeApplication() .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
56 | } |
||||
57 | |||||
58 | /** |
||||
59 | * A basic test example. |
||||
60 | * |
||||
61 | * @return void |
||||
62 | */ |
||||
63 | public function testBasicTest() |
||||
64 | { |
||||
65 | // create String Helper |
||||
66 | foreach ($this->PACKAGE_CLASSES as $PACKAGE_CLASS) { |
||||
67 | ${$PACKAGE_CLASS} = $this->app->make($PACKAGE_CLASS); |
||||
68 | } |
||||
69 | |||||
70 | $testArray = [ |
||||
0 ignored issues
–
show
|
|||||
71 | 'key1' => 'value1', |
||||
72 | 'key2' => [ |
||||
73 | 'key21' => 'value21', |
||||
74 | ] |
||||
75 | ]; |
||||
76 | |||||
77 | $this->assertTrue(true); |
||||
78 | } |
||||
79 | } |
||||
80 |
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