Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace Illuminate\Tests\Notifications; use Illuminate\Contracts\Database\ModelI..
Decoded Output download
<?php
namespace Illuminate\Tests\Notifications;
use Illuminate\Contracts\Database\ModelIdentifier;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\AnonymousNotifiable;
use Illuminate\Notifications\ChannelManager;
use Illuminate\Notifications\Notifiable;
use Illuminate\Notifications\SendQueuedNotifications;
use Illuminate\Support\Collection;
use Mockery as m;
use PHPUnit\Framework\TestCase;
class NotificationSendQueuedNotificationTest extends TestCase
{
protected function tearDown(): void
{
m::close();
}
public function testNotificationsCanBeSent()
{
$job = new SendQueuedNotifications('notifiables', 'notification');
$manager = m::mock(ChannelManager::class);
$manager->shouldReceive('sendNow')->once()->withArgs(function ($notifiables, $notification, $channels) {
return $notifiables instanceof Collection && $notifiables->toArray() === ['notifiables']
&& $notification === 'notification'
&& $channels === null;
});
$job->handle($manager);
}
public function testSerializationOfNotifiableModel()
{
$identifier = new ModelIdentifier(NotifiableUser::class, [null], [], null);
$serializedIdentifier = serialize($identifier);
$job = new SendQueuedNotifications(new NotifiableUser, 'notification');
$serialized = serialize($job);
$this->assertStringContainsString($serializedIdentifier, $serialized);
}
public function testSerializationOfNormalNotifiable()
{
$notifiable = new AnonymousNotifiable;
$serializedNotifiable = serialize($notifiable);
$job = new SendQueuedNotifications($notifiable, 'notification');
$serialized = serialize($job);
$this->assertStringContainsString($serializedNotifiable, $serialized);
}
public function testNotificationCanSetMaxExceptions()
{
$notifiable = new NotifiableUser;
$notification = new class
{
public $maxExceptions = 23;
};
$job = new SendQueuedNotifications($notifiable, $notification);
$this->assertEquals(23, $job->maxExceptions);
}
}
class NotifiableUser extends Model
{
use Notifiable;
public $table = 'users';
public $timestamps = false;
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Illuminate\Tests\Notifications;
use Illuminate\Contracts\Database\ModelIdentifier;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\AnonymousNotifiable;
use Illuminate\Notifications\ChannelManager;
use Illuminate\Notifications\Notifiable;
use Illuminate\Notifications\SendQueuedNotifications;
use Illuminate\Support\Collection;
use Mockery as m;
use PHPUnit\Framework\TestCase;
class NotificationSendQueuedNotificationTest extends TestCase
{
protected function tearDown(): void
{
m::close();
}
public function testNotificationsCanBeSent()
{
$job = new SendQueuedNotifications('notifiables', 'notification');
$manager = m::mock(ChannelManager::class);
$manager->shouldReceive('sendNow')->once()->withArgs(function ($notifiables, $notification, $channels) {
return $notifiables instanceof Collection && $notifiables->toArray() === ['notifiables']
&& $notification === 'notification'
&& $channels === null;
});
$job->handle($manager);
}
public function testSerializationOfNotifiableModel()
{
$identifier = new ModelIdentifier(NotifiableUser::class, [null], [], null);
$serializedIdentifier = serialize($identifier);
$job = new SendQueuedNotifications(new NotifiableUser, 'notification');
$serialized = serialize($job);
$this->assertStringContainsString($serializedIdentifier, $serialized);
}
public function testSerializationOfNormalNotifiable()
{
$notifiable = new AnonymousNotifiable;
$serializedNotifiable = serialize($notifiable);
$job = new SendQueuedNotifications($notifiable, 'notification');
$serialized = serialize($job);
$this->assertStringContainsString($serializedNotifiable, $serialized);
}
public function testNotificationCanSetMaxExceptions()
{
$notifiable = new NotifiableUser;
$notification = new class
{
public $maxExceptions = 23;
};
$job = new SendQueuedNotifications($notifiable, $notification);
$this->assertEquals(23, $job->maxExceptions);
}
}
class NotifiableUser extends Model
{
use Notifiable;
public $table = 'users';
public $timestamps = false;
}
Function Calls
| None |
Stats
| MD5 | bd96d610dc3925a205d02b9b71bc6153 |
| Eval Count | 0 |
| Decode Time | 85 ms |