1 | <?php |
||||||
2 | |||||||
3 | namespace ByTIC\EventDispatcher\Tests\Discovery; |
||||||
4 | |||||||
5 | use ByTIC\EventDispatcher\Discovery\RegisterDiscoveredEvents; |
||||||
6 | use ByTIC\EventDispatcher\Tests\AbstractTest; |
||||||
7 | use ByTIC\EventDispatcher\Tests\Fixtures\Events\Event; |
||||||
8 | use Mockery; |
||||||
0 ignored issues
–
show
|
|||||||
9 | use Mockery\Mock; |
||||||
0 ignored issues
–
show
The type
Mockery\Mock 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 ![]() |
|||||||
10 | |||||||
11 | /** |
||||||
12 | * Class DiscoverProviderTest |
||||||
13 | * @package ByTIC\EventDispatcher\Tests\Discovery |
||||||
14 | */ |
||||||
15 | class DiscoverProviderTest extends AbstractTest |
||||||
16 | { |
||||||
17 | public function test_discover() |
||||||
18 | { |
||||||
19 | $dispatcher = $this->newMockDispatcher(); |
||||||
20 | |||||||
21 | $provider = new RegisterDiscoveredEvents($dispatcher); |
||||||
22 | $provider->addDiscoveryPath(TEST_FIXTURE_PATH . '/Listeners'); |
||||||
23 | $provider->register(); |
||||||
24 | |||||||
25 | $listeners = $dispatcher->getListeners(get_class(new Event())); |
||||||
26 | |||||||
27 | self::assertGreaterThanOrEqual(2, count($listeners)); |
||||||
28 | } |
||||||
29 | |||||||
30 | public function test_discover_once() |
||||||
31 | { |
||||||
32 | /** @var Mock|RegisterDiscoveredEvents $provider */ |
||||||
33 | $provider = Mockery::mock(RegisterDiscoveredEvents::class)->shouldAllowMockingProtectedMethods()->makePartial(); |
||||||
34 | $provider->shouldReceive('doDiscovery')->once(); |
||||||
0 ignored issues
–
show
The method
shouldReceive() does not exist on ByTIC\EventDispatcher\Di...egisterDiscoveredEvents .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||||
35 | $provider->addDiscoveryPath(TEST_FIXTURE_PATH . '/Listeners'); |
||||||
36 | |||||||
37 | $provider->register(); |
||||||
38 | $provider->register(); |
||||||
39 | $provider->register(); |
||||||
40 | } |
||||||
41 | } |
||||||
42 |
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