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 BeyondCode\LaravelWebSockets\Test; class StatisticsCleanTest extends Tes..
Decoded Output download
<?php
namespace BeyondCode\LaravelWebSockets\Test;
class StatisticsCleanTest extends TestCase
{
public function test_clean_statistics_for_app_id()
{
$rick = $this->newActiveConnection(['public-channel']);
$morty = $this->newActiveConnection(['public-channel'], 'TestKey2');
$this->statisticsCollector->save();
$this->assertCount(2, $records = $this->statisticsStore->getRecords());
foreach ($this->statisticsStore->getRawRecords() as $record) {
$record->update(['created_at' => now()->subDays(10)]);
}
$this->artisan('websockets:clean', [
'appId' => '12345',
'--days' => 1,
]);
$this->assertCount(1, $records = $this->statisticsStore->getRecords());
}
public function test_clean_statistics_older_than_given_days()
{
$rick = $this->newActiveConnection(['public-channel']);
$morty = $this->newActiveConnection(['public-channel'], 'TestKey2');
$this->statisticsCollector->save();
$this->assertCount(2, $records = $this->statisticsStore->getRecords());
foreach ($this->statisticsStore->getRawRecords() as $record) {
$record->update(['created_at' => now()->subDays(10)]);
}
$this->artisan('websockets:clean', ['--days' => 1]);
$this->assertCount(0, $records = $this->statisticsStore->getRecords());
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace BeyondCode\LaravelWebSockets\Test;
class StatisticsCleanTest extends TestCase
{
public function test_clean_statistics_for_app_id()
{
$rick = $this->newActiveConnection(['public-channel']);
$morty = $this->newActiveConnection(['public-channel'], 'TestKey2');
$this->statisticsCollector->save();
$this->assertCount(2, $records = $this->statisticsStore->getRecords());
foreach ($this->statisticsStore->getRawRecords() as $record) {
$record->update(['created_at' => now()->subDays(10)]);
}
$this->artisan('websockets:clean', [
'appId' => '12345',
'--days' => 1,
]);
$this->assertCount(1, $records = $this->statisticsStore->getRecords());
}
public function test_clean_statistics_older_than_given_days()
{
$rick = $this->newActiveConnection(['public-channel']);
$morty = $this->newActiveConnection(['public-channel'], 'TestKey2');
$this->statisticsCollector->save();
$this->assertCount(2, $records = $this->statisticsStore->getRecords());
foreach ($this->statisticsStore->getRawRecords() as $record) {
$record->update(['created_at' => now()->subDays(10)]);
}
$this->artisan('websockets:clean', ['--days' => 1]);
$this->assertCount(0, $records = $this->statisticsStore->getRecords());
}
}
Function Calls
None |
Stats
MD5 | e03901d45473853ad19734cc583908f3 |
Eval Count | 0 |
Decode Time | 97 ms |