for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Tests\Unit\Notifications\Factories;
use Orchestra\Testbench\Foundation\Application;
use Orchestra\Testbench\TestCase;
use Skater4\LaravelSentryNotifications\Enum\Services;
use Skater4\LaravelSentryNotifications\Notifications\Factories\NotificationEntityFactory;
use Skater4\LaravelSentryNotifications\Notifications\Services\Telegram\Entities\NotifableTelegramChannel;
use Skater4\LaravelSentryNotifications\Exceptions\UnknownServiceException;
use Skater4\LaravelSentryNotifications\Providers\TelegramServiceProvider;
class NotificationEntityFactoryTest extends TestCase
{
/**
* @return void
* @throws UnknownServiceException
*/
public function testCreatesNotifableTelegramChannelForTelegramService()
$factory = new NotificationEntityFactory(Services::SERVICE_TELEGRAM);
$entity = $factory->create();
$this->assertInstanceOf(NotifableTelegramChannel::class, $entity);
}
public function testThrowsExceptionForUnknownService()
$this->expectException(UnknownServiceException::class);
$factory = new NotificationEntityFactory('wtf?');
$factory->create();
* @param Application $app
* @return class-string[]
class-string[]
0
protected function getPackageProviders($app): array
$app
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
protected function getPackageProviders(/** @scrutinizer ignore-unused */ $app): array
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return [
TelegramServiceProvider::class,
];