mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for scheduler tests after refactor
This commit is contained in:
parent
222806eeeb
commit
139843a129
@ -25,6 +25,7 @@ use App\DataMapper\Schedule\EmailStatement;
|
|||||||
use App\Services\Scheduler\SchedulerService;
|
use App\Services\Scheduler\SchedulerService;
|
||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
use Illuminate\Foundation\Testing\WithoutEvents;
|
use Illuminate\Foundation\Testing\WithoutEvents;
|
||||||
|
use App\Services\Scheduler\EmailStatementService;
|
||||||
use Illuminate\Routing\Middleware\ThrottleRequests;
|
use Illuminate\Routing\Middleware\ThrottleRequests;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -399,12 +400,13 @@ class SchedulerTest extends TestCase
|
|||||||
|
|
||||||
$scheduler->fill($data);
|
$scheduler->fill($data);
|
||||||
$scheduler->save();
|
$scheduler->save();
|
||||||
|
$scheduler->calculateNextRun();
|
||||||
|
|
||||||
$service_object = new SchedulerService($scheduler);
|
// $service_object = new SchedulerService($scheduler);
|
||||||
|
|
||||||
$reflectionMethod = new \ReflectionMethod(SchedulerService::class, 'calculateNextRun');
|
// $reflectionMethod = new \ReflectionMethod(SchedulerService::class, 'calculateNextRun');
|
||||||
$reflectionMethod->setAccessible(true);
|
// $reflectionMethod->setAccessible(true);
|
||||||
$method = $reflectionMethod->invoke(new SchedulerService($scheduler));
|
// $method = $reflectionMethod->invoke(new SchedulerService($scheduler));
|
||||||
|
|
||||||
$scheduler->fresh();
|
$scheduler->fresh();
|
||||||
$offset = $this->company->timezone_offset();
|
$offset = $this->company->timezone_offset();
|
||||||
@ -434,12 +436,13 @@ class SchedulerTest extends TestCase
|
|||||||
|
|
||||||
$scheduler->fill($data);
|
$scheduler->fill($data);
|
||||||
$scheduler->save();
|
$scheduler->save();
|
||||||
|
$scheduler->calculateNextRun();
|
||||||
|
|
||||||
$service_object = new SchedulerService($scheduler);
|
$service_object = new EmailStatementService($scheduler);
|
||||||
|
|
||||||
$reflectionMethod = new \ReflectionMethod(SchedulerService::class, 'calculateStartAndEndDates');
|
$reflectionMethod = new \ReflectionMethod(EmailStatementService::class, 'calculateStartAndEndDates');
|
||||||
$reflectionMethod->setAccessible(true);
|
$reflectionMethod->setAccessible(true);
|
||||||
$method = $reflectionMethod->invoke(new SchedulerService($scheduler));
|
$method = $reflectionMethod->invoke(new EmailStatementService($scheduler));
|
||||||
|
|
||||||
$this->assertIsArray($method);
|
$this->assertIsArray($method);
|
||||||
|
|
||||||
@ -469,16 +472,11 @@ class SchedulerTest extends TestCase
|
|||||||
$scheduler->fill($data);
|
$scheduler->fill($data);
|
||||||
$scheduler->save();
|
$scheduler->save();
|
||||||
|
|
||||||
$service_object = new SchedulerService($scheduler);
|
$service_object = new EmailStatementService($scheduler);
|
||||||
|
|
||||||
// $reflection = new \ReflectionClass(get_class($service_object));
|
$reflectionMethod = new \ReflectionMethod(EmailStatementService::class, 'calculateStatementProperties');
|
||||||
// $method = $reflection->getMethod('calculateStatementProperties');
|
|
||||||
// $method->setAccessible(true);
|
|
||||||
// $method->invokeArgs($service_object, []);
|
|
||||||
|
|
||||||
$reflectionMethod = new \ReflectionMethod(SchedulerService::class, 'calculateStatementProperties');
|
|
||||||
$reflectionMethod->setAccessible(true);
|
$reflectionMethod->setAccessible(true);
|
||||||
$method = $reflectionMethod->invoke(new SchedulerService($scheduler)); // 'baz'
|
$method = $reflectionMethod->invoke(new EmailStatementService($scheduler)); // 'baz'
|
||||||
|
|
||||||
$this->assertIsArray($method);
|
$this->assertIsArray($method);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user